daml/bazel_tools/rules_nodejs_node_dependency.patch
Moritz Kiefer dd09c38f4a
Upgrade rules-nodejs (#11290)
I got confused by an error and thought I might as well debug it on the
latest version instead of debugging it on 3.5.1.

changelog_begin
changelog_end
2021-10-19 14:13:55 +00:00

17 lines
736 B
Diff

diff --git a/nodejs/repositories.bzl b/nodejs/repositories.bzl
index 494217b7..f58e6cf5 100644
--- a/nodejs/repositories.bzl
+++ b/nodejs/repositories.bzl
@@ -368,6 +368,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,