graalvm / simpletool Goto Github PK
View Code? Open in Web Editor NEWA simple example tool built using the Truffle instrumentation API.
License: Universal Permissive License v1.0
A simple example tool built using the Truffle instrumentation API.
License: Universal Permissive License v1.0
I am new to GraalVM. While building simpletool with GraalVM-JDK-17, following error seems to prevent successful compilation ($mvn clean package
):
simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk
The issue is seen on windows too.
On linux, the software tools have following versions:
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/lib/maven
Java version: 17.0.9, vendor: GraalVM Community, runtime: .../_installs/graalvm-ce-17
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-48-generic", arch: "amd64", family: "unix"
Do we need to add any specific exports for simpletool when compiled with GraalVM-JDK-17?
Below is the tail log of the compilation error seen:
[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @ simpletool ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 6 source files with javac [debug target 17 module-path] to target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/prj/myitems/javaUnitTest/integrationPrj/simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.962 s
[INFO] Finished at: 2024-02-15T22:58:02+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project simpletool: Compilation failure
[ERROR] /home/prj/myitems/javaUnitTest/integrationPrj/simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
I am following this using the tutorial. It works fine for the given .js example.
I tried to use the same approach to instrument some java application, but it fails as follows.
class GFG {
// Main driver method
public static void main(String[] args)
{
// Print statement
int a = 1+2;
}
}
graalvm-ce-java11-21.2.0/bin/java --vm.Dtruffle.class.path.append=target/simpletool.jar --vm.Dtruffle.class.path.append=target/simpletool.jar --simple-code-coverage ../GFG
Output:
Unrecognized option: --jvm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I removed -jvm
flag, and the corresponding output is:
Unrecognized option: --vm.Dtruffle.class.path.append=target/simpletool.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Can you give a java example?
Thanks
Hello, First of all, thank you for the project.
I'm trying to create a simple helloworld
program of instrumenting js through Graal VM.
Eventually to create a monitoring tool for Graal.
But having a hard time. Since there isn't any instructions on how to execute(with what options) in the instrumenting guide in graal homepage
I've found this repository and try to execute one. So far I've understood or assumed... that I need to compile the instrumenting program which uses truffle API(in this case SimpleCoverageInstrument.java and all) and gives the jar as an option when running js program (Please let me know if I am getting this wrong)
I've maven installed and got simpletool-19.2.0.jar
and then I've executed runJSWithCoverage.sh
and is giving me an argument error.
Am I doing something wrong? Can you point out a few things if I'm on the wrong path?
It looks like the current documentation is outdated when compared with the code in simpletool.
It would be great if the README contained updated instructions on using SimpleTool that includes instructions on using it for other languages as well.
If this documentation exists somewhere, I'd really appreciate if you could point me towards it.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.