Skip to content

Commit

Permalink
Add std to module path explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
sungshik committed Dec 17, 2024
1 parent 0cd3f37 commit 5e6b2ce
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/org/rascalmpl/library/util/PathConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,18 @@ public static PathConfig fromSourceProjectRascalManifest(ISourceLocation manifes
IListWriter srcsWriter = vf.listWriter();
IListWriter messages = vf.listWriter();

// Always add the standard library, also for the project named "rascal".
// If the "current" version (as per `resolveCurrentRascalRuntimeJar`) is
// different from the version of `manifestRoot`, then:
// - Rascal modules inside `std` are loaded from the current version.
// - Rascal modules outside `std` are loaded from `manifestRoot`.
// - Java classes (regardless of inside/outside `std`) are loaded from
// the current version. Thus, Rascal modules and Java classes inside
// `std` -- but not outside! -- are consistently loaded.
// Approach:
// - Rascal modules of `rascal` inside `std` are loaded from the
// "current `rascal`" (as per `resolveCurrentRascalRuntimeJar`).
// - Rascal modules of `rascal` outside `std` are loaded from the
// "current project" of this path config (as per `manifestRoot`).
// - Java classes of `rascal`, regardless of inside/outside `std`, are
// loaded from the current `rascal`.
//
// Thus, Rascal modules and Java classes of `rascal` inside `std` are
// guaranteed to be consistently loaded from the same version.
try {
srcsWriter.append(URIUtil.rootLocation("std"));
libsWriter.append(resolveCurrentRascalRuntimeJar());
}
catch (IOException e) {
Expand Down

0 comments on commit 5e6b2ce

Please sign in to comment.