Skip to content

Commit 74c398f

Browse files
committed
fixup! build: update to bazel version 8.4.2
1 parent a000925 commit 74c398f

File tree

8 files changed

+77
-31
lines changed

8 files changed

+77
-31
lines changed

BUILD.bazel

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,3 @@ validate_ts_version_matching(
108108
module_lock_file = "MODULE.bazel.lock",
109109
package_json = "package.json",
110110
)
111-
112-
# This is needed following https://github.com/bazel-contrib/rules_nodejs/pull/3859
113-
toolchain(
114-
name = "node22_windows_no_exec_config_toolchain",
115-
exec_compatible_with = [],
116-
target_compatible_with = [
117-
"@platforms//os:windows",
118-
"@platforms//cpu:x86_64",
119-
],
120-
toolchain = "@node22_windows_amd64//:toolchain",
121-
toolchain_type = "@rules_nodejs//nodejs:toolchain_type",
122-
)

MODULE.bazel

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,8 @@ bazel_dep(name = "yq.bzl", version = "0.3.2")
99
bazel_dep(name = "rules_nodejs", version = "6.6.2")
1010
bazel_dep(name = "aspect_rules_js", version = "2.8.3")
1111
bazel_dep(name = "aspect_rules_ts", version = "3.7.1")
12-
bazel_dep(name = "rules_pkg", version = "0.8.1")
13-
14-
# Alow for usage of rules_pkg@0.8.1 even though other deps want a later verison.
15-
multiple_version_override(
16-
module_name = "rules_pkg",
17-
versions = [
18-
"0.8.1",
19-
"1.1.0",
20-
],
21-
)
22-
12+
bazel_dep(name = "rules_pkg", version = "1.1.0")
13+
bazel_dep(name = "rules_cc", version = "0.1.1")
2314
bazel_dep(name = "aspect_bazel_lib", version = "2.22.0")
2415
bazel_dep(name = "bazel_skylib", version = "1.8.2")
2516
bazel_dep(name = "aspect_rules_esbuild", version = "0.24.0")
@@ -105,9 +96,6 @@ use_repo(
10596
"node24_windows_amd64",
10697
)
10798

108-
# This is needed following https://github.com/bazel-contrib/rules_nodejs/pull/3859
109-
register_toolchains("//:node22_windows_no_exec_config_toolchain")
110-
11199
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
112100
npm.npm_translate_lock(
113101
name = "npm",
@@ -173,4 +161,6 @@ register_toolchains(
173161
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
174162
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
175163
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
164+
"//tools/toolchains:dummy_cc_windows_no_exec_toolchain",
165+
"//tools/toolchains:node22_windows_no_exec_toolchain",
176166
)

MODULE.bazel.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/angular/ssr/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pkg_tar(
8181
name = "npm_package_archive",
8282
srcs = [":npm_package"],
8383
extension = "tgz",
84-
strip_prefix = "./npm_package",
8584
# should not be built unless it is a dependency of another rule
8685
tags = ["manual"],
8786
)

tests/legacy-cli/e2e_runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ async function findPackageTars(): Promise<{ [pkg: string]: PkgInfo }> {
403403
);
404404

405405
const pkgJsons = await Promise.all(
406-
pkgs.map((pkg) => realpathSync(pkg)).map((pkg) => extractFile(pkg, './package.json')),
406+
pkgs.map((pkg) => realpathSync(pkg)).map((pkg) => extractFile(pkg, 'npm_package/package.json')),
407407
);
408408

409409
return pkgs.reduce(

tools/bazel/npm_package.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,5 @@ def npm_package(
119119
name = "npm_package_archive",
120120
srcs = [":pkg"],
121121
extension = "tgz",
122-
strip_prefix = "./npm_package",
123122
visibility = visibility,
124123
)

tools/toolchains/BUILD.bazel

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_toolchain")
2+
load(":dummy_cc_toolchain.bzl", "dummy_cc_toolchain_config")
3+
4+
# This is needed following https://github.com/bazel-contrib/rules_nodejs/pull/3859
5+
toolchain(
6+
name = "node22_windows_no_exec_toolchain",
7+
exec_compatible_with = [],
8+
target_compatible_with = [
9+
"@platforms//os:windows",
10+
"@platforms//cpu:x86_64",
11+
],
12+
toolchain = "@node22_windows_amd64//:toolchain",
13+
toolchain_type = "@rules_nodejs//nodejs:toolchain_type",
14+
)
15+
16+
# This defines a dummy C++ toolchain for Windows.
17+
# Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution".
18+
dummy_cc_toolchain_config(name = "dummy_cc_toolchain_config")
19+
20+
filegroup(name = "empty")
21+
22+
cc_toolchain(
23+
name = "dummy_cc_toolchain",
24+
all_files = ":empty",
25+
compiler_files = ":empty",
26+
dwp_files = ":empty",
27+
linker_files = ":empty",
28+
objcopy_files = ":empty",
29+
strip_files = ":empty",
30+
supports_param_files = 0,
31+
toolchain_config = ":dummy_cc_toolchain_config",
32+
toolchain_identifier = "dummy_cc_toolchain",
33+
)
34+
35+
toolchain(
36+
name = "dummy_cc_windows_no_exec_toolchain",
37+
exec_compatible_with = [],
38+
target_compatible_with = [
39+
"@platforms//os:windows",
40+
"@platforms//cpu:x86_64",
41+
],
42+
toolchain = ":dummy_cc_toolchain",
43+
toolchain_type = "@rules_cc//cc:toolchain_type",
44+
)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
This file defines a dummy C++ toolchain for Windows.
3+
It is needed to satisfy Bazel's toolchain resolution when cross-compiling for Windows on Linux.
4+
Some rules (e.g. rules_nodejs, js_test) or their dependencies may trigger C++ toolchain resolution
5+
even if no actual C++ compilation is performed for the target platform.
6+
Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution".
7+
"""
8+
9+
load("@rules_cc//cc:defs.bzl", "cc_common")
10+
11+
def _impl(ctx):
12+
return cc_common.create_cc_toolchain_config_info(
13+
ctx = ctx,
14+
toolchain_identifier = "dummy-toolchain",
15+
host_system_name = "local",
16+
target_system_name = "local",
17+
target_cpu = "x64_windows",
18+
target_libc = "unknown",
19+
compiler = "dummy",
20+
abi_version = "unknown",
21+
abi_libc_version = "unknown",
22+
)
23+
24+
dummy_cc_toolchain_config = rule(
25+
implementation = _impl,
26+
attrs = {},
27+
provides = [CcToolchainConfigInfo],
28+
)

0 commit comments

Comments
 (0)