-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Go: Support Go 1.23 (Explicit aliases) #17058
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
Open
mbg
wants to merge
27
commits into
main
Choose a base branch
from
mbg/go/1.23
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e604749
Go: Use 1.23 in build process
mbg 299b2e4
Go: Use 1.23 in tests
mbg 6b1bd05
Go: Use 1.23 for extractor
mbg 1192564
Go: Update frontend error messages for Go 1.23
mbg f4b3dfc
Go: Update dbscheme for aliases
mbg bbe2406
Go: Extract type aliases
mbg cd7cf4f
Go: Add database upgrade/downgrades for type aliases
mbg 91946de
Go: Extract alias names
mbg 221bab7
Go: Add test for `AliasType` extraction
mbg 47ad284
Go: Fix formatting and documentation of `AliasType`
mbg 90068f6
Go: Update `AliasType` to implement `getUnderlyingType`
mbg 5797dba
Go: Extract objects for aliases
mbg 191f712
Go: Update test for aliases to print immediate RHS and underlying type
mbg 76e27ff
Go: Remove `alias_rhs` table in downgrade script
mbg 77cf0ac
Go: add patch for go 1.23 windows build problem
f6e577e
Factor out `extractTypeObject`
owen-mc 3a8a7ea
Fix alias use in HTML template escaping passthrough
owen-mc 7589186
Use unique type param names in test
owen-mc a6557fc
Accept test change related to alias types
owen-mc 9ca7536
Update underlying type of alias
owen-mc f2695d0
Fix syntax error in test
owen-mc 23d1dfa
Delete more about alias types in downgrade script
owen-mc bd89eb0
Improve `AliasType.getUnderlyingType`
owen-mc 649bf5a
Improve Aliases test
owen-mc fe6d364
Update labels for alias types
owen-mc da12b33
Add change note
owen-mc e660b85
Update max supported Go version to 1.23
owen-mc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Go: add patch for go 1.23 windows build problem
- Loading branch information
commit 77cf0ac7a7072d5f7a3cd63d16b3a232fe021956
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/MODULE.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module( | ||
name = "rules_go", | ||
version = "0.49.0-codeql.1", | ||
compatibility_level = 0, | ||
repo_name = "io_bazel_rules_go", | ||
) | ||
|
||
# The custom repo_name is used to prevent our bazel_features polyfill for WORKSPACE builds from | ||
# conflicting with the real bazel_features repo. | ||
bazel_dep(name = "bazel_features", version = "1.9.1", repo_name = "io_bazel_rules_go_bazel_features") | ||
bazel_dep(name = "bazel_skylib", version = "1.2.0") | ||
bazel_dep(name = "platforms", version = "0.0.10") | ||
bazel_dep(name = "rules_proto", version = "6.0.0") | ||
bazel_dep(name = "protobuf", version = "3.19.2", repo_name = "com_google_protobuf") | ||
|
||
go_sdk = use_extension("//go:extensions.bzl", "go_sdk") | ||
go_sdk.download( | ||
name = "go_default_sdk", | ||
version = "1.21.8", | ||
) | ||
use_repo( | ||
go_sdk, | ||
"go_toolchains", | ||
# This name is ugly on purpose to avoid a conflict with a user-named SDK. | ||
"io_bazel_rules_nogo", | ||
) | ||
|
||
register_toolchains("@go_toolchains//:all") | ||
|
||
bazel_dep(name = "gazelle", version = "0.36.0") | ||
|
||
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") | ||
go_deps.from_file(go_mod = "//:go.mod") | ||
use_repo( | ||
go_deps, | ||
"com_github_gogo_protobuf", | ||
"com_github_golang_mock", | ||
"com_github_golang_protobuf", | ||
"org_golang_google_genproto", | ||
"org_golang_google_grpc", | ||
"org_golang_google_grpc_cmd_protoc_gen_go_grpc", | ||
"org_golang_google_protobuf", | ||
"org_golang_x_net", | ||
"org_golang_x_tools", | ||
# Exported by gazelle specifically for rules_go. | ||
"bazel_gazelle_go_repository_config", | ||
) |
20 changes: 20 additions & 0 deletions
20
misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/patches/disable_winsymlink.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Taken from https://github.com/bazelbuild/rules_go/pull/4050/commits/55b4c07d3244c829c11f297335550f19fcc718bd | ||
diff --git a/go/private/context.bzl b/go/private/context.bzl | ||
index ad0270fe..0243a231 100644 | ||
--- a/go/private/context.bzl | ||
+++ b/go/private/context.bzl | ||
@@ -439,6 +439,14 @@ def go_context( | ||
# | ||
# See https://go.dev/doc/toolchain for more info. | ||
"GOTOOLCHAIN": "local", | ||
+ | ||
+ # NOTE(#4049): Since Go 1.23.0, os.Readlink (and consequently | ||
+ # filepath.EvalSymlinks) stopped treating Windows mount points and | ||
+ # reparse points (junctions) as symbolic links. Bazel uses junctions | ||
+ # when constructing exec roots, and we use filepath.EvalSymlinks in | ||
+ # GoStdlib, so this broke us. Setting GODEBUG=winsymlink=0 restores | ||
+ # the old behavior. | ||
+ "GODEBUG": "winsymlink=0", | ||
} | ||
|
||
# Path mapping can't map the values of environment variables, so we pass GOROOT to the action |
9 changes: 9 additions & 0 deletions
9
misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/source.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"integrity": "sha256-2T7wLx5yyC2Ls9UWlRmzYWezPPaMJSUl47nT1d0UPec=", | ||
"strip_prefix": "", | ||
"url": "https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", | ||
"patches": { | ||
"disable_winsymlink.patch": "sha256-o2DWpbkv9TK80evwEQCdDFSXGLlgoT5BZg7MnvE77Go=" | ||
}, | ||
"patch_strip": 1 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"homepage": "https://github.com/bazelbuild/rules_go", | ||
"maintainers": [ | ||
{ | ||
"email": "fabian@meumertzhe.im", | ||
"github": "fmeum", | ||
"name": "Fabian Meumertzheim" | ||
}, | ||
{ | ||
"email": "zplin@uber.com", | ||
"github": "linzhp", | ||
"name": "Zhongpeng Lin" | ||
}, | ||
{ | ||
"email": "tfrench@uber.com", | ||
"github": "tyler-french", | ||
"name": "Tyler French" | ||
} | ||
], | ||
"repository": [ | ||
"github:bazelbuild/rules_go" | ||
], | ||
"versions": [ | ||
"0.49.0-codeql.1" | ||
], | ||
"yanked_versions": { | ||
"0.33.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", | ||
"0.34.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", | ||
"0.35.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", | ||
"0.36.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", | ||
"0.37.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that https://github.com/bazelbuild/rules_go/releases/tag/v0.50.0 has been released, can we just use that?
This also means we can remove the 0.49.0-codeql.1 release from the registry (also added in this PR).
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for letting us know 👍🏻 I'll drop @redsun82's fix in the next rebase and bump this to the new version instead.