Skip to content

Commit

Permalink
Use correct label for vendored node binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
Globegitter committed May 28, 2019
1 parent 582b51b commit c765e93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/vendored_node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")

exports_files(["node-v10.12.0-linux-x64"]
exports_files(["node-v10.12.0-linux-x64"])

jasmine_node_test(
name = "yarn_test",
Expand Down
9 changes: 8 additions & 1 deletion internal/node/node_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ def _prepare_node(repository_ctx):
repository_ctx.attr.vendored_node.name,
"bin/node" if not is_windows else "node.exe",
] if f])
node_exec_label = "@%s//%s:%s/%s" % (
repository_ctx.attr.vendored_node.workspace_name,
repository_ctx.attr.vendored_node.package,
repository_ctx.attr.vendored_node.name,
"bin/node" if not is_windows else "node.exe",
)
npm_script = "/".join([f for f in [
"../../..",
repository_ctx.attr.vendored_node.workspace_root,
Expand All @@ -205,6 +211,7 @@ def _prepare_node(repository_ctx):
] if f])
else:
node_exec = "{}/bin/node".format(NODE_DIR) if not is_windows else "{}/node.exe".format(NODE_DIR)
node_exec_label = node_exec
npm_script = "{}/bin/npm".format(NODE_DIR) if not is_windows else "{}/node_modules/npm/bin/npm-cli.js".format(NODE_DIR)
if repository_ctx.attr.vendored_yarn:
yarn_script = "/".join([f for f in [
Expand Down Expand Up @@ -414,7 +421,7 @@ if %errorlevel% neq 0 exit /b %errorlevel%
{
"TEMPLATED_is_windows": "true" if is_windows else "false",
"TEMPLATED_node_actual": node_entry,
"TEMPLATED_node_bin_actual": str(repository_ctx.attr.vendored_node) if repository_ctx.attr.vendored_node else node_exec,
"TEMPLATED_node_bin_actual": node_exec_label,
"TEMPLATED_node_dir": NODE_DIR,
"TEMPLATED_npm_actual": npm_node_repositories_entry,
"TEMPLATED_yarn_actual": yarn_node_repositories_entry,
Expand Down

0 comments on commit c765e93

Please sign in to comment.