Bump go version to 1.20

Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Andrei Vagin
2023-02-10 08:32:17 -08:00
parent 13448f9e87
commit 5572ab2f7d
6 changed files with 31 additions and 15 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ smoke-race-tests: ## Runs a smoke test after build building runsc in race config
.PHONY: smoke-race-tests .PHONY: smoke-race-tests
nogo-tests: nogo-tests:
@$(call test,--build_tag_filters=nogo --test_tag_filters=nogo --//tools/nogo:full //:all pkg/... tools/...) @$(call test,--build_tag_filters=nogo --test_tag_filters=nogo --//tools/nogo:full //:all pkg/... tools/...)
.PHONY: nogo-tests .PHONY: nogo-tests
# For unit tests, we take everything in the root, pkg/... and tools/..., and # For unit tests, we take everything in the root, pkg/... and tools/..., and
+11 -7
View File
@@ -42,10 +42,10 @@ http_archive(
# Allow for patching of the go_sdk. # Allow for patching of the go_sdk.
"//tools:rules_go_sdk.patch", "//tools:rules_go_sdk.patch",
], ],
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
urls = [ urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
], ],
) )
@@ -70,7 +70,7 @@ go_download_sdk(
# time on our continuous integration. # time on our continuous integration.
patch = "//tools:go_types_memoize.patch", patch = "//tools:go_types_memoize.patch",
patch_strip = 2, patch_strip = 2,
version = "1.19.3", version = "1.20",
) )
gazelle_dependencies() gazelle_dependencies()
@@ -81,8 +81,8 @@ gazelle_dependencies()
go_repository( go_repository(
name = "org_golang_x_tools", name = "org_golang_x_tools",
importpath = "golang.org/x/tools", importpath = "golang.org/x/tools",
sum = "h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=", sum = "h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=",
version = "v0.3.0", version = "v0.5.0",
) )
go_repository( go_repository(
@@ -140,7 +140,11 @@ http_archive(
load("@coral_crosstool//:configure.bzl", "cc_crosstool") load("@coral_crosstool//:configure.bzl", "cc_crosstool")
cc_crosstool(name = "crosstool") cc_crosstool(
name = "crosstool",
c_version = "gnu17",
)
register_toolchains("//:cc_toolchain_k8", "//:cc_toolchain_aarch64") register_toolchains("//:cc_toolchain_k8", "//:cc_toolchain_aarch64")
# Load protobuf dependencies. # Load protobuf dependencies.
+10 -1
View File
@@ -17,6 +17,7 @@ package container
import ( import (
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
"os"
"strings" "strings"
"testing" "testing"
"time" "time"
@@ -375,7 +376,15 @@ func TestProcfsDump(t *testing.T) {
if len(procfsDump[0].FDs) < 3 { if len(procfsDump[0].FDs) < 3 {
t.Errorf("expected at least 3 FDs for the sleep process, got %+v", procfsDump[0].FDs) t.Errorf("expected at least 3 FDs for the sleep process, got %+v", procfsDump[0].FDs)
} else { } else {
modes := []uint16{unix.S_IFCHR, unix.S_IFIFO, unix.S_IFREG} modes := [3]uint32{}
for i, _ := range []*os.File{os.Stdin, os.Stdout, os.Stderr} {
stat := unix.Stat_t{}
err := unix.Fstat(i, &stat)
if err != nil {
t.Fatalf("unix.Fatat(i) failed: %s", err)
}
modes[i] = stat.Mode & unix.S_IFMT
}
for i, fd := range procfsDump[0].FDs[:3] { for i, fd := range procfsDump[0].FDs[:3] {
if want := int32(i); fd.Number != want { if want := int32(i); fd.Number != want {
t.Errorf("expected FD number %d, got %d", want, fd.Number) t.Errorf("expected FD number %d, got %d", want, fd.Number)
+1
View File
@@ -22,6 +22,7 @@ go_test(
"//runsc", "//runsc",
], ],
library = ":root", library = ":root",
pure = True,
tags = [ tags = [
"local", "local",
"manual", "manual",
+3 -1
View File
@@ -140,8 +140,10 @@ def go_context(ctx, goos = None, goarch = None, std = False):
goos = go_ctx.sdk.goos goos = go_ctx.sdk.goos
if goarch == None: if goarch == None:
goarch = go_ctx.sdk.goarch goarch = go_ctx.sdk.goarch
env = go_ctx.env
env["CGO_ENABLED"] = "0"
return struct( return struct(
env = go_ctx.env, env = env,
go = go_ctx.go, go = go_ctx.go,
goarch = goarch, goarch = goarch,
goos = goos, goos = goos,
+5 -5
View File
@@ -1,8 +1,8 @@
diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl
index cf6f73e6..26c9720c 100644 index 0d55d474..1b2a776b 100644
--- a/go/private/sdk.bzl --- a/go/private/sdk.bzl
+++ b/go/private/sdk.bzl +++ b/go/private/sdk.bzl
@@ -109,6 +109,8 @@ def _go_download_sdk_impl(ctx): @@ -127,6 +127,8 @@ def _go_download_sdk_impl(ctx):
"sdks": ctx.attr.sdks, "sdks": ctx.attr.sdks,
"urls": ctx.attr.urls, "urls": ctx.attr.urls,
"version": version, "version": version,
@@ -11,8 +11,8 @@ index cf6f73e6..26c9720c 100644
"strip_prefix": ctx.attr.strip_prefix, "strip_prefix": ctx.attr.strip_prefix,
} }
return None return None
@@ -121,6 +123,8 @@ _go_download_sdk = repository_rule( @@ -142,6 +144,8 @@ _go_download_sdk = repository_rule(
"sdks": attr.string_list_dict(), ),
"urls": attr.string_list(default = ["https://dl.google.com/go/{}"]), "urls": attr.string_list(default = ["https://dl.google.com/go/{}"]),
"version": attr.string(), "version": attr.string(),
+ "patch": attr.label(default = None), + "patch": attr.label(default = None),
@@ -20,7 +20,7 @@ index cf6f73e6..26c9720c 100644
"strip_prefix": attr.string(default = "go"), "strip_prefix": attr.string(default = "go"),
}, },
) )
@@ -210,6 +214,8 @@ def _remote_sdk(ctx, urls, strip_prefix, sha256): @@ -334,6 +338,8 @@ def _remote_sdk(ctx, urls, strip_prefix, sha256):
res = ctx.execute(["tar", "-xf", "go_sdk.tar.gz", "--strip-components=1"]) res = ctx.execute(["tar", "-xf", "go_sdk.tar.gz", "--strip-components=1"])
if res.return_code: if res.return_code:
fail("error extracting Go SDK:\n" + res.stdout + res.stderr) fail("error extracting Go SDK:\n" + res.stdout + res.stderr)