diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 523ff7d23b63..366966d5cae0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,12 +77,6 @@ jobs: subset: [npm, esbuild] shard: [0, 1, 2, 3, 4, 5] exclude: - # Skip yarn subset on Windows - - os: windows-latest - subset: yarn - # Skip pnpm subset on Windows - - os: windows-latest - subset: pnpm # Skip Node.js v18 tests on Windows - os: windows-latest node: 18 @@ -91,6 +85,10 @@ jobs: node: 20 runs-on: ${{ matrix.os }} steps: + # Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968. + # TODO(devversion): Remove when Aspect lib issue is fixed. + - run: choco install gzip + if: ${{matrix.os == 'windows-latest'}} - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9ad44d7add69b53cec32d6486e9e8a83e7ec6622 - name: Install node modules diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d6cb625a02fb..2f984a73fef7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -126,6 +126,9 @@ jobs: e2e-windows-subset: runs-on: windows-latest steps: + # Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968. + # TODO(devversion): Remove when Aspect lib issue is fixed. + - run: choco install gzip - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9ad44d7add69b53cec32d6486e9e8a83e7ec6622 - name: Install node modules diff --git a/WORKSPACE b/WORKSPACE index b30b6fc24494..768d2c0ab338 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -2,6 +2,12 @@ workspace(name = "angular_cli") DEFAULT_NODE_VERSION = "18.19.1" +# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968. +# Override toolchain for tar on windows. +register_toolchains( + "//tools:windows_tar_system_toolchain", +) + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index ca51d1eaf46d..4333d2e43f46 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -1,3 +1,5 @@ +load("@aspect_bazel_lib//lib/private:tar_toolchain.bzl", "tar_toolchain") + # Copyright Google Inc. All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be @@ -28,4 +30,16 @@ nodejs_binary( entry_point = "quicktype_runner.js", templated_args = ["--bazel_patch_module_resolver"], ) + +tar_toolchain( + name = "system_tar_exec", + binary = "tar_system.bat", +) + +toolchain( + name = "windows_tar_system_toolchain", + exec_compatible_with = ["@platforms//os:windows"], + toolchain = ":system_tar_exec", + toolchain_type = "@aspect_bazel_lib//lib:tar_toolchain_type", +) # @external_end diff --git a/tools/tar_system.bat b/tools/tar_system.bat new file mode 100755 index 000000000000..523ca9d92b20 --- /dev/null +++ b/tools/tar_system.bat @@ -0,0 +1,5 @@ +if exist "C:\Program Files\Git\bin\bash.exe" ( + set "BASH=C:\Program Files\Git\bin\bash.exe" +) + +"%BASH%" -c "tar %*"