Skip to content

Commit

Permalink
Remove Latin-1 workaround on Bazel 6.4.0+
Browse files Browse the repository at this point in the history
The fix for Latin-1 encoded files was landed in [6.4.0] after
being landed on Bazel [master].

We can conditionally use the old, unhermetic, `tar` workaround
on modern Bazel versions.

[master]: bazelbuild/bazel#18448
[6.4.0]: bazelbuild/bazel#19765
  • Loading branch information
mattyclarkson committed Feb 24, 2024
1 parent 8c014fd commit c04c4ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ def _remote_sdk(ctx, urls, strip_prefix, sha256):
# in Bazel 6.0.0+ (bazelbuild/bazel#16052). The only situation where
# .zip files are needed seems to be a macOS host using a Windows toolchain
# for remote execution.
if urls[0].endswith(".tar.gz"):
if (urls[0].endswith(".tar.gz") and
# Development versions of Bazel have an empty version string. We assume that they are
# more recent than the version that introduced the fix.
not versions.is_at_least("6.4.0", versions.get() or "6.4.0")):
if strip_prefix != "go":
fail("strip_prefix not supported")
ctx.download(
Expand Down

0 comments on commit c04c4ee

Please sign in to comment.