Skip to content

Commit 467ca01

Browse files
committed
build: more fixes for windows
1 parent cd1e62a commit 467ca01

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

bazel/api-golden/index.bzl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
load("@bazel_skylib//rules:write_file.bzl", "write_file")
22
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
3-
load("//bazel/api-golden:index_rjs.bzl", _rjs_api_golden_test_npm_package = "api_golden_test_npm_package")
4-
5-
nodejs_test_args = [
6-
# Needed so that node doesn't walk back to the source directory.
7-
# From there, the relative imports would point to .ts files.
8-
"--node_options=--preserve-symlinks",
9-
"--nobazel_run_linker",
10-
]
11-
12-
default_strip_export_pattern = "^ɵ(?!ɵdefineInjectable|ɵinject|ɵInjectableDef)"
3+
load("//bazel/api-golden:index_rjs.bzl", "default_strip_export_pattern", _rjs_api_golden_test_npm_package = "api_golden_test_npm_package")
134

145
def extract_module_names_from_npm_targets(type_targets):
156
types = {}
@@ -69,7 +60,7 @@ def api_golden_test_npm_package(
6960
golden_dir,
7061
npm_package,
7162
data = [],
72-
strip_export_pattern = default_strip_export_pattern,
63+
strip_export_pattern = None,
7364
types = [],
7465
**kwargs):
7566
_rjs_api_golden_test_npm_package(

bazel/api-golden/index_rjs.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_test")
22

3-
default_strip_export_pattern = "^ɵ(?!ɵdefineInjectable|ɵinject|ɵInjectableDef)"
3+
# Note: On Windows pipe character can break the command line as it tries
4+
# to invoke the following word as a command.
5+
default_strip_export_pattern = "^ɵ(?!ɵdefineInjectable\\u7Cɵinject\\u7CɵInjectableDef)"
46

57
def _escape_regex_for_arg(value):
68
"""Escapes a Regular expression so that it can be passed as process argument."""
@@ -41,7 +43,7 @@ def api_golden_test_npm_package(
4143
name = name,
4244
data = data,
4345
entry_point = "@devinfra//bazel/api-golden:index_npm_packages.js",
44-
args = [golden_dir, npm_package, "false", quoted_export_pattern] + type_names,
46+
fixed_args = [golden_dir, npm_package, "false", quoted_export_pattern] + type_names,
4547
**kwargs
4648
)
4749

@@ -50,6 +52,6 @@ def api_golden_test_npm_package(
5052
testonly = True,
5153
data = data,
5254
entry_point = "@devinfra//bazel/api-golden:index_npm_packages.js",
53-
args = [golden_dir, npm_package, "true", quoted_export_pattern] + type_names,
55+
fixed_args = [golden_dir, npm_package, "true", quoted_export_pattern] + type_names,
5456
**kwargs
5557
)

0 commit comments

Comments
 (0)