Skip to content

Commit

Permalink
build: update aspect_bazel_lib to fix windows gzip issues
Browse files Browse the repository at this point in the history
Workaround until `rules_js` imports the latest version of
`aspect_bazel_lib`: bazel-contrib/bazel-lib#968
  • Loading branch information
devversion committed Nov 27, 2024
1 parent 0ba34f1 commit 9d3cb7f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ jobs:
e2e-windows-subset:
runs-on: windows-latest
steps:
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
limit-access-to-actor: true
- run: choco install gzip
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9bf81f9c029a09347afb376b9e1ae12b33f1a1fa
- name: Install node modules
Expand Down
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
14 changes: 14 additions & 0 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.sh",
)

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
1 change: 1 addition & 0 deletions tools/tar_system.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exec /usr/bin/tar "$@"

0 comments on commit 9d3cb7f

Please sign in to comment.