Skip to content

Commit 34886f6

Browse files
committed
[GR-71846] Enabling GraalPy on GraalOS.
PullRequest: graalpython/4126
2 parents c90ddaa + 3922ef6 commit 34886f6

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -984,11 +984,16 @@ private void findAndApplyVenvCfg(Builder contextBuilder, String executable) {
984984
}
985985
if (Files.exists(baseExecutable)) {
986986
contextBuilder.option("python.BaseExecutable", baseExecutable.toString());
987-
/*
988-
* This is needed to support the legacy GraalVM layout where the
989-
* executable is a symlink into the 'languages' directory.
990-
*/
991-
contextBuilder.option("python.PythonHome", baseExecutable.getParent().getParent().toString());
987+
if ("/app".equals(baseExecutable.toString())) {
988+
// GraalOS case
989+
contextBuilder.option("python.PythonHome", "/");
990+
} else {
991+
/*
992+
* This is needed to support the legacy GraalVM layout where the
993+
* executable is a symlink into the 'languages' directory.
994+
*/
995+
contextBuilder.option("python.PythonHome", baseExecutable.getParent().getParent().toString());
996+
}
992997
}
993998
} catch (NullPointerException | InvalidPathException ex) {
994999
// NullPointerException covers the possible null result of getParent()

scripts/generate-fsmappings.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ cat <<EOF>> $OUTFILE
9393
{
9494
"concrete": "${MUSL_TOOLCHAIN}/lib/libc++.so.1.0",
9595
"verif": true,
96-
"virt": "/proc/lib/libc++.so.1.0"
96+
"virt": "/lib/libc++.so.1.0"
9797
},
9898
{
9999
"concrete": "${MUSL_TOOLCHAIN}/lib/libc++abi.so.1.0",
100100
"verif": true,
101-
"virt": "/proc/lib/libc++abi.so.1.0"
101+
"virt": "/lib/libc++abi.so.1.0"
102102
},
103103
{
104104
"concrete": "${MUSL_TOOLCHAIN}/lib/libunwind.so.1.0",
105105
"verif": true,
106-
"virt": "/proc/lib/libunwind.so.1.0"
106+
"virt": "/lib/libunwind.so.1.0"
107107
}
108108
]
109109
}

0 commit comments

Comments
 (0)