On stable-3.2 branch outdated version of rules_nodejs version is used: 1.5, that suffers from usage of wrong regular expression escapes. More recent Bazel versions added a check for that regex string escape pattern and flagging the external rules_nodejs repository as invalid. Given that upgrade path to recent rules_nodejs version is not a trivial one: 1.5 => 1.7 => 2.0, and given that also plugins would need to be updated, we prefer to keep that outdated rules_nodejs version as-is and patch the wrong line in rules_nodejs distribution instead. That would allow us to upgrade to recent bazel versions on stable-3.2 branch. We prefer to keep the same Bazel version on all supported stable branches to reduce/avoid rebuilds when switching between branches. Note, that this workaround should be reverted when this change is merged up to master branch. Change-Id: Ia99ea8398ea87847c27d75f8e47099b2c04c9186
13 lines
623 B
Diff
13 lines
623 B
Diff
--- build_bazel_rules_nodejs/internal/node/node.bzl 2021-02-07 16:09:38.099484740 +0100
|
|
+++ build_bazel_rules_nodejs/internal/node/node_fixed.bzl 2021-02-07 16:10:33.583847582 +0100
|
|
@@ -87,6 +87,6 @@
|
|
for d in ctx.attr.data:
|
|
if hasattr(d, "runfiles_module_mappings"):
|
|
for [mn, mr] in d.runfiles_module_mappings.items():
|
|
- escaped = mn.replace("/", "\/").replace(".", "\.")
|
|
+ escaped = mn.replace("/", "\\/").replace(".", "\\.")
|
|
mapping = "{module_name: /^%s\\b/, module_root: '%s'}" % (escaped, mr)
|
|
module_mappings.append(mapping)
|
|
|
|
|