Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go_download_sdk: apply extraction workaround to zips on non-windows OSs #3563

Merged
merged 5 commits into from
Jun 2, 2023

Conversation

jayconrod
Copy link
Contributor

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

The Go distribution contains at least one test file with an invalid unicode name. Bazel cannot extract the distribution archive on some operating systems and file systems; Darwin with AFS at least is affected.

For .tar.gz files, we workaround the failure in ctx.download_and_extract by using the native system tar.

This PR applies a similar workaround for .zip files on non-Windows OSs. Windows itself is not affected (ctx.download_and_extract works), so the workaround is not applied there. This is only really needed when you have a Darwin host and a Windows executor (don't ask).

Which issues(s) does this PR fix?

For #2771

Other notes for review

bazelbuild/bazel#16052 might help implement a simpler workaround in the future, but it might also require a minimum bazel version bump.

The Go distribution contains at least one test file with an invalid
unicode name. Bazel cannot extract the distribution archive on some
operating systems and file systems; Darwin with AFS at least is affected.

For .tar.gz files, we workaround the failure in ctx.download_and_extract
by using the native system tar.

This PR applies a similar workaround for .zip files on non-Windows OSs.
Windows itself is not affected (ctx.download_and_extract works),
so the workaround is not applied there. This is only really needed
when you have a Darwin host and a Windows executor (don't ask).

For bazel-contrib#2771
@jayconrod
Copy link
Contributor Author

The presubmit failure in Ubuntu 20.04 seems unrelated:

(20:54:22) WARNING: Symlinks in action outputs are not yet supported by --remote_download_minimal, falling back to downloading all action outputs due to output symlink /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/io_bazel_rules_go/bazel-out/k8-fastbuild/bin/tests/core/go_path/link_path/src/example.com/repo/cmd/bin/bin.go
(20:54:22) ERROR: /workdir/tests/core/go_path/BUILD.bazel:5:9: output 'tests/core/go_path/link_path/pkg/linux_amd64/github.com/bazelbuild/rules_go/go/tools/bzltestutil.a' is a dangling symbolic link
(20:54:22) ERROR: /workdir/tests/core/go_path/BUILD.bazel:5:9: GoPath tests/core/go_path/link_path/src/example.com/repo/cmd/bin/bin.go failed: not all outputs were created or valid
(20:54:22) ERROR: /workdir/tests/core/go_path/BUILD.bazel:59:8 Middleman _middlemen/tests_Score_Sgo_Upath_Sgo_Upath_Utest_U_Sgo_Upath_Utest-runfiles failed: not all outputs were created or valid

@fmeum
Copy link
Member

fmeum commented May 18, 2023

The workaround isn't free, it requires unzip to be installed on the host.

I think that I have a fix for the underlying Bazel issue and would be able to get it into 6.3.0.

@fmeum
Copy link
Member

fmeum commented May 19, 2023

@jayconrod Could you test whether this is fixed by bazelbuild/bazel#18448?

@jayconrod
Copy link
Contributor Author

@fmeum That fix works for me. Thanks!

Do you think it's worth continuing this PR to support older versions of Bazel? It should apply to a narrow set of folks (Darwin host, Windows executor), and I think unzip is always pre-installed on Darwin.

Alternatively (perhaps better): I could try applying bazelbuild/bazel#16052 to rename the weird file names into something reasonable. I think they're only used for cmd/go integration testing, so it shouldn't affect the output.

@fmeum
Copy link
Member

fmeum commented May 22, 2023

Given that this fix only applies to a rare use case, I would prefer a solution based on renaming rather than unzip. Maybe we could expose the rename argument so that users can specify their own dict? We can detect the presence of the parameter with bazel_features.

@jayconrod
Copy link
Contributor Author

Given that this fix only applies to a rare use case, I would prefer a solution based on renaming rather than unzip.

That sounds good. I've updated this PR to use rename_files.

Maybe we could expose the rename argument so that users can specify their own dict?

I think it's better not to expand the API. I can't think of a case where renaming would be useful, other than these two files.

We can detect the presence of the parameter with bazel_features.

Could you guide me a bit on how to do that? I'm not familiar with bazel_features. I found https://github.com/bazel-contrib/bazel_features. I don't think there's a way to detect whether this argument is supported or not except by testing the Bazel version. Empirically, 6.0.0 seems to be the first version that supports it.

Is it safe to reference bazel_features here? I think we couldn't guarantee it would be loaded until after go_rules_dependencies is called, which may be after go_download_sdk. I expect there's a better way with modules, but we can't rely on everyone using those yet.

@fmeum
Copy link
Member

fmeum commented May 30, 2023

I didn't think of the extra complication that comes with this being called before our dependency macro. In that case I think we should just use native.bazel_version directly to check for the correct major version of Bazel.

@jayconrod
Copy link
Contributor Author

Fixed. I'm using the vendored copy of Skylib to compare the versions. Verified the test passes with 6.2.0 and fails as expected with 5.4.0 on L547, taking the old branch not the new workaround.

@fmeum fmeum merged commit bcc4aeb into bazel-contrib:master Jun 2, 2023
renovate bot referenced this pull request in kreempuff/rules_unreal_engine Jun 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | minor | `v0.39.1` -> `v0.40.0` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

###
[`v0.40.0`](https://github.com/bazelbuild/rules_go/releases/tag/v0.40.0)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0)

#### What's Changed

- Revert "Add automatic platform detection from inbound crosstool_top a…
by [@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3468](https://github.com/bazelbuild/rules_go/pull/3468)
- bzlmod: Add dedicated documentation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3519](https://github.com/bazelbuild/rules_go/pull/3519)
- Create TEST_SHARD_STATUS_FILE when sharding tests by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3547](https://github.com/bazelbuild/rules_go/pull/3547)
- Move CI flags to .bazelrc and fix BwoB build by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3551](https://github.com/bazelbuild/rules_go/pull/3551)
- Re-enable go_path_test on RBE by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3539](https://github.com/bazelbuild/rules_go/pull/3539)
- nogo: provide usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3534](https://github.com/bazelbuild/rules_go/pull/3534)
- respect global strip config by
[@&#8203;malt3](https://github.com/malt3) in
[https://github.com/bazelbuild/rules_go/pull/3527](https://github.com/bazelbuild/rules_go/pull/3527)
- stdliblist: return generated files by
[@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- Fix formatting in nogo usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3557](https://github.com/bazelbuild/rules_go/pull/3557)
- Fix `goexperiment.*` build tags by
[@&#8203;lbcjbb](https://github.com/lbcjbb) in
[https://github.com/bazelbuild/rules_go/pull/3556](https://github.com/bazelbuild/rules_go/pull/3556)
- Remove tests for `go_path`'s `link` mode by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3565](https://github.com/bazelbuild/rules_go/pull/3565)
- Fix tests with `--incompatible_disable_starlark_host_transitions` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3560](https://github.com/bazelbuild/rules_go/pull/3560)
- Create empty `.go` file in a random location by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3566](https://github.com/bazelbuild/rules_go/pull/3566)
- gopackagesdriver: fix interface to work with golangci-lint
([#&#8203;3523](https://github.com/bazelbuild/rules_go/issues/3523))
by [@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3524](https://github.com/bazelbuild/rules_go/pull/3524)
- Fix typo in load statement for bzlmod docs by
[@&#8203;Sovietaced](https://github.com/Sovietaced) in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- context: remove unused import by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3571](https://github.com/bazelbuild/rules_go/pull/3571)
- docs: Mention `use_repo` automation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3573](https://github.com/bazelbuild/rules_go/pull/3573)
- Test basic-gazelle example with incompatible flags by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3575](https://github.com/bazelbuild/rules_go/pull/3575)
- go_sdk extension: create `go_host_compatible_sdk` repository by
[@&#8203;ylecornec](https://github.com/ylecornec) in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)
- docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3577](https://github.com/bazelbuild/rules_go/pull/3577)
- go_download_sdk: apply extraction workaround to zips on non-windows
OSs by [@&#8203;jayconrod](https://github.com/jayconrod) in
[https://github.com/bazelbuild/rules_go/pull/3563](https://github.com/bazelbuild/rules_go/pull/3563)
- Fix `go_download_sdk` with Bazel dev versions by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3580](https://github.com/bazelbuild/rules_go/pull/3580)
- Implement //nolint parsing similar to golangci-lint by
[@&#8203;patrickmscott](https://github.com/patrickmscott) in
[https://github.com/bazelbuild/rules_go/pull/3562](https://github.com/bazelbuild/rules_go/pull/3562)

#### New Contributors

- [@&#8203;bricedp](https://github.com/bricedp) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3512](https://github.com/bazelbuild/rules_go/pull/3512)
- [@&#8203;patrickmscott](https://github.com/patrickmscott) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3528](https://github.com/bazelbuild/rules_go/pull/3528)
- [@&#8203;grampelberg](https://github.com/grampelberg) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- [@&#8203;Sovietaced](https://github.com/Sovietaced) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- [@&#8203;ylecornec](https://github.com/ylecornec) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)

**Full Changelog**:
bazel-contrib/rules_go@v0.39.1...v0.40.0

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.20.5")

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/kreempuff/rules_unreal_engine).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Jun 23, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | minor | `v0.39.1` -> `v0.40.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

###
[`v0.40.0`](https://github.com/bazelbuild/rules_go/releases/tag/v0.40.0)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0)

#### What's Changed

- Revert "Add automatic platform detection from inbound crosstool_top a…
by [@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3468](https://github.com/bazelbuild/rules_go/pull/3468)
- bzlmod: Add dedicated documentation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3519](https://github.com/bazelbuild/rules_go/pull/3519)
- Create TEST_SHARD_STATUS_FILE when sharding tests by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3547](https://github.com/bazelbuild/rules_go/pull/3547)
- Move CI flags to .bazelrc and fix BwoB build by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3551](https://github.com/bazelbuild/rules_go/pull/3551)
- Re-enable go_path_test on RBE by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3539](https://github.com/bazelbuild/rules_go/pull/3539)
- nogo: provide usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3534](https://github.com/bazelbuild/rules_go/pull/3534)
- respect global strip config by
[@&#8203;malt3](https://github.com/malt3) in
[https://github.com/bazelbuild/rules_go/pull/3527](https://github.com/bazelbuild/rules_go/pull/3527)
- stdliblist: return generated files by
[@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- Fix formatting in nogo usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3557](https://github.com/bazelbuild/rules_go/pull/3557)
- Fix `goexperiment.*` build tags by
[@&#8203;lbcjbb](https://github.com/lbcjbb) in
[https://github.com/bazelbuild/rules_go/pull/3556](https://github.com/bazelbuild/rules_go/pull/3556)
- Remove tests for `go_path`'s `link` mode by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3565](https://github.com/bazelbuild/rules_go/pull/3565)
- Fix tests with `--incompatible_disable_starlark_host_transitions` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3560](https://github.com/bazelbuild/rules_go/pull/3560)
- Create empty `.go` file in a random location by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3566](https://github.com/bazelbuild/rules_go/pull/3566)
- gopackagesdriver: fix interface to work with golangci-lint
([#&#8203;3523](https://github.com/bazelbuild/rules_go/issues/3523))
by [@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3524](https://github.com/bazelbuild/rules_go/pull/3524)
- Fix typo in load statement for bzlmod docs by
[@&#8203;Sovietaced](https://github.com/Sovietaced) in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- context: remove unused import by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3571](https://github.com/bazelbuild/rules_go/pull/3571)
- docs: Mention `use_repo` automation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3573](https://github.com/bazelbuild/rules_go/pull/3573)
- Test basic-gazelle example with incompatible flags by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3575](https://github.com/bazelbuild/rules_go/pull/3575)
- go_sdk extension: create `go_host_compatible_sdk` repository by
[@&#8203;ylecornec](https://github.com/ylecornec) in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)
- docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3577](https://github.com/bazelbuild/rules_go/pull/3577)
- go_download_sdk: apply extraction workaround to zips on non-windows
OSs by [@&#8203;jayconrod](https://github.com/jayconrod) in
[https://github.com/bazelbuild/rules_go/pull/3563](https://github.com/bazelbuild/rules_go/pull/3563)
- Fix `go_download_sdk` with Bazel dev versions by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3580](https://github.com/bazelbuild/rules_go/pull/3580)
- Implement //nolint parsing similar to golangci-lint by
[@&#8203;patrickmscott](https://github.com/patrickmscott) in
[https://github.com/bazelbuild/rules_go/pull/3562](https://github.com/bazelbuild/rules_go/pull/3562)

#### New Contributors

- [@&#8203;bricedp](https://github.com/bricedp) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3512](https://github.com/bazelbuild/rules_go/pull/3512)
- [@&#8203;patrickmscott](https://github.com/patrickmscott) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3528](https://github.com/bazelbuild/rules_go/pull/3528)
- [@&#8203;grampelberg](https://github.com/grampelberg) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- [@&#8203;Sovietaced](https://github.com/Sovietaced) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- [@&#8203;ylecornec](https://github.com/ylecornec) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)

**Full Changelog**:
bazel-contrib/rules_go@v0.39.1...v0.40.0

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.20.5")

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/cgrindel/rules_swift_package_manager).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in cgrindel/bazel-starlib Jun 23, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | minor | `v0.39.1` -> `v0.40.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

###
[`v0.40.0`](https://github.com/bazelbuild/rules_go/releases/tag/v0.40.0)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0)

#### What's Changed

- Revert "Add automatic platform detection from inbound crosstool_top a…
by [@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3468](https://github.com/bazelbuild/rules_go/pull/3468)
- bzlmod: Add dedicated documentation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3519](https://github.com/bazelbuild/rules_go/pull/3519)
- Create TEST_SHARD_STATUS_FILE when sharding tests by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3547](https://github.com/bazelbuild/rules_go/pull/3547)
- Move CI flags to .bazelrc and fix BwoB build by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3551](https://github.com/bazelbuild/rules_go/pull/3551)
- Re-enable go_path_test on RBE by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3539](https://github.com/bazelbuild/rules_go/pull/3539)
- nogo: provide usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3534](https://github.com/bazelbuild/rules_go/pull/3534)
- respect global strip config by
[@&#8203;malt3](https://github.com/malt3) in
[https://github.com/bazelbuild/rules_go/pull/3527](https://github.com/bazelbuild/rules_go/pull/3527)
- stdliblist: return generated files by
[@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- Fix formatting in nogo usage doc by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3557](https://github.com/bazelbuild/rules_go/pull/3557)
- Fix `goexperiment.*` build tags by
[@&#8203;lbcjbb](https://github.com/lbcjbb) in
[https://github.com/bazelbuild/rules_go/pull/3556](https://github.com/bazelbuild/rules_go/pull/3556)
- Remove tests for `go_path`'s `link` mode by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3565](https://github.com/bazelbuild/rules_go/pull/3565)
- Fix tests with `--incompatible_disable_starlark_host_transitions` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3560](https://github.com/bazelbuild/rules_go/pull/3560)
- Create empty `.go` file in a random location by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3566](https://github.com/bazelbuild/rules_go/pull/3566)
- gopackagesdriver: fix interface to work with golangci-lint
([#&#8203;3523](https://github.com/bazelbuild/rules_go/issues/3523))
by [@&#8203;grampelberg](https://github.com/grampelberg) in
[https://github.com/bazelbuild/rules_go/pull/3524](https://github.com/bazelbuild/rules_go/pull/3524)
- Fix typo in load statement for bzlmod docs by
[@&#8203;Sovietaced](https://github.com/Sovietaced) in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- context: remove unused import by
[@&#8203;sluongng](https://github.com/sluongng) in
[https://github.com/bazelbuild/rules_go/pull/3571](https://github.com/bazelbuild/rules_go/pull/3571)
- docs: Mention `use_repo` automation by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3573](https://github.com/bazelbuild/rules_go/pull/3573)
- Test basic-gazelle example with incompatible flags by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3575](https://github.com/bazelbuild/rules_go/pull/3575)
- go_sdk extension: create `go_host_compatible_sdk` repository by
[@&#8203;ylecornec](https://github.com/ylecornec) in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)
- docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3577](https://github.com/bazelbuild/rules_go/pull/3577)
- go_download_sdk: apply extraction workaround to zips on non-windows
OSs by [@&#8203;jayconrod](https://github.com/jayconrod) in
[https://github.com/bazelbuild/rules_go/pull/3563](https://github.com/bazelbuild/rules_go/pull/3563)
- Fix `go_download_sdk` with Bazel dev versions by
[@&#8203;fmeum](https://github.com/fmeum) in
[https://github.com/bazelbuild/rules_go/pull/3580](https://github.com/bazelbuild/rules_go/pull/3580)
- Implement //nolint parsing similar to golangci-lint by
[@&#8203;patrickmscott](https://github.com/patrickmscott) in
[https://github.com/bazelbuild/rules_go/pull/3562](https://github.com/bazelbuild/rules_go/pull/3562)

#### New Contributors

- [@&#8203;bricedp](https://github.com/bricedp) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3512](https://github.com/bazelbuild/rules_go/pull/3512)
- [@&#8203;patrickmscott](https://github.com/patrickmscott) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3528](https://github.com/bazelbuild/rules_go/pull/3528)
- [@&#8203;grampelberg](https://github.com/grampelberg) made their
first contribution in
[https://github.com/bazelbuild/rules_go/pull/3552](https://github.com/bazelbuild/rules_go/pull/3552)
- [@&#8203;Sovietaced](https://github.com/Sovietaced) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3570](https://github.com/bazelbuild/rules_go/pull/3570)
- [@&#8203;ylecornec](https://github.com/ylecornec) made their first
contribution in
[https://github.com/bazelbuild/rules_go/pull/3543](https://github.com/bazelbuild/rules_go/pull/3543)

**Full Changelog**:
bazel-contrib/rules_go@v0.39.1...v0.40.0

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.20.5")

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/cgrindel/bazel-starlib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
tingilee pushed a commit to tingilee/rules_go that referenced this pull request Jul 19, 2023
…Ss (bazel-contrib#3563)

* go_download_sdk: apply extraction workaround to zips on non-windows OSs

The Go distribution contains at least one test file with an invalid
unicode name. Bazel cannot extract the distribution archive on some
operating systems and file systems; Darwin with AFS at least is affected.

For .tar.gz files, we workaround the failure in ctx.download_and_extract
by using the native system tar.

This PR applies a similar workaround for .zip files on non-Windows OSs.
Windows itself is not affected (ctx.download_and_extract works),
so the workaround is not applied there. This is only really needed
when you have a Darwin host and a Windows executor (don't ask).

For bazel-contrib#2771

* use rename_files; rewrite comment

* version check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants