Skip to content

Commit

Permalink
upkeep: upgrade go 1.18.3 and gazelle v0.26.0
Browse files Browse the repository at this point in the history
This upgrade GoSDK and Gazelle to the latest version. This also bring
forth an upgrade to Gazelle's dependencies which requires multiple
integration tests to be updated.
  • Loading branch information
sluongng committed Jul 4, 2022
1 parent e01cf17 commit ee4dd88
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
20 changes: 16 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe

go_rules_dependencies()

go_register_toolchains(version = "1.17")
go_register_toolchains(version = "1.18.3")

http_archive(
name = "com_google_protobuf",
Expand Down Expand Up @@ -78,10 +78,10 @@ bazel_skylib_workspace()

http_archive(
name = "bazel_gazelle",
sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
sha256 = "501deb3d5695ab658e82f6f6f549ba681ea3ca2a5fb7911154b5aa45596183fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
],
)

Expand Down Expand Up @@ -122,6 +122,18 @@ go_repository(
version = "v0.0.0-20210628180205-a41e5a781914",
)

# TODO(sluongng): Gazelle v0.25.0 switched to static dependency resolution which cause
# build files generation in external dependencies to wrongly resolve these repositories.
# We should investigate in Gazelle why this happen and fix it.
# For now, use manual mapping as a workaround.
#
# gazelle:repository go_repository name=org_golang_x_tools importpath=golang.org/x/tools
# gazelle:repository go_repository name=org_golang_x_text importpath=golang.org/x/text
# gazelle:repository go_repository name=org_golang_x_xerrors importpath=golang.org/x/xerrors
# gazelle:repository go_repository name=org_golang_x_net importpath=golang.org/x/net
# gazelle:repository go_repository name=org_golang_x_sys importpath=golang.org/x/sys
# gazelle:repository go_repository name=org_golang_x_crypto importpath=golang.org/x/crypto

gazelle_dependencies()

load("@io_bazel_rules_go//tests/legacy/test_chdir:remote.bzl", "test_chdir_remote")
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/popular_repos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ test_suite(
"@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//curve25519/internal/field:field_test",
"@org_golang_x_crypto//ed25519:ed25519_test",
"@org_golang_x_crypto//hkdf:hkdf_test",
"@org_golang_x_crypto//internal/poly1305:poly1305_test",
"@org_golang_x_crypto//internal/subtle:subtle_test",
"@org_golang_x_crypto//md4:md4_test",
"@org_golang_x_crypto//nacl/auth:auth_test",
Expand All @@ -50,7 +52,6 @@ test_suite(
"@org_golang_x_crypto//pbkdf2:pbkdf2_test",
"@org_golang_x_crypto//pkcs12:pkcs12_test",
"@org_golang_x_crypto//pkcs12/internal/rc2:rc2_test",
"@org_golang_x_crypto//poly1305:poly1305_test",
"@org_golang_x_crypto//ripemd160:ripemd160_test",
"@org_golang_x_crypto//salsa20:salsa20_test",
"@org_golang_x_crypto//salsa20/salsa:salsa_test",
Expand Down Expand Up @@ -165,12 +166,10 @@ test_suite(
"@org_golang_x_tools//cover:cover_test",
"@org_golang_x_tools//go/analysis:analysis_test",
"@org_golang_x_tools//go/analysis/passes/internal/analysisutil:analysisutil_test",
"@org_golang_x_tools//go/analysis/passes/usesgenerics:usesgenerics_test",
"@org_golang_x_tools//go/ast/astutil:astutil_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",
"@org_golang_x_tools//go/types/objectpath:objectpath_test",
"@org_golang_x_tools//go/vcs:vcs_test",
"@org_golang_x_tools//godoc/redirect:redirect_test",
"@org_golang_x_tools//godoc/vfs:vfs_test",
Expand All @@ -186,8 +185,6 @@ 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/lsp/analysis/infertypeargs:infertypeargs_test",
"@org_golang_x_tools//internal/lsp/analysis/useany:useany_test",
"@org_golang_x_tools//internal/lsp/progress:progress_test",
"@org_golang_x_tools//internal/lsp/regtest:regtest_test",
"@org_golang_x_tools//internal/lsp/source/completion:completion_test",
Expand All @@ -196,7 +193,6 @@ test_suite(
"@org_golang_x_tools//internal/proxydir:proxydir_test",
"@org_golang_x_tools//internal/span:span_test",
"@org_golang_x_tools//internal/stack:stack_test",
"@org_golang_x_tools//internal/typeparams:typeparams_test",
"@org_golang_x_tools//playground/socket:socket_test",
"@org_golang_x_tools//txtar:txtar_test",
],
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/popular_repos/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ This runs tests from the repository `golang.org/x/crypto <https://golang.org/x/c
* @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//curve25519/internal/field:field_test
* @org_golang_x_crypto//ed25519:ed25519_test
* @org_golang_x_crypto//hkdf:hkdf_test
* @org_golang_x_crypto//internal/poly1305:poly1305_test
* @org_golang_x_crypto//internal/subtle:subtle_test
* @org_golang_x_crypto//md4:md4_test
* @org_golang_x_crypto//nacl/auth:auth_test
Expand All @@ -45,7 +47,6 @@ This runs tests from the repository `golang.org/x/crypto <https://golang.org/x/c
* @org_golang_x_crypto//pbkdf2:pbkdf2_test
* @org_golang_x_crypto//pkcs12:pkcs12_test
* @org_golang_x_crypto//pkcs12/internal/rc2:rc2_test
* @org_golang_x_crypto//poly1305:poly1305_test
* @org_golang_x_crypto//ripemd160:ripemd160_test
* @org_golang_x_crypto//salsa20:salsa20_test
* @org_golang_x_crypto//salsa20/salsa:salsa_test
Expand Down Expand Up @@ -164,12 +165,10 @@ This runs tests from the repository `golang.org/x/tools <https://golang.org/x/to
* @org_golang_x_tools//cover:cover_test
* @org_golang_x_tools//go/analysis:analysis_test
* @org_golang_x_tools//go/analysis/passes/internal/analysisutil:analysisutil_test
* @org_golang_x_tools//go/analysis/passes/usesgenerics:usesgenerics_test
* @org_golang_x_tools//go/ast/astutil:astutil_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
* @org_golang_x_tools//go/types/objectpath:objectpath_test
* @org_golang_x_tools//go/vcs:vcs_test
* @org_golang_x_tools//godoc/redirect:redirect_test
* @org_golang_x_tools//godoc/vfs:vfs_test
Expand All @@ -185,8 +184,6 @@ 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/lsp/analysis/infertypeargs:infertypeargs_test
* @org_golang_x_tools//internal/lsp/analysis/useany:useany_test
* @org_golang_x_tools//internal/lsp/progress:progress_test
* @org_golang_x_tools//internal/lsp/regtest:regtest_test
* @org_golang_x_tools//internal/lsp/source/completion:completion_test
Expand All @@ -195,7 +192,6 @@ This runs tests from the repository `golang.org/x/tools <https://golang.org/x/to
* @org_golang_x_tools//internal/proxydir:proxydir_test
* @org_golang_x_tools//internal/span:span_test
* @org_golang_x_tools//internal/stack:stack_test
* @org_golang_x_tools//internal/typeparams:typeparams_test
* @org_golang_x_tools//playground/socket:socket_test
* @org_golang_x_tools//txtar:txtar_test

Expand Down
13 changes: 9 additions & 4 deletions tests/integration/popular_repos/popular_repos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -88,8 +88,8 @@
"cmd/callgraph/testdata/src/pkg:pkg_test", # is testdata
"cmd/callgraph:callgraph_test", # Needs testdata directory
"cmd/cover:cover_test", # Needs testdata directory
"cmd/fiximports:fiximports_test", # requires working GOROOT, not present in CI.
"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)
"cmd/gorename:gorename_test", # TODO(#417)
"cmd/guru/testdata/src/referrers:referrers_test", # Not a real test
Expand Down Expand Up @@ -145,6 +145,7 @@
"go/analysis/passes/unsafeptr:unsafeptr_test", # Needs testdata directory
"go/analysis/passes/unusedresult:unusedresult_test", # Needs testdata directory
"go/analysis/passes/unusedwrite:unusedwrite_test", # Needs testdata directory
"go/analysis/passes/usesgenerics:usesgenerics_test", # Needs go tool
"go/analysis/unitchecker:unitchecker_test", # requires go vet
"go/ast/inspector:inspector_test", # requires GOROOT and GOPATH
"go/buildutil:buildutil_test", # Needs testdata directory
Expand All @@ -166,6 +167,7 @@
"go/ssa/ssautil:ssautil_test", # Needs testdata directory
"go/ssa:ssa_test", # Needs testdata directory
"go/types/typeutil:typeutil_test", # requires GOROOT
"go/types/objectpath:objectpath_test", # Incomaptible with Go SDK 1.18.3. Fixed in master but not yet released. TODO: fixme
"godoc/static:static_test", # requires data files
"godoc/vfs/zipfs:zipfs_test", # requires GOROOT
"godoc:godoc_test", # requires GOROOT and GOPATH
Expand All @@ -174,13 +176,15 @@
"internal/imports:imports_test", # Needs testdata directory
"internal/lsp/analysis/fillreturns:fillreturns_test", # Needs go tool
"internal/lsp/analysis/fillstruct:fillstruct_test", # Needs go tool
"internal/lsp/analysis/infertypeargs:infertypeargs_test", # Needs go tool
"internal/lsp/analysis/nonewvars:nonewvars_test", # Needs GOROOT
"internal/lsp/analysis/noresultvalues:noresultvalues_test", # Needs GOROOT
"internal/lsp/analysis/simplifycompositelit:simplifycompositelit_test", # Needs go tool
"internal/lsp/analysis/simplifyrange:simplifyrange_test", # Needs GOROOT
"internal/lsp/analysis/simplifyslice:simplifyslice_test", # Needs GOROOT
"internal/lsp/analysis/undeclaredname:undeclaredname_test", # Needs GOROOT
"internal/lsp/analysis/unusedparams:unusedparams_test", # Needs go tool
"internal/lsp/analysis/useany:useany_test", # Needs go tool
"internal/lsp/cache:cache_test", # has additional deps
"internal/lsp/cmd:cmd_test", # panics?
"internal/lsp/command:command_test", # Needs go tool
Expand All @@ -193,7 +197,6 @@
"internal/lsp/mod:mod_test", # has additional deps
"internal/lsp/snippet:snippet_test", # has additional deps
"internal/lsp/source:source_test", # Needs testdata directory
"internal/lsp:lsp_test", # Needs testdata directory
"internal/lsp/testdata/analyzer:analyzer_test", # is testdata
"internal/lsp/testdata/codelens:codelens_test", # is testdata
"internal/lsp/testdata/godef/a:a_test", # is testdata
Expand All @@ -202,10 +205,12 @@
"internal/lsp/testdata/rename/testy:testy_test", # is testdata
"internal/lsp/testdata/semantic:semantic_test", # is testdata
"internal/lsp/testdata/signature:signature_test", # is testdata
"internal/lsp/testdata/statements:statements_test", # is testdata
"internal/lsp/testdata/testy:testy_test", # is testdata
"internal/lsp/testdata/unimported:unimported_test", # is testdata
"internal/lsp/testdata/workspacesymbol/a:a_test", # is testdata
"internal/lsp/testdata/statements:statements_test", # is testdata
"internal/lsp:lsp_test", # Needs testdata directory
"internal/typeparams:typeparams_test", # Needs go tool
"present:present_test", # Needs goldmark
"refactor/eg:eg_test", # Needs testdata directory
"refactor/importgraph:importgraph_test", # TODO(#417)
Expand Down

0 comments on commit ee4dd88

Please sign in to comment.