From 5e6b2ceebef09a1ef6550b7010ce68d31fca2dab Mon Sep 17 00:00:00 2001 From: Sung-Shik Jongmans Date: Tue, 17 Dec 2024 12:33:07 +0100 Subject: [PATCH] Add `std` to module path explicitly --- .../rascalmpl/library/util/PathConfig.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index e2e853fa7e..313a28de8b 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -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) {