From 35649402c0da1843ab4a8e1291c3456536bfc9d4 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 19 Apr 2021 16:06:20 -0700 Subject: [PATCH] fix(builtin): resolve vendored node/yarn from external repo (#2614) Fixes #2019 --- internal/node/node_repositories.bzl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl index 22d10d687f..8088fc8be8 100644 --- a/internal/node/node_repositories.bzl +++ b/internal/node/node_repositories.bzl @@ -422,6 +422,13 @@ def _prepare_node(repository_ctx): yarn_bin_label = ("%s/bin/yarn.js" % yarn_package) if not is_windows else ("%s/yarn.cmd" % yarn_package) yarn_script = "%s/bin/yarn.js" % yarn_path + # Ensure that the "vendored" binaries are resolved + # Just requesting their path from the repository context is enough to eager-load them + if repository_ctx.attr.vendored_node: + repository_ctx.path(Label(node_bin_label)) + if repository_ctx.attr.vendored_yarn: + repository_ctx.path(Label(yarn_bin_label)) + entry_ext = ".cmd" if is_windows else "" node_entry = "bin/node%s" % entry_ext npm_entry = "bin/npm%s" % entry_ext