Skip to content

Commit e8a1813

Browse files
committed
don't use arbitrary relative base, instead build images from the language home
1 parent 1fec2b4 commit e8a1813

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,13 @@ public void initializeHomeAndPrefixPaths(Env newEnv, String languageHome) {
543543

544544
if (ImageInfo.inImageBuildtimeCode()) {
545545
// use relative paths at buildtime to avoid freezing buildsystem paths
546-
TruffleFile base = newEnv.getInternalTruffleFile("").getAbsoluteFile();
546+
TruffleFile base = newEnv.getInternalTruffleFile(basePrefix).getAbsoluteFile();
547+
newEnv.setCurrentWorkingDirectory(base);
548+
basePrefix = ".";
547549
sysPrefix = base.relativize(newEnv.getInternalTruffleFile(sysPrefix)).getPath();
548-
basePrefix = base.relativize(newEnv.getInternalTruffleFile(basePrefix)).getPath();
550+
if (sysPrefix.isEmpty()) {
551+
sysPrefix = ".";
552+
}
549553
coreHome = base.relativize(newEnv.getInternalTruffleFile(coreHome)).getPath();
550554
stdLibHome = base.relativize(newEnv.getInternalTruffleFile(stdLibHome)).getPath();
551555
capiHome = base.relativize(newEnv.getInternalTruffleFile(capiHome)).getPath();

0 commit comments

Comments
 (0)