From c765e936678d04b571a6dd0de50b93708c6bb867 Mon Sep 17 00:00:00 2001 From: Markus Padourek Date: Tue, 28 May 2019 15:32:41 +0200 Subject: [PATCH] Use correct label for vendored node binary. --- examples/vendored_node/BUILD.bazel | 2 +- internal/node/node_repositories.bzl | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/vendored_node/BUILD.bazel b/examples/vendored_node/BUILD.bazel index 0efbb66aeb..7707b65472 100644 --- a/examples/vendored_node/BUILD.bazel +++ b/examples/vendored_node/BUILD.bazel @@ -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", diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl index 7212d900d5..d9907bcbb1 100644 --- a/internal/node/node_repositories.bzl +++ b/internal/node/node_repositories.bzl @@ -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, @@ -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 [ @@ -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,