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

Bump Go versions to 1.21.1 #3643

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe

go_rules_dependencies()

go_register_toolchains(version = "1.20.7")
go_register_toolchains(version = "1.21.1")

http_archive(
name = "com_google_protobuf",
Expand Down Expand Up @@ -71,15 +71,17 @@ bazel_skylib_workspace()

http_archive(
name = "bazel_gazelle",
sha256 = "178eba9540a616bda314afa25a91f195758a9fed178eda72e149eb0d20e9b670",
strip_prefix = "bazel-gazelle-9fe0a3ff751647789690293dcbb3c87ea33b7566",
sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809",
urls = [
"https://github.com/bazelbuild/bazel-gazelle/archive/9fe0a3ff751647789690293dcbb3c87ea33b7566.zip",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

gazelle_dependencies()

go_repository(
name = "com_github_google_go_github_v36",
importpath = "github.com/google/go-github/v36",
Expand Down Expand Up @@ -158,8 +160,6 @@ load("@io_bazel_rules_go//tests:grpc_repos.bzl", "grpc_dependencies")

grpc_dependencies()

gazelle_dependencies()

local_repository(
name = "runfiles_remote_test",
path = "tests/core/runfiles/runfiles_remote_test",
Expand Down
17 changes: 9 additions & 8 deletions tests/integration/popular_repos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ test_suite(
"@org_golang_x_crypto//blowfish:blowfish_test",
"@org_golang_x_crypto//bn256:bn256_test",
"@org_golang_x_crypto//cast5:cast5_test",
"@org_golang_x_crypto//chacha20:chacha20_test",
"@org_golang_x_crypto//chacha20poly1305:chacha20poly1305_test",
"@org_golang_x_crypto//cryptobyte:cryptobyte_test",
"@org_golang_x_crypto//curve25519:curve25519_test",
"@org_golang_x_crypto//ed25519:ed25519_test",
"@org_golang_x_crypto//hkdf:hkdf_test",
"@org_golang_x_crypto//internal/chacha20:chacha20_test",
"@org_golang_x_crypto//internal/subtle:subtle_test",
"@org_golang_x_crypto//md4:md4_test",
"@org_golang_x_crypto//nacl/auth:auth_test",
"@org_golang_x_crypto//nacl/box:box_test",
"@org_golang_x_crypto//nacl/secretbox:secretbox_test",
"@org_golang_x_crypto//nacl/sign:sign_test",
"@org_golang_x_crypto//ocsp:ocsp_test",
"@org_golang_x_crypto//openpgp:openpgp_test",
Expand All @@ -59,8 +58,8 @@ test_suite(
"@org_golang_x_crypto//salsa20/salsa:salsa_test",
"@org_golang_x_crypto//scrypt:scrypt_test",
"@org_golang_x_crypto//sha3:sha3_test",
"@org_golang_x_crypto//ssh/internal/bcrypt_pbkdf:bcrypt_pbkdf_test",
"@org_golang_x_crypto//ssh/knownhosts:knownhosts_test",
"@org_golang_x_crypto//ssh/terminal:terminal_test",
"@org_golang_x_crypto//tea:tea_test",
"@org_golang_x_crypto//twofish:twofish_test",
"@org_golang_x_crypto//xtea:xtea_test",
Expand Down Expand Up @@ -89,6 +88,7 @@ test_suite(
"@org_golang_x_net//netutil:netutil_test",
"@org_golang_x_net//proxy:proxy_test",
"@org_golang_x_net//publicsuffix:publicsuffix_test",
"@org_golang_x_net//route:route_test",
"@org_golang_x_net//trace:trace_test",
"@org_golang_x_net//webdav:webdav_test",
"@org_golang_x_net//webdav/internal/xml:xml_test",
Expand All @@ -105,6 +105,7 @@ test_suite(
"@org_golang_x_sys//internal/unsafeheader:unsafeheader_test",
"@org_golang_x_sys//plan9:plan9_test",
"@org_golang_x_sys//unix/internal/mkmerge:mkmerge_test",
"@org_golang_x_sys//windows/mkwinsyscall:mkwinsyscall_test",
"@org_golang_x_sys//windows/registry:registry_test",
"@org_golang_x_sys//windows/svc:svc_test",
"@org_golang_x_sys//windows/svc/eventlog:eventlog_test",
Expand Down Expand Up @@ -167,8 +168,10 @@ test_suite(
"@org_golang_x_tools//cmd/splitdwarf/internal/macho:macho_test",
"@org_golang_x_tools//cover:cover_test",
"@org_golang_x_tools//go/analysis:analysis_test",
"@org_golang_x_tools//go/analysis/passes/directive/testdata/src/a:a_test",
"@org_golang_x_tools//go/analysis/passes/internal/analysisutil:analysisutil_test",
"@org_golang_x_tools//go/ast/astutil:astutil_test",
"@org_golang_x_tools//go/callgraph:callgraph_test",
"@org_golang_x_tools//go/callgraph/static:static_test",
"@org_golang_x_tools//go/callgraph/vta/internal/trie:trie_test",
"@org_golang_x_tools//go/cfg:cfg_test",
Expand All @@ -190,6 +193,8 @@ test_suite(
"@org_golang_x_tools//internal/jsonrpc2:jsonrpc2_test",
"@org_golang_x_tools//internal/jsonrpc2/servertest:servertest_test",
"@org_golang_x_tools//internal/jsonrpc2_v2:jsonrpc2_v2_test",
"@org_golang_x_tools//internal/lockedfile:lockedfile_test",
"@org_golang_x_tools//internal/lockedfile/internal/filelock:filelock_test",
"@org_golang_x_tools//internal/memoize:memoize_test",
"@org_golang_x_tools//internal/persistent:persistent_test",
"@org_golang_x_tools//internal/proxydir:proxydir_test",
Expand Down Expand Up @@ -244,7 +249,6 @@ build_test(
"@org_golang_x_net//icmp:icmp",
"@org_golang_x_net//nettest:nettest",
"@org_golang_x_net//lif:lif",
"@org_golang_x_net//route:route",
"@org_golang_x_sys//unix:unix",
"@org_golang_x_sys//windows:windows",
"@org_golang_x_text//encoding/charmap:charmap",
Expand All @@ -255,12 +259,10 @@ build_test(
"@org_golang_x_text//encoding/unicode/utf32:utf32",
"@org_golang_x_text//encoding/unicode:unicode",
"@org_golang_x_text//message/pipeline:pipeline",
"@org_golang_x_tools//blog:blog",
"@org_golang_x_tools//cmd/bundle:bundle",
"@org_golang_x_tools//cmd/callgraph:callgraph",
"@org_golang_x_tools//cmd/file2fuzz:file2fuzz",
"@org_golang_x_tools//cmd/fiximports:fiximports",
"@org_golang_x_tools//cmd/godoc:godoc",
"@org_golang_x_tools//cmd/gorename:gorename",
"@org_golang_x_tools//cmd/guru:guru",
"@org_golang_x_tools//cmd/signature-fuzzer/fuzz-driver:fuzz-driver",
Expand All @@ -282,6 +284,7 @@ build_test(
"@org_golang_x_tools//go/analysis/passes/copylock:copylock",
"@org_golang_x_tools//go/analysis/passes/ctrlflow:ctrlflow",
"@org_golang_x_tools//go/analysis/passes/deepequalerrors:deepequalerrors",
"@org_golang_x_tools//go/analysis/passes/directive:directive",
"@org_golang_x_tools//go/analysis/passes/errorsas:errorsas",
"@org_golang_x_tools//go/analysis/passes/fieldalignment:fieldalignment",
"@org_golang_x_tools//go/analysis/passes/findcall:findcall",
Expand Down Expand Up @@ -331,8 +334,6 @@ build_test(
"@org_golang_x_tools//go/types/objectpath:objectpath",
"@org_golang_x_tools//godoc/static:static",
"@org_golang_x_tools//godoc/vfs/zipfs:zipfs",
"@org_golang_x_tools//godoc:godoc",
"@org_golang_x_tools//present:present",
"@org_golang_x_tools//refactor/eg:eg",
"@org_golang_x_tools//refactor/importgraph:importgraph",
"@org_golang_x_tools//refactor/rename:rename",
Expand Down
11 changes: 8 additions & 3 deletions tests/integration/popular_repos/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ This runs tests from the repository `golang.org/x/crypto <https://golang.org/x/c
* @org_golang_x_crypto//blowfish:blowfish_test
* @org_golang_x_crypto//bn256:bn256_test
* @org_golang_x_crypto//cast5:cast5_test
* @org_golang_x_crypto//chacha20:chacha20_test
* @org_golang_x_crypto//chacha20poly1305:chacha20poly1305_test
* @org_golang_x_crypto//cryptobyte:cryptobyte_test
* @org_golang_x_crypto//curve25519:curve25519_test
* @org_golang_x_crypto//ed25519:ed25519_test
* @org_golang_x_crypto//hkdf:hkdf_test
* @org_golang_x_crypto//internal/chacha20:chacha20_test
* @org_golang_x_crypto//internal/subtle:subtle_test
* @org_golang_x_crypto//md4:md4_test
* @org_golang_x_crypto//nacl/auth:auth_test
* @org_golang_x_crypto//nacl/box:box_test
* @org_golang_x_crypto//nacl/secretbox:secretbox_test
* @org_golang_x_crypto//nacl/sign:sign_test
* @org_golang_x_crypto//ocsp:ocsp_test
* @org_golang_x_crypto//openpgp:openpgp_test
Expand All @@ -51,8 +50,8 @@ This runs tests from the repository `golang.org/x/crypto <https://golang.org/x/c
* @org_golang_x_crypto//salsa20/salsa:salsa_test
* @org_golang_x_crypto//scrypt:scrypt_test
* @org_golang_x_crypto//sha3:sha3_test
* @org_golang_x_crypto//ssh/internal/bcrypt_pbkdf:bcrypt_pbkdf_test
* @org_golang_x_crypto//ssh/knownhosts:knownhosts_test
* @org_golang_x_crypto//ssh/terminal:terminal_test
* @org_golang_x_crypto//tea:tea_test
* @org_golang_x_crypto//twofish:twofish_test
* @org_golang_x_crypto//xtea:xtea_test
Expand Down Expand Up @@ -82,6 +81,7 @@ This runs tests from the repository `golang.org/x/net <https://golang.org/x/net>
* @org_golang_x_net//netutil:netutil_test
* @org_golang_x_net//proxy:proxy_test
* @org_golang_x_net//publicsuffix:publicsuffix_test
* @org_golang_x_net//route:route_test
* @org_golang_x_net//trace:trace_test
* @org_golang_x_net//webdav:webdav_test
* @org_golang_x_net//webdav/internal/xml:xml_test
Expand All @@ -99,6 +99,7 @@ This runs tests from the repository `golang.org/x/sys <https://golang.org/x/sys>
* @org_golang_x_sys//internal/unsafeheader:unsafeheader_test
* @org_golang_x_sys//plan9:plan9_test
* @org_golang_x_sys//unix/internal/mkmerge:mkmerge_test
* @org_golang_x_sys//windows/mkwinsyscall:mkwinsyscall_test
* @org_golang_x_sys//windows/registry:registry_test
* @org_golang_x_sys//windows/svc:svc_test
* @org_golang_x_sys//windows/svc/eventlog:eventlog_test
Expand Down Expand Up @@ -163,8 +164,10 @@ This runs tests from the repository `golang.org/x/tools <https://golang.org/x/to
* @org_golang_x_tools//cmd/splitdwarf/internal/macho:macho_test
* @org_golang_x_tools//cover:cover_test
* @org_golang_x_tools//go/analysis:analysis_test
* @org_golang_x_tools//go/analysis/passes/directive/testdata/src/a:a_test
* @org_golang_x_tools//go/analysis/passes/internal/analysisutil:analysisutil_test
* @org_golang_x_tools//go/ast/astutil:astutil_test
* @org_golang_x_tools//go/callgraph:callgraph_test
* @org_golang_x_tools//go/callgraph/static:static_test
* @org_golang_x_tools//go/callgraph/vta/internal/trie:trie_test
* @org_golang_x_tools//go/cfg:cfg_test
Expand All @@ -188,6 +191,8 @@ This runs tests from the repository `golang.org/x/tools <https://golang.org/x/to
* @org_golang_x_tools//internal/jsonrpc2:jsonrpc2_test
* @org_golang_x_tools//internal/jsonrpc2/servertest:servertest_test
* @org_golang_x_tools//internal/jsonrpc2_v2:jsonrpc2_v2_test
* @org_golang_x_tools//internal/lockedfile:lockedfile_test
* @org_golang_x_tools//internal/lockedfile/internal/filelock:filelock_test
* @org_golang_x_tools//internal/memoize:memoize_test
* @org_golang_x_tools//internal/persistent:persistent_test
* @org_golang_x_tools//internal/proxydir:proxydir_test
Expand Down
4 changes: 1 addition & 3 deletions tests/integration/popular_repos/popular_repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def popular_repos():
go_repository,
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
strip_prefix = "crypto-5ea612d1eb830b38bc4e914e37f55311eb58adce",
type = "zip",
urls = ["https://codeload.github.com/golang/crypto/zip/5ea612d1eb830b38bc4e914e37f55311eb58adce"],
commit = "0d375be9b61cb69eb94173d0375a05e90875bbf6",
)
_maybe(
go_repository,
Expand Down
32 changes: 16 additions & 16 deletions tests/integration/popular_repos/popular_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
dict(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
urls = "https://codeload.github.com/golang/crypto/zip/5ea612d1eb830b38bc4e914e37f55311eb58adce",
strip_prefix = "crypto-5ea612d1eb830b38bc4e914e37f55311eb58adce",
type = "zip",
commit = "0d375be9b61cb69eb94173d0375a05e90875bbf6",
excludes = [
"internal/wycheproof:wycheproof_test", # Needs GOROOT
# "internal/wycheproof:wycheproof_test", # Needs GOROOT
"nacl/secretbox:secretbox_test", # panics in salsa2020_amd64.s
"ssh/agent:agent_test",
"ssh/test:test_test",
"ssh:ssh_test",
Expand All @@ -45,9 +44,6 @@
"nettest:nettest_test", #
"lif:lif_test",
],
darwin_tests = [
"route:route_test", # Not supported on linux
]
),

dict(
Expand Down Expand Up @@ -88,7 +84,6 @@
"cmd/bundle:bundle_test", # Needs testdata directory
"cmd/callgraph/testdata/src/pkg:pkg_test", # is testdata
"cmd/callgraph:callgraph_test", # Needs testdata directory
"cmd/cover:cover_test", # Needs testdata directory
"cmd/file2fuzz:file2fuzz_test", # Requires working GOROOT, uses go build
"cmd/fiximports:fiximports_test", # requires working GOROOT, not present in CI.
"cmd/godoc:godoc_test", # TODO(#417)
Expand Down Expand Up @@ -118,6 +113,7 @@
"go/analysis/passes/copylock:copylock_test", # Needs testdata directory
"go/analysis/passes/ctrlflow:ctrlflow_test", # Needs testdata directory
"go/analysis/passes/deepequalerrors:deepequalerrors_test", # requires go list
"go/analysis/passes/directive:directive_test", # Needs GOROOT
"go/analysis/passes/errorsas:errorsas_test", # requires go list and testdata
"go/analysis/passes/fieldalignment:fieldalignment_test", # Needs GOROOT
"go/analysis/passes/findcall:findcall_test", # requires build cache
Expand Down Expand Up @@ -187,6 +183,12 @@
"refactor/importgraph:importgraph_test", # TODO(#417)
"refactor/rename:rename_test", # TODO(#417)
],
build_excludes = [
"blog:blog", # requires present
"cmd/godoc:godoc", # requires godoc
"godoc:godoc", # requires goldmark
"present:present", # Needs goldmark
],
),

dict(
Expand Down Expand Up @@ -278,16 +280,15 @@ def build_bazel():
f.write(BUILD_HEADER)
f.write("\n" + LOAD_BAZEL_TEST_RULE)
build_only = []
build_excludes = []
for repo in POPULAR_REPOS:
name = repo["name"]
tests = check_output(["bazel", "query", "kind(go_test, \"@{}//...\")".format(name)], text=True).split("\n")
excludes = ["@{}//{}".format(name, l) for l in repo.get("excludes", [])]
build_excludes.extend(["@{}//{}".format(name, l) for l in repo.get("build_excludes", [])])
for k in repo:
if k.endswith("_excludes") or k.endswith("_tests"):
excludes.extend(["@{}//{}".format(name, l) for l in repo[k]])
invalid_excludes = [t for t in excludes if not t in tests]
if invalid_excludes:
exit("Invalid excludes found: {}".format(invalid_excludes))
build_only.extend(excludes)
f.write('\ntest_suite(\n')
f.write(' name = "{}",\n'.format(name))
Expand All @@ -307,11 +308,10 @@ def build_bazel():
f.write(' name = "{}",\n'.format("build_only"))
f.write(' targets = [\n')
for package in build_only:
if "/internal/" not in package and "/testdata/" not in package:
if package.endswith("_test"):
f.write(' "{}",\n'.format(package[:-5]))
else:
f.write(' "{}",\n'.format(package))
if "/internal/" not in package and "/testdata/" not in package:
p = package[:-5] if package.endswith("_test") else package
if p not in build_excludes:
f.write(' "{}",\n'.format(p))
f.write(' ],\n')
f.write(')\n')

Expand Down
8 changes: 7 additions & 1 deletion third_party/org_golang_x_tools-gazelle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9784,7 +9784,7 @@ diff -urN b/internal/lockedfile/BUILD.bazel c/internal/lockedfile/BUILD.bazel
diff -urN b/internal/lockedfile/internal/filelock/BUILD.bazel c/internal/lockedfile/internal/filelock/BUILD.bazel
--- b/internal/lockedfile/internal/filelock/BUILD.bazel 1970-01-01 00:00:00.000000000 +0000
+++ c/internal/lockedfile/internal/filelock/BUILD.bazel 2000-01-01 00:00:00.000000000 -0000
@@ -0,0 +1,65 @@
@@ -0,0 +1,71 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
Expand All @@ -9799,6 +9799,12 @@ diff -urN b/internal/lockedfile/internal/filelock/BUILD.bazel c/internal/lockedf
+ ],
+ importpath = "golang.org/x/tools/internal/lockedfile/internal/filelock",
+ visibility = ["//:__subpackages__"],
+ deps = select({
+ "@io_bazel_rules_go//go/platform:windows": [
+ "@org_golang_x_sys//windows",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
+alias(
Expand Down