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

sdk.bzl: include go.env since 1.21.0 #3666

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

sluongng
Copy link
Contributor

Include go.env file in the root of the sdk repo starting from Go 1.21.0.

Fixes #3665

Include go.env file in the root of the sdk repo starting from Go 1.21.0.
@sluongng
Copy link
Contributor Author

!master ~/work/bazelbuild/rules_go> cat /private/var/tmp/_bazel_sluongng/5c02d8a9b82454292bdfef7b6f9ac04e/external/go_sdk/go.env
# This file contains the initial defaults for go command configuration.
# Values set by 'go env -w' and written to the user's go/env file override these.
# The environment overrides everything else.

# Use the Go module mirror and checksum database by default.
# See https://proxy.golang.org for details.
GOPROXY=https://proxy.golang.org,direct
GOSUMDB=sum.golang.org

# Automatically download newer toolchains as directed by go.mod files.
# See https://go.dev/doc/toolchain for details.
GOTOOLCHAIN=auto

for reference, this is the content of the file.

go/private/BUILD.sdk.bazel Outdated Show resolved Hide resolved
@fmeum fmeum merged commit 478c5e9 into bazelbuild:master Aug 17, 2023
1 check passed
@fmeum
Copy link
Collaborator

fmeum commented Aug 17, 2023

@sluongng Could you submit the update to Go SDK 1.21.0 combined with the revert of the earlier approach to fix the GO_PROXY issue? The work should be done and that way we can test that's actually the case.

Thank you very much for driving these fixes!

@sluongng sluongng deleted the sluongng/go-env-sdk branch August 17, 2023 11:45
@sluongng
Copy link
Contributor Author

I don't think we need a revert on Gazelle side just yet.

Instead, let's proceed with the Go SDK upgrade in rules_go.
Once rules_go is updated, we shall bump rules_go + GoSDK version in Gazelle and revert the change.

WDYT?

sluongng added a commit to sluongng/bazel-gazelle that referenced this pull request Aug 17, 2023
This reverts commit adce430.

We found an alternative fix to this to this issue in
bazelbuild/rules_go#3666.
@sluongng
Copy link
Contributor Author

Here is the revert on Gazelle side anyway ☝️

You already have your PR for bumping Go SDK in rules_go. Let's try merging that @fmeum

fmeum pushed a commit to bazelbuild/bazel-gazelle that referenced this pull request Aug 17, 2023
This reverts commit adce430.

We found an alternative fix to this to this issue in
bazelbuild/rules_go#3666.
sluongng added a commit to buildbuddy-io/buildbuddy that referenced this pull request Aug 28, 2023
Upgrade rules_go to latest commit in `master` at the moment of writing.

Unblocks Go 1.21 upgrade in #4516 by including the fixes in:
- bazelbuild/rules_go#3660
- bazelbuild/rules_go#3666
sluongng added a commit to buildbuddy-io/buildbuddy that referenced this pull request Aug 29, 2023
Upgrade rules_go to latest commit in `master` at the moment of writing.

Unblocks Go 1.21 upgrade in #4516 by including the fixes in:
- bazelbuild/rules_go#3660
- bazelbuild/rules_go#3666
healthy-pod pushed a commit to cockroachdb/rules_go that referenced this pull request Aug 29, 2023
* sdk.bzl: include go.env since 1.21.0

Include go.env file in the root of the sdk repo starting from Go 1.21.0.

* use glob instead

* Revert "use glob instead"

This reverts commit 4b0181a.

* Revert "Revert "use glob instead""

This reverts commit 7edb61c.

* use separate glob
stewartbutler added a commit to stewartbutler/rules_nixpkgs that referenced this pull request Sep 20, 2023
Go 1.21 added a requirement for a 'go.env' file. Without that file, Go
will throw an error like:
```
Error in fail: failed to fetch org_golang_google_grpc_cmd_protoc_gen_go_grpc: fetch_repo: google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0: GOPROXY list is not the empty string, but contains no entries
```

This commit adds it to the SDK exposed by rules_nixpkgs so that it is
compatible with rules_go.

See:
- bazelbuild/rules_go#3665
- bazelbuild/rules_go#3666
avdv pushed a commit to stewartbutler/rules_nixpkgs that referenced this pull request Nov 3, 2023
Go 1.21 added a requirement for a 'go.env' file. Without that file, Go
will throw an error like:
```
Error in fail: failed to fetch org_golang_google_grpc_cmd_protoc_gen_go_grpc: fetch_repo: google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0: GOPROXY list is not the empty string, but contains no entries
```

This commit adds it to the SDK exposed by rules_nixpkgs so that it is
compatible with rules_go.

See:
- bazelbuild/rules_go#3665
- bazelbuild/rules_go#3666
jeromep-stripe pushed a commit to jeromep-stripe/bazel-gazelle that referenced this pull request Mar 22, 2024
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.

Build failures when using a local go 1.21.0 SDK
2 participants