From de0d0b4757bededa66caaec02ef1f31a86d41a7e Mon Sep 17 00:00:00 2001 From: Angular Robot Date: Fri, 10 Mar 2023 14:07:12 +0000 Subject: [PATCH] build: update dependency build_bazel_rules_nodejs to v5.8.2 (#49910) See associated pull request for more information. PR Close #49910 --- WORKSPACE | 6 +-- .../rules_nodejs__#3605.patch | 48 ------------------- 2 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 tools/bazel-repo-patches/rules_nodejs__#3605.patch diff --git a/WORKSPACE b/WORKSPACE index fa1086170e0..75904aa4322 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -26,12 +26,10 @@ http_archive( http_archive( name = "build_bazel_rules_nodejs", patches = [ - # TODO(devversion): remove when https://github.com/bazelbuild/rules_nodejs/pull/3605 is available. - "//tools:bazel-repo-patches/rules_nodejs__#3605.patch", "//tools/esm-interop:patches/bazel/nodejs_binary_esm_support.patch", ], - sha256 = "c29944ba9b0b430aadcaf3bf2570fece6fc5ebfb76df145c6cdad40d65c20811", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-5.7.0.tar.gz"], + sha256 = "94070eff79305be05b7699207fbac5d2608054dd53e6109f7d00d923919ff45a", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") diff --git a/tools/bazel-repo-patches/rules_nodejs__#3605.patch b/tools/bazel-repo-patches/rules_nodejs__#3605.patch deleted file mode 100644 index 36805e745d4..00000000000 --- a/tools/bazel-repo-patches/rules_nodejs__#3605.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git internal/node/node.bzl internal/node/node.bzl -index 18d7ce4..3b8ce74 100755 ---- internal/node/node.bzl -+++ internal/node/node.bzl -@@ -353,10 +353,22 @@ if (process.cwd() !== __dirname) { - else: - executable = ctx.outputs.launcher_sh - -- # syntax sugar: allows you to avoid repeating the entry point in data -- # entry point is only needed in runfiles if it is a javascript file -- if len(ctx.files.entry_point) == 1 and is_javascript_file(ctx.files.entry_point[0]): -- runfiles.extend(ctx.files.entry_point) -+ # Note: `to_list()` is expensive and should only be called once. -+ sources_list = sources.to_list() -+ entry_point_input_short_path = _ts_to_js(_get_entry_point_file(ctx).short_path) -+ entry_point_script = None -+ -+ for f in sources_list: -+ if f.short_path == entry_point_input_short_path: -+ entry_point_script = f -+ break -+ -+ if not entry_point_script and len(ctx.files.entry_point) == 1 and is_javascript_file(ctx.files.entry_point[0]): -+ entry_point_script = ctx.files.entry_point[0] -+ -+ # Convenience: We add the entry point to the runfiles. This means that users would not -+ # need to explicitly repeat the entry point in the `data` attribute. -+ runfiles.append(entry_point_script) - - return [ - DefaultInfo( -@@ -371,14 +383,14 @@ if (process.cwd() !== __dirname) { - # Calling the .to_list() method may have some perfs hits, - # so we should be running this method only once per rule. - # see: https://docs.bazel.build/versions/main/skylark/depsets.html#performance -- node_modules.to_list() + sources.to_list(), -+ node_modules.to_list() + sources_list, - collect_data = True, - ), - ), - # TODO(alexeagle): remove sources and node_modules from the runfiles - # when downstream usage is ready to rely on linker - NodeRuntimeDepsInfo( -- deps = depset(ctx.files.entry_point, transitive = [node_modules, sources]), -+ deps = depset([entry_point_script], transitive = [node_modules, sources]), - pkgs = data, - ), - # indicates that the this binary should be instrumented by coverage