Skip to content

Commit

Permalink
chore: undeprecate preserve_symlinks option to node_repositories (#1422)
Browse files Browse the repository at this point in the history
Based on discussion on #763 we think users have good reason to control this setting as they may have symlinks in their sources
and their program may require following or not following those symlinks in order to run correctly.

Fixes #763
  • Loading branch information
alexeagle authored Dec 5, 2019
1 parent 8123eed commit 5a878b6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/node/node_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ and expect that file to have sha256sum `00b7a8426e076e9bf9d12ba2d571312e833fe962
default = True,
doc = """Turn on --node_options=--preserve-symlinks for nodejs_binary and nodejs_test rules.
The default for this is currently True but the options is deprecated and will be removed in the future.
When this option is turned on, node will preserve the symlinked path for resolves instead of the default
behavior of resolving to the real path. This means that all required files must be in be included in your
runfiles as it prevents the default behavior of potentially resolving outside of the runfiles. For example,
all required files need to be included in your node_modules filegroup. This option is desirable as it gives
a stronger guarantee of hermiticity which is required for remote execution.""",
a stronger guarantee of hermeticity which is required for remote execution.""",
),
"vendored_node": attr.label(
allow_single_file = True,
Expand Down Expand Up @@ -402,9 +400,6 @@ def _prepare_node(repository_ctx):
npm_script_relative = npm_script if repository_ctx.attr.vendored_node else paths.relativize(npm_script, "bin")
yarn_script_relative = yarn_script if repository_ctx.attr.vendored_yarn else paths.relativize(yarn_script, "bin")

if not repository_ctx.attr.preserve_symlinks:
print("\nWARNING: The preserve_symlinks option is deprecated and will go away in the future.\n")

if repository_ctx.attr.preserve_symlinks:
# --preserve-symlinks-main flag added in node 10.2.0
# See https://nodejs.org/api/cli.html#cli_preserve_symlinks_main
Expand Down

0 comments on commit 5a878b6

Please sign in to comment.