You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop: find PYTHONHOME beside a native-image executable, and stage it there #246
A GraalVM native image has no java.home, no Compose resources directory and no launcher to set PYTHONHOME, so a packaged native image finds no CPython prefix unless its environment names one (found in #242; needed for #191's first milestone). The sample's native demo works only because its Gradle run task sets PYTHONHOME.
Change (SPEC L-9):
Run time.PackagedPythonHome.resolve adds a fourth source after the existing three. Inside a native image (org.graalvm.nativeimage.imagecode is runtime), it uses <directory of the executable>/python-multiplatform-home when that directory exists. On a JVM the executable is java, so the rule does not apply there. The rest is unchanged: the environment still wins, and the prefix goes through L-3's check, Py_SetPythonHome and the libpython lookup like the other packaged sources.
Build. The Gradle plugin registers stageNativeImagePythonHome, a Sync. It copies the same pruned prefix as Compose packaging (stdlib and shared library; no headers, bin/, Tcl/Tk or __pycache__) into <pythonBindings.nativeImageDirectory>/python-multiplatform-home, and does nothing unless that directory is set.
Completion: PM/desktopTest/.../PackagedPythonHomeTest pins the new resolution step (red first); GP/PackagedPythonHomeTest pins the task's wiring and its no-op default; the existing tests are unchanged.
Activity
Merge pull request #247 from thisisthepy/feat/native-image-python-home
b-re-w commentedon Oct 17, 2026
Landed in develop via #247