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
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
# 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.
"//tools:rules_go_sdk.patch",
],
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
urls = [
"https://mirror.bazel.build/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.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.38.1/rules_go-v0.38.1.zip",
],
)
@@ -70,7 +70,7 @@ go_download_sdk(
# time on our continuous integration.
patch = "//tools:go_types_memoize.patch",
patch_strip = 2,
version = "1.19.3",
version = "1.20",
)
gazelle_dependencies()
@@ -81,8 +81,8 @@ gazelle_dependencies()
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=",
version = "v0.3.0",
sum = "h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=",
version = "v0.5.0",
)
go_repository(
@@ -140,7 +140,11 @@ http_archive(
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")
# Load protobuf dependencies.
+10 -1
View File
@@ -17,6 +17,7 @@ package container
import (
"encoding/json"
"io/ioutil"
"os"
"strings"
"testing"
"time"
@@ -375,7 +376,15 @@ func TestProcfsDump(t *testing.T) {
if len(procfsDump[0].FDs) < 3 {
t.Errorf("expected at least 3 FDs for the sleep process, got %+v", procfsDump[0].FDs)
} 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] {
if want := int32(i); fd.Number != want {
t.Errorf("expected FD number %d, got %d", want, fd.Number)
+1
View File
@@ -22,6 +22,7 @@ go_test(
"//runsc",
],
library = ":root",
pure = True,
tags = [
"local",
"manual",
+3 -1
View File
@@ -140,8 +140,10 @@ def go_context(ctx, goos = None, goarch = None, std = False):
goos = go_ctx.sdk.goos
if goarch == None:
goarch = go_ctx.sdk.goarch
env = go_ctx.env
env["CGO_ENABLED"] = "0"
return struct(
env = go_ctx.env,
env = env,
go = go_ctx.go,
goarch = goarch,
goos = goos,
+5 -5
View File
@@ -1,8 +1,8 @@
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
+++ 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,
"urls": ctx.attr.urls,
"version": version,
@@ -11,8 +11,8 @@ index cf6f73e6..26c9720c 100644
"strip_prefix": ctx.attr.strip_prefix,
}
return None
@@ -121,6 +123,8 @@ _go_download_sdk = repository_rule(
"sdks": attr.string_list_dict(),
@@ -142,6 +144,8 @@ _go_download_sdk = repository_rule(
),
"urls": attr.string_list(default = ["https://dl.google.com/go/{}"]),
"version": attr.string(),
+ "patch": attr.label(default = None),
@@ -20,7 +20,7 @@ index cf6f73e6..26c9720c 100644
"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"])
if res.return_code:
fail("error extracting Go SDK:\n" + res.stdout + res.stderr)