-
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
Bootstrap require patching fix #1540
Bootstrap require patching fix #1540
Conversation
1fdbf3d
to
e004741
Compare
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What benefit are we getting from the loader at this point? It looks like it just adds an indirection before calling the users entry point script, which we could remove with sth like #1440
Is the loader only here now as a way to load the require patches?
e004741
to
474a8b1
Compare
Yea. The only thing the loader does now is require the patches in the case when the linker is not run. I'm hesitant to always enable the linker at least for this PR because I just need the bug fix to get angular up to rules_nodejs 1.0 (this bug is now blocking). But I'll try to get rid of the loader entirely and use |
53787b2
to
1d6f074
Compare
Couldn't get rid of the loader as the correct path to the entry_point script is non-trivial. But I did remove the require patches from the loader entirely and they are now Good bit of pre-factoring before we enable the linker for all in #1440 |
60c2e7c
to
f7bacb5
Compare
1ee0661
to
3641cb3
Compare
* verify that bootstrap code can now use the require patches by default * verify that if a bootstrap script fails then its exit code is propogated
3641cb3
to
07fd285
Compare
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression.
…4736) Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression. PR Close #34736
…4736) Adds tests to verify that jasmine_node_test targets fail as expected. This is to catch any future regressions to jasmine_node_test where tests pass silently without executing. See bazel-contrib/rules_nodejs#1540 for an example of a potential regression. PR Close #34736
Require patches need to be separated from loader as if you do the following
node --node_options=--require=/path/to/bootstrap.js /path/to/loader.js
bootstrap.js:
patchRequire
ends up loading theloader.js
script (which does the patches but then does not execute as it has aif (require.main === module) {
check). Then node does not run it at all as the "main" because it has already been loaded.Test commit catches the bug (making use of expected_exit_code):
Fix commit fixes it.
We now
--node_options=--require
the require patches script first before any use bootstrap scripts so they will have access to the patches by default for nodejs_binary & nodejs_test. Tests added to verify this & test also added to verify that if a bootstrap scripts fails its exit code is propogated.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information