oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20k stars 1.6k forks source link

Initial install errors #8414

Open novos40 opened 4 months ago

novos40 commented 4 months ago

Describe GraalVM and your environment :


**Have you verified this issue still happens when using the latest snapshot?**
You can find snapshot builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases
Looking to install a stable version of graalpy

**Describe the issue**
I'm a first-time linux user
I'm simply trying to follow the installation steps from https://www.graalvm.org/latest/reference-manual/python/
I've tried both pyenv and conda. Both are failing seemingly for the same reason: can't find posix library.
However I can find libposix.so in multiple locations in my system.
What am I doing wrong and how to fix this?

**Code snippet or code repository that reproduces the issue**

N/A


**Steps to reproduce the issue**
On Linux Fedora 39
folow installation steps from follow the installation steps from https://www.graalvm.org/latest/reference-manual/python/

**Expected behavior**
graalpy virtual environment created

**Additional context**
Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if necesary
[python-build.20240219234059.26538.log](https://github.com/oracle/graal/files/14354286/python-build.20240219234059.26538.log)

<details>
<summary>
Tried both:
1) pyenv install graalpy-23.1.2  -- build failed
2) installed graalpy via conda, graalpy -m venv graalpy --  failed to create environment
</summary>

command: pyenv install graalpy-23.1.2 pyenv build log file

/tmp/python-build.20240219234059.26538 ~ HTTP/2 404 server: GitHub.com content-type: text/html; charset=utf-8 permissions-policy: interest-cohort=() access-control-allow-origin: * etag: "64d39a40-24a3" content-security-policy: default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self' x-proxy-cache: MISS x-github-request-id: 5028:2966F5:3A3A34:54352A:65D45789 accept-ranges: bytes date: Tue, 20 Feb 2024 07:40:58 GMT via: 1.1 varnish age: 0 x-served-by: cache-pao-kpao1770070-PAO x-cache: MISS x-cache-hits: 0 x-timer: S1708414859.697386,VS0,VE85 vary: Accept-Encoding x-fastly-request-id: 8f2bf72e35f296da7cc6ef3c12ebfbd65e396815 content-length: 9379

/tmp/python-build.20240219234059.26538/graalpy-23.1.2 /tmp/python-build.20240219234059.26538 ~ ERROR: java.lang.UnsupportedOperationException: Could not load posix support library from path '/home/oleg/.pyenv/versions/graalpy-23.1.2/lib/graalpy23.1/libposix.so'. Troubleshooting: Check permissions of the file. Missing runtime Maven dependency 'org.graalvm.truffle:truffle-nfi-libffi' (should be a dependency of org.graalvm.polyglot:python{-community})? org.graalvm.polyglot.PolyglotException: java.lang.UnsupportedOperationException: Could not load posix support library from path '/home/oleg/.pyenv/versions/graalpy-23.1.2/lib/graalpy23.1/libposix.so'. Troubleshooting: Check permissions of the file. Missing runtime Maven dependency 'org.graalvm.truffle:truffle-nfi-libffi' (should be a dependency of org.graalvm.polyglot:python{-community})? at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.loadLibrary(NFIPosixSupport.java:371) at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.call(NFIPosixSupport.java:305) at com.oracle.graal.python.runtime.NFIPosixSupport$InvokeNativeFunction.callLong(NFIPosixSupport.java:320) at com.oracle.graal.python.runtime.NFIPosixSupport.lseek(NFIPosixSupport.java:617) at com.oracle.graal.python.runtime.NFIPosixSupportGen$PosixSupportLibraryExports$Uncached.lseek(NFIPosixSupportGen.java:6097) at com.oracle.graal.python.runtime.ImageBuildtimePosixSupport.lseek(ImageBuildtimePosixSupport.java:258) at com.oracle.graal.python.runtime.ImageBuildtimePosixSupportGen$PosixSupportLibraryExports$Uncached.lseek(ImageBuildtimePosixSupportGen.java:2330) at com.oracle.graal.python.runtime.PosixSupportLibraryGen$UncachedDispatch.lseek(PosixSupportLibraryGen.java:6808) at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$SeekNode.internalSeek(FileIOBuiltins.java:813) at com.oracle.graal.python.builtins.modules.io.FileIOBuiltins$TellNode.internalTell(FileIOBuiltins.java:838) at com.oracle.graal.python.builtins.modules.io.AbstractBufferedIOBuiltins$BufferedInitNode.internalInit(AbstractBufferedIOBuiltins.java:120) at com.oracle.graal.python.builtins.modules.io.BufferedReaderBuiltins$BufferedReaderInit.internalInit(BufferedReaderBuiltins.java:103) at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.initStd(SysModuleBuiltins.java:724) at com.oracle.graal.python.builtins.modules.SysModuleBuiltins.postInitialize(SysModuleBuiltins.java:708) at com.oracle.graal.python.builtins.Python3Core.postInitialize(Python3Core.java:962) at com.oracle.graal.python.runtime.PythonContext.patch(PythonContext.java:1458) at com.oracle.graal.python.PythonLanguage.patchContext(PythonLanguage.java:404) at com.oracle.graal.python.PythonLanguage.patchContext(PythonLanguage.java:134) at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.patchEnvContext(LanguageAccessor.java:431) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.patch(PolyglotLanguageContext.java:893) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.patch(PolyglotContextImpl.java:3478) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.loadPreinitializedContext(PolyglotEngineImpl.java:1909) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.createContext(PolyglotEngineImpl.java:1789) at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineDispatch.createContext(PolyglotEngineDispatch.java:152) at org.graalvm.polyglot/org.graalvm.polyglot.Context$Builder.build(Context.java:1937) at com.oracle.graal.python.shell.GraalPythonMain.launch(GraalPythonMain.java:694) at com.oracle.graal.python.enterprise.shell.GraalPythonEnterpriseMain.launch(GraalPythonEnterpriseMain.java:53) at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:296) at org.graalvm.launcher.AbstractLanguageLauncher.launch(AbstractLanguageLauncher.java:121) at org.graalvm.launcher.AbstractLanguageLauncher.runLauncher(AbstractLanguageLauncher.java:168) Suppressed: Attached Guest Language Frames (0) Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.

command: graalpy -m venv graalpy terminal output

Traceback (most recent call last): com.oracle.truffle.api.CompilerDirectives$ShouldNotReachHere: Unable to load native posix support library


</details>
novos40 commented 4 months ago

If it helps here is the log from conda:

[python::Python3Core] FINE: Initial locations:
    Language home: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
    SysPrefix: 
    BaseSysPrefix: 
    CoreHome: 
    StdLibHome: 
    CAPI: 
    JNI library: 
[python::Python3Core] FINE: Updated locations:
    Language home: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
    SysPrefix: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
    BaseSysPrefix: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python
    CoreHome: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
    StdLibHome: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/python3.10
    Executable: /home/oleg/.conda/envs/graalpy/bin/graalpy
    CAPI: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
    JNI library: /home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0
[python::LoggingPosixSupport] INFO: Using class com.oracle.graal.python.runtime.NFIPosixSupport
[python::LoggingPosixSupport] FINER: hasGetpwentries -> return true
[python::GraalPythonModuleBuiltins] FINE: Setting default stdio encoding to utf-8:surrogateescape
[python::Python3Core] FINE: import '_frozen_importlib' # <frozen>
[python::Python3Core] FINE: import '_frozen_importlib_external' # <frozen>
[python::Python3Core] FINE: # installing zipimport hook
[python::Python3Core] FINE: import 'zipimport' # <frozen>
[python::Python3Core] FINE: # installed zipimport hook
[python::Python3Core] FINE: import 'builtins' # <frozen>
[python::Python3Core] FINE: import '__graalpython__' # <frozen>
[python::Python3Core] FINE: import '_weakref' # <frozen>
[python::Python3Core] FINE: import 'bytearray' # <frozen>
[python::Python3Core] FINE: import 'unicodedata' # <frozen>
[python::Python3Core] FINE: import '_sre' # <frozen>
[python::Python3Core] FINE: import 'function' # <frozen>
[python::Python3Core] FINE: import '_sysconfig' # <frozen>
[python::Python3Core] FINE: import 'java' # <frozen>
[python::Python3Core] FINE: import 'pip_hook' # <frozen>
[python::Python3Core] FINE: import '_struct' # <frozen>
[python::LoggingPosixSupport] FINEST: getBackend()
[python::LoggingPosixSupport] FINEST: getBackend -> return 'native'
[python::LoggingPosixSupport] FINER: lseek(0, 0, 1)
[python::NFIPosixSupport] FINE: Loading native library: load (RTLD_LOCAL) "/home/oleg/.conda/envs/graalpy/lib/jvm/languages/python/lib/graalpy23.0/libposix.graalpy230-310-native-x86_64-linux.so"

The library above is present in the file system so I'm at a loss of what is wrong here The terminal output:

Traceback (most recent call last):
com.oracle.truffle.api.CompilerDirectives$ShouldNotReachHere: Unable to load native posix support library

timfel commented 1 month ago

You may need to install the libxcrypt library that is required for the GraalPy native runtime: yum install libxcrypt-compat.