-
Notifications
You must be signed in to change notification settings - Fork 522
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
nodejs_binary generates .sh script with incorrect path to main module in some cases #1575
Comments
The rollup_bundle rule assumes a certain label to find the rollup binary: if rollup is somewhere else in your repo then you have to pass a value for this attribute (I guess you install a node_modules tree under |
I tried it some times ago and I've tried it right now with the latest version - the same problem: I run bazel with --subcommands Note, then the rollup.sh bin script is executed inside execroot/gerrit folder. I suppose, that the MAIN has incorrect value. It must be tools/node_tools/... |
in the execroot tools/node_tools/... only has your own sources, not the node_modules (that's symlinked into the workspace by the managed_directories feature) the path to the MAIN should end up like I pasted your tools/node_tools/BUILD into a minimal repro, and the binary runs for me. I dunno how to clone your gerrit state to try that way. |
How did you run it in a minimal repro? As I wrote in the first message, if I run the rule by the name - it works. |
https://github.com/alexeagle/repro_1575
|
It seems, you reproduced something else.
|
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?" |
Hi,
We are migrating to npm modules in gerrit. I tried to install some node modules to a separate npm workspace. It works, except some specific case.
To reproduce the problem you can use code from this patchset https://gerrit-review.googlesource.com/c/gerrit/+/250399/21 and run the following command:
bazel test --test_env=GERRIT_NOTEDB=ON --spawn_strategy=standalone --genrule_strategy=standalone --test_output errors --test_summary detailed --flaky_test_attempts 3 --test_verbose_timeout_warnings --build_tests_only --test_timeout 3600 //...
It fails with the error - can't find
node_modules/rollup/dist/bin/rollup
.The problematic test is Documentation:check_licenses, but if you run
bazel test Documentation:check_licenses
then it works without a problem (and to reproduce the problem again after it you must run
bazel clean
orbazel clean --expunge
).The problematic nodejs_binary is here: tools/node_tools/BUILD, name="rollup-bin"
I debugged the problem a little bit. It seems, that .sh files generated by nodejs_binary has incorrect path in MAIN (in the launcher.sh template this path is here MAIN="TEMPLATED_script_path").
nodejs_binary set up MAIN to
node_modules/rollup/...
instead oftools/node_tools/node_modules/....
. It seems, that nodejs_binary doesn't add correct path to subfolder when entry_point is inside some npm workspace.If I change entry_point to any .js files inside tools/node_tools folder, then it works as expected and MAIN path is valid.
The text was updated successfully, but these errors were encountered: