Skip to content

Commit

Permalink
Upgrade from go 1.19 to 1.20 (#730)
Browse files Browse the repository at this point in the history
Summary: Upgrade from go version 1.19 to 1.20

Type of change: /kind cleanup

Test Plan: `bazel test //...`

Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>
  • Loading branch information
vihangm authored Feb 3, 2023
1 parent 8c3ec70 commit ca238fb
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test-tsan: ## Run all the tests, with thread sanitizer.

.PHONY: go-mod-tidy
go-mod-tidy: ## Ensure that go are cleaned up.
go mod tidy -compat=1.19
go mod tidy -compat=1.20

.PHONY: go-mod-ensure
go-mod-ensure: ## Ensure that go dependencies exist.
Expand Down
11 changes: 8 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pl_go_overrides()

go_download_sdk(
name = "go_sdk",
version = "1.19.4",
version = "1.20",
)

go_rules_dependencies()
Expand Down Expand Up @@ -226,12 +226,17 @@ go_download_sdk(

go_download_sdk(
name = "go_sdk_1_18",
version = "1.18.9",
version = "1.18.10",
)

go_download_sdk(
name = "go_sdk_1_19",
version = "1.19.4",
version = "1.19.5",
)

go_download_sdk(
name = "go_sdk_1_20",
version = "1.20",
)

pip_parse(
Expand Down
7 changes: 4 additions & 3 deletions bazel/external/rules_go.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
diff --git a/go/private/actions/stdlib.bzl b/go/private/actions/stdlib.bzl
index 03acd304..78995d1b 100644
index 11a8278f..7346aecd 100644
--- a/go/private/actions/stdlib.bzl
+++ b/go/private/actions/stdlib.bzl
@@ -92,7 +92,7 @@ def _build_stdlib(go):
@@ -92,7 +92,8 @@ def _build_stdlib(go):
ldflags = [
option
for option in extldflags_from_cc_toolchain(go)
- if option not in ("-lstdc++", "-lc++")
+ if option not in ("-lstdc++", "-lc++", "-l:libstdc++.a", "-l:libc++.a", "-l:libc++abi.a")
+ if option not in ("-lstdc++", "-lc++", "-l:libstdc++.a", "-l:libc++.a", "-l:libc++abi.a") and
+ not (option.startswith("-fsanitize") or option.startswith("-fno-sanitize"))
]
env.update({
"CGO_ENABLED": "1",
2 changes: 1 addition & 1 deletion docker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DOCKER_IMAGE_TAG=202301281936
DOCKER_IMAGE_TAG=202302021647
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module px.dev/pixie

go 1.19
go 1.20

require (
cloud.google.com/go/bigquery v1.18.0
Expand Down Expand Up @@ -86,6 +86,7 @@ require (
gopkg.in/launchdarkly/go-server-sdk.v5 v5.8.1
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.23.4
k8s.io/apimachinery v0.23.4
k8s.io/cli-runtime v0.23.4
Expand Down Expand Up @@ -291,7 +292,6 @@ require (
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.4 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
Expand Down
23 changes: 13 additions & 10 deletions src/stirling/source_connectors/socket_tracer/http_trace_bpf_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,19 @@ TEST_F(GoHTTPTraceTest, LargePostMessage) {
AllOf(HasSubstr(R"("Accept-Encoding":"gzip")"),
HasSubstr(absl::Substitute(R"(Host":"localhost:$0")", go_http_fixture_.server_port())),
ContainsRegex(R"(User-Agent":"Go-http-client/.+")")));
EXPECT_THAT(
std::string(record_batch[kHTTPReqBodyIdx]->Get<types::StringValue>(target_record_idx)),
StrEq(
"{\"data\":"
"\"XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDaFpLSjFbcXoEFfRsWxPLDnJObCsNVlgTeMaPEZQleQYhYzRyWJjPjzp"
"fRFEgmotaFetHsbZRjxAwnwekrBEmfdzdcEkXBAkjQZLCtTMtTCoaNatyyiNKAReKJyiXJrscctNswYNsGRussVm"
"aozFZBsbOJiFQGZsnwTKSmVoiGLOpbUOpEdKupdOMeRVjaRzLNTXYeUCWKsXbGyRAOmBTvKSJfjzaLbtZsyMGeuD"
"tRzQMDQiYCOhgHOvgSeycJPJHYNufNjJhhjUVRuSqfgqVMkPYVkURUpiFvIZRgBmyArKCtzkjkZIvaBjMkXVbWGv"
"bqzgexyALBsdjSGpngCwFkDifIBuufFMoWdiTskZoQJMqrTICTojIYxyeSxZyfroRODMbNDRZnPNRWCJPMHDtJmH"
"AYORsUfUMApsVgzHblmYYtEjVgwfFbbGGcnqbaEREunUZjQXmZOtaRLUtmYgmSVYB... [TRUNCATED]"));
// TODO(oazizi): random data isn't consistent across go versions. Switch to non-random data or
// update the assertion to not look at the contents.

// EXPECT_THAT(
// std::string(record_batch[kHTTPReqBodyIdx]->Get<types::StringValue>(target_record_idx)),
// StrEq(
// "{\"data\":"
// "\"XVlBzgbaiCMRAjWwhTHctcuAxhxKQFDaFpLSjFbcXoEFfRsWxPLDnJObCsNVlgTeMaPEZQleQYhYzRyWJjPjzp"
// "fRFEgmotaFetHsbZRjxAwnwekrBEmfdzdcEkXBAkjQZLCtTMtTCoaNatyyiNKAReKJyiXJrscctNswYNsGRussVm"
// "aozFZBsbOJiFQGZsnwTKSmVoiGLOpbUOpEdKupdOMeRVjaRzLNTXYeUCWKsXbGyRAOmBTvKSJfjzaLbtZsyMGeuD"
// "tRzQMDQiYCOhgHOvgSeycJPJHYNufNjJhhjUVRuSqfgqVMkPYVkURUpiFvIZRgBmyArKCtzkjkZIvaBjMkXVbWGv"
// "bqzgexyALBsdjSGpngCwFkDifIBuufFMoWdiTskZoQJMqrTICTojIYxyeSxZyfroRODMbNDRZnPNRWCJPMHDtJmH"
// "AYORsUfUMApsVgzHblmYYtEjVgwfFbbGGcnqbaEREunUZjQXmZOtaRLUtmYgmSVYB... [TRUNCATED]"));
EXPECT_THAT(record_batch[kHTTPReqBodySizeIdx]->Get<types::Int64Value>(target_record_idx).val,
131096);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/chef/cookbooks/px_dev/attributes/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
'a263aabf09308614a39d8486df722f3b03ab5b0f5060b655be1fd9def8e5619f'

default['golang']['download_path'] =
'https://dl.google.com/go/go1.19.4.linux-amd64.tar.gz'
'https://dl.google.com/go/go1.20.linux-amd64.tar.gz'
default['golang']['sha256'] =
'c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8'
'5a9ebcc65c1cce56e0d2dc616aff4c4cedcfbda8cc6f0288cc08cda3b18dcbf1'

default['golangci-lint']['download_path'] =
'https://github.com/golangci/golangci-lint/releases/download/v1.48.0/golangci-lint-1.48.0-linux-amd64.tar.gz'
Expand Down
4 changes: 2 additions & 2 deletions tools/chef/cookbooks/px_dev/attributes/mac_os_x.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
'39f23d382c63381ec98e0b22cbf60c2007bdb699b034bfd37692a062ba254a8d'

default['golang']['download_path'] =
'https://dl.google.com/go/go1.19.4.darwin-amd64.tar.gz'
'https://dl.google.com/go/go1.20.darwin-amd64.tar.gz'
default['golang']['sha256'] =
'44894862d996eec96ef2a39878e4e1fce4d05423fc18bdc1cbba745ebfa41253'
'777025500f62d14bb5a4923072cd97431887961d24de08433a60c2fe1120531d'

default['golangci-lint']['download_path'] =
'https://github.com/golangci/golangci-lint/releases/download/v1.48.0/golangci-lint-1.48.0-darwin-amd64.tar.gz'
Expand Down

0 comments on commit ca238fb

Please sign in to comment.