Merged
Conversation
12 tasks
99b5bac to
5e1b0cd
Compare
We now run the linker always, regardless of the configuration of the patch_module_resolver option. This creates some new flags to the launcher.sh - `--bazel_patch_module_resolver`/`--nobazel_patch_module_resolver` turns on/off the monkey-patches for require(). Still defaults to true (behavior unchanged) - `--nobazel_node_patches` disables the patches that make symlinks stay inside the execroot. Undocumented escape valve - `--nobazel_run_linker` disables running the linker, since it is now on by default. Undocumented escape valve As a later step we'll change default for patch_module_resolver to false (could be for 2.0 or 3.0 depending on how breaking it looks)
mattem
approved these changes
Jun 16, 2020
Collaborator
Author
|
Will file an issue to investigate the 8-char truncated windows paths to see where it comes from. |
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 2, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"]
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 2, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"] Fixes bazel-contrib#2125
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 2, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"] Fixes bazel-contrib#2125
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 2, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"] Fixes bazel-contrib#2125
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 2, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"] Fixes bazel-contrib#2125
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 9, 2020
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: 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, try opting-in to the require patches with templated_args = ["--bazel_patch_module_resolver"] Fixes bazel-contrib#2125
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 11, 2020
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
alexeagle
pushed a commit
to alexeagle/rules_nodejs
that referenced
this pull request
Dec 11, 2020
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
alexeagle
pushed a commit
that referenced
this pull request
Dec 11, 2020
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
discussed in meeting with @soldair - we can decouple enabling the linker/node-patches from disabling the custom monkey-patched _loader.js
We should be able to always enable the linker and node-patches, while keeping the loader.js for existing code that depends on it. require()s that aren't handled by loader.js will fall through to what the linker lays out on disk.