oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 104 forks source link

Invalid `graalpy` path printed after the graalpython build on macOS #278

Closed rsvoboda closed 2 years ago

rsvoboda commented 2 years ago

Invalid graalpy path printed after the graalpython build on macOS when running mx --dy /compiler python-gvm as suggested in README

...
choosing GRAALVM_HOME=/Users/rsvoboda/tmp/graal/sdk/mxbuild/darwin-amd64/GRAALVM_64CBA9BF90_JAVA17/
  graalvm-64cba9bf90-java17-22.3.0-dev
/Users/rsvoboda/tmp/graal/sdk/mxbuild/darwin-amd64/GRAALVM_64CBA9BF90_JAVA17/
  graalvm-64cba9bf90-java17-22.3.0-dev/Contents/Home/bin/graalpy

The actual path doesn't contain Contents/Home on macOS build (I am using macOS Monterey 12.5.1).

In my case it is /Users/rsvoboda/tmp/graal/sdk/mxbuild/darwin-amd64/GRAALVM_64CBA9BF90_JAVA17/graalvm-64cba9bf90-java17-22.3.0-dev/bin/graalpy

macOS specific behavior was introduced in https://github.com/oracle/graalpython/commit/c90e22e0554045150f25da07b1f7b2eb2cde6cef by @timfel, but I wasn't able to find more details about the trouble it was fixing.

I was just planning to remove macOS specific branch but decided it is better to file an issue first.

tstupka commented 2 years ago

wondering how did you get a graalvm build without Contents/Home what jdk did you use and how is its file layout - also without Contents/Home?

rsvoboda commented 2 years ago
ls /Users/rsvoboda/tmp/graal/sdk/mxbuild/darwin-amd64/GRAALVM_64CBA9BF90_JAVA17/graalvm-64cba9bf90-java17-22.3.0-dev
3rd_party_license_llvm-toolchain.txt THIRD_PARTY_LICENSE_SULONG.txt       jmods                                release
GRAALVM-README.md                    bin                                  languages                            tools
THIRD_PARTY_LICENSE.txt              conf                                 legal
THIRD_PARTY_LICENSE_GRAALPY.txt      include                              lib
rsvoboda commented 2 years ago
java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
tstupka commented 2 years ago

also the jdk (JAVA_HOME) file layout pls

rsvoboda commented 2 years ago
echo $JAVA_HOME
/Users/rsvoboda/.sdkman/candidates/java/17-open

ls $JAVA_HOME
bin     conf    include jmods   legal   lib     release
tstupka commented 2 years ago

afaik, build should be made with labsjdk (which should contain Contents/Home on osx), the simplest way to obtain it would be mx fetch-jdk

i will fix the readme doc accordingly

rsvoboda commented 2 years ago

Thanks for the docs fix. Is there any plan to depend on vanilla jdk instead of labsjdk?

tstupka commented 2 years ago

i'm not aware of any

rsvoboda commented 2 years ago

Thanks!