Open Melab opened 2 years ago
At a glance it appears you did things correctly. Can you provide more information about your system? Specifically I want to know what OS and CPU you are running on, in case the issue is platform-specific.
Looking over the code around the error, it is hard to tell why the library was unable to load. Some extra information from you would be helpful:
-verbose:jni
but I do not know how GraalJS is set up in your environment.I believe the problem is perhaps something in your environment, but more likely it is due to GraalJS itself having trouble or preventing our native library from loading. The same basic code you provided loads and works ok from a normal Java application.
At a glance it appears you did things correctly. Can you provide more information about your system? Specifically I want to know what OS and CPU you are running on, in case the issue is platform-specific.
CPU is AMD G-T56N. Operating system is Ubuntu 20.04. Kernel is Ubuntu Linux 5.11.0-27-generic.
Looking over the code around the error, it is hard to tell why the library was unable to load. Some extra information from you would be helpful:
* What version of GraalJS are you running? * Is it possible for you to enable some native logging in GraalJS? As a JVM flag that would be `-verbose:jni` but I do not know how GraalJS is set up in your environment.
I believe the problem is perhaps something in your environment, but more likely it is due to GraalJS itself having trouble or preventing our native library from loading. The same basic code you provided loads and works ok from a normal Java application.
It's the GraalVM JavaScript that comes with GraalVM Community Edition 21.3.0 for Java 11. I'm running it in JVM mode.
Relevant files:
Scripts are still the same.
Is there any news yet?
I have been attempting to use jnr-posix's native function calls inside GraalVM JavaScripy, but I have gotten error message that complain about an unsatisified link.
I cloned the following repositories at their linked-to commits:
In the top-level of each repository, I ran
mvn -B package --file pom.xml
. This produced several JAR files, the following of which I copied to${JNR_JARS_DIR}
:jffi-1.3.10-SNAPSHOT.jar
.jffi-1.3.10-SNAPSHOT-native.jar
.jnr-constants-0.10.4.jar
.jnr-enxio-0.32.14-SNAPSHOT.jar
.jnr-ffi-2.2.12-SNAPSHOT.jar
.jnr-posix-3.1.16-SNAPSHOT.jar
.graaljs+jnr.sh is the shell scrupt that I used to test two JavaScript files, one of which uses
DefaultPOSIXHandler
and one which does not. The commands were as followsThe script includes the previously mentioned JAR files in the classpath of the executed
java
command.Both attempts to retrieve the native POSIX interface fail with
java.lang.UnsatisfiedLinkError
.The relevant files:
txt
extension.)txt
extension.)txt
extension.)