Skip to content

Commit dbc07a1

Browse files
committed
build: workaround for windows CI
1 parent afa4142 commit dbc07a1

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ workspace(
44

55
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
66

7+
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
8+
# Override toolchain for tar on windows.
9+
register_toolchains(
10+
"//bazel/tar-toolchain:windows_tar_system_toolchain",
11+
)
12+
713
NODE_VERSION = "18.20.0"
814

915
# The PKG rules are needed to build tar packages for integration tests. The builtin

bazel/tar-toolchain/BUILD.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
load("@aspect_bazel_lib//lib/private:tar_toolchain.bzl", "tar_toolchain")
2+
3+
tar_toolchain(
4+
name = "system_tar_exec",
5+
binary = "tar_system.bat",
6+
)
7+
8+
toolchain(
9+
name = "windows_tar_system_toolchain",
10+
exec_compatible_with = ["@platforms//os:windows"],
11+
toolchain = ":system_tar_exec",
12+
toolchain_type = "@aspect_bazel_lib//lib:tar_toolchain_type",
13+
)

bazel/tar-toolchain/tar_system.bat

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

0 commit comments

Comments
 (0)