-
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
refactor: make dependencies on --bazel_patch_module_resolver explicit #2344
refactor: make dependencies on --bazel_patch_module_resolver explicit #2344
Conversation
We are about to flip the default for this flag in bazel-contrib#2125 so we need to explicitly opt-in in places where we need the behavior. Ideally most of these should be fixed, this would be necessary if we ever want to deprecate the module resolver patches
This turns off our monkey-patches for require() for nodejs_binary, nodejs_test, and macros like jasmine_node_test. Note it was previously disabled for npm_package_bin and generated index.bzl binaries in bazel-contrib#1440 BREAKING CHANGE: By default, we no longer patch the require() function, instead you should rely on the linker to make node modules resolvable at the standard location if this breaks you, the quickest fix is to flip the flag back on a nodejs_binary/nodejs_test/npm_package_bin with `templated_args = ["--bazel_patch_module_resolver"]`, see bazel-contrib#2344 as an example. Another fix is to explicitly use our runfiles helper library, see bazel-contrib#2341 as an example. Fixes bazel-contrib#2125
@@ -261,6 +261,8 @@ def protractor_web_test( | |||
entry_point = Label(protractor_entry_point), | |||
data = srcs + deps + data + [Label(d) for d in peer_deps], | |||
testonly = 1, | |||
# TODO: make protractor binary not depend on monkey-patched require() |
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.
That's actual protractor and something we can't fix?
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.
pretty sure it's our wrapper code. I figured our protractor package isn't that popular so i didn't spend much time here digging in to figure out why it's not working, but i think this is the main one to come back to and try to fix by 3.0
I think most of these are just in internal BUILDs and tests? Except protractor, any others I didn't notice? Not sure if it's worth tracking those somewhere...? |
This turns off our monkey-patches for require() for nodejs_binary, nodejs_test, and macros like jasmine_node_test. Note it was previously disabled for npm_package_bin and generated index.bzl binaries in bazel-contrib#1440 BREAKING CHANGE: By default, we no longer patch the require() function, instead you should rely on the linker to make node modules resolvable at the standard location if this breaks you, the quickest fix is to flip the flag back on a nodejs_binary/nodejs_test/npm_package_bin with `templated_args = ["--bazel_patch_module_resolver"]`, see bazel-contrib#2344 as an example. Another fix is to explicitly use our runfiles helper library, see bazel-contrib#2341 as an example. Fixes bazel-contrib#2125
This turns off our monkey-patches for require() for nodejs_binary, nodejs_test, and macros like jasmine_node_test. Note it was previously disabled for npm_package_bin and generated index.bzl binaries in #1440 BREAKING CHANGE: By default, we no longer patch the require() function, instead you should rely on the linker to make node modules resolvable at the standard location if this breaks you, the quickest fix is to flip the flag back on a nodejs_binary/nodejs_test/npm_package_bin with `templated_args = ["--bazel_patch_module_resolver"]`, see #2344 as an example. Another fix is to explicitly use our runfiles helper library, see #2341 as an example. Fixes #2125
We are about to flip the default for this flag in #2125 so we need to explicitly opt-in in places where we need the behavior.
Ideally most of these should be fixed, this would be necessary if we ever want to deprecate the module resolver patches