daml/bazel_tools/rules_nodejs_node_dependency.patch
Andreas Herrmann 92a2b5a28c
Enforce a dependency on node_nix (#6035)
The workspace for the vendored node wrapper script `@nodejs_linux_amd64`
did previously not record a dependency on the nixpkgs provided node
workspace. This patch enforces that dependency by introducing a dummy
read of the vendored node binary.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-05-19 16:58:00 +00:00

17 lines
784 B
Diff

diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl
index 038a7458..fedc43f2 100644
--- a/internal/node/node_repositories.bzl
+++ b/internal/node/node_repositories.bzl
@@ -347,6 +347,11 @@ def _prepare_node(repository_ctx):
is_windows = "_windows_" in repository_ctx.attr.name
if repository_ctx.attr.vendored_node:
+ if not is_windows:
+ # Introduce a dependency on the vendored node file or workspace.
+ node_attr = repository_ctx.attr.vendored_node
+ node_bin = node_attr.relative(":{}/bin/node".format(node_attr.name))
+ repository_ctx.read(node_bin)
node_path = "/".join([f for f in [
"../../..",
repository_ctx.attr.vendored_node.workspace_root,