Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Arguments to node after nodeprof argument aren't handled properly #106

Open
peey opened this issue Sep 1, 2022 · 0 comments
Open

CLI Arguments to node after nodeprof argument aren't handled properly #106

peey opened this issue Sep 1, 2022 · 0 comments

Comments

@peey
Copy link

peey commented Sep 1, 2022

E.g. if you try

node --jvm --experimental-options --nodeprof /tools/graal/sdk/latest_graalvm_home/tools/nodeprof/jalangi.js --analysis /tmp/empty.js --help

You'll get the output

[To redirect Truffle log output to a file use one of the following options:
* '--log.file=<path>' if the option is passed using a guest language launcher.
* '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

You'll get a similar error if you try a more legitimate case of:

node --jvm --experimental-options --nodeprof /tools/graal/sdk/latest_graalvm_home/tools/nodeprof/jalangi.js --analysis /tmp/empty.js -e 'console.log("hello world")'

As specified in the tutorial, I think the current design assumes anything following --analysis <file> to be a single file:

PATH_GRAALVM/bin/node --jvm --experimental-options --vm.Dtruffle.class.path.append=PATH_NODEPROF_JAR/nodeprof.jar --nodeprof PATH_NODEPROF/src/ch.usi.inf.nodeprof/js/jalangi.js [--analysis analysisFile]* test-file (similar to mx jalangi)

I think this unnecessarily introduces an ordering of options, not to mention making -e 'code' impossible as an option which will be very useful for quick debugging.

The analysis file itself doesn't seem to matter. In this case, the analysis file is just an empty file created by touch /tmp/empty.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant