Skip to content

Commit a3dfcb7

Browse files
devversionclydin
authored andcommitted
build: workaround aspect bazel lib tar.gz windows issue
Workaround until `rules_js` imports the latest version of `aspect_bazel_lib`: bazel-contrib/bazel-lib#968
1 parent 9541862 commit a3dfcb7

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

.github/workflows/ci.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ jobs:
7777
subset: [npm, esbuild]
7878
shard: [0, 1, 2, 3, 4, 5]
7979
exclude:
80-
# Skip yarn subset on Windows
81-
- os: windows-latest
82-
subset: yarn
83-
# Skip pnpm subset on Windows
84-
- os: windows-latest
85-
subset: pnpm
8680
# Skip Node.js v18 tests on Windows
8781
- os: windows-latest
8882
node: 18
@@ -91,6 +85,10 @@ jobs:
9185
node: 20
9286
runs-on: ${{ matrix.os }}
9387
steps:
88+
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
89+
# TODO(devversion): Remove when Aspect lib issue is fixed.
90+
- run: choco install gzip
91+
if: ${{matrix.os == 'windows-latest'}}
9492
- name: Initialize environment
9593
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@40b2cbdbcc40f36f125d721c4e8decd3bb607ea4
9694
- name: Install node modules

.github/workflows/pr.yml

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ jobs:
126126
e2e-windows-subset:
127127
runs-on: windows-latest
128128
steps:
129+
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
130+
# TODO(devversion): Remove when Aspect lib issue is fixed.
131+
- run: choco install gzip
129132
- name: Initialize environment
130133
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@40b2cbdbcc40f36f125d721c4e8decd3bb607ea4
131134
- name: Install node modules

WORKSPACE

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ workspace(name = "angular_cli")
22

33
DEFAULT_NODE_VERSION = "18.19.1"
44

5+
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
6+
# Override toolchain for tar on windows.
7+
register_toolchains(
8+
"//tools:windows_tar_system_toolchain",
9+
)
10+
511
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
612

713
http_archive(

tools/BUILD.bazel

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@aspect_bazel_lib//lib/private:tar_toolchain.bzl", "tar_toolchain")
2+
13
# Copyright Google Inc. All Rights Reserved.
24
#
35
# Use of this source code is governed by an MIT-style license that can be
@@ -28,4 +30,16 @@ nodejs_binary(
2830
entry_point = "quicktype_runner.js",
2931
templated_args = ["--bazel_patch_module_resolver"],
3032
)
33+
34+
tar_toolchain(
35+
name = "system_tar_exec",
36+
binary = "tar_system.bat",
37+
)
38+
39+
toolchain(
40+
name = "windows_tar_system_toolchain",
41+
exec_compatible_with = ["@platforms//os:windows"],
42+
toolchain = ":system_tar_exec",
43+
toolchain_type = "@aspect_bazel_lib//lib:tar_toolchain_type",
44+
)
3145
# @external_end

tools/tar_system.bat

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if exist "C:\Program Files\Git\bin\bash.exe" (
2+
set "BASH=C:\Program Files\Git\bin\bash.exe"
3+
)
4+
5+
"%BASH%" -c "tar %*"

0 commit comments

Comments
 (0)