aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/package/go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-07-10 15:51:57 +0900
committerOphestra <cat@gensokyo.uk>2026-07-10 15:51:57 +0900
commit5161fc24ec425a8e3c28158a431383e48353d143 (patch)
tree12957bf549f5b989560f9ccb1f909a7cea441ef8 /internal/rosa/package/go
parente1f16e77209bc5acc7e41afecc15672627a0fafa (diff)
internal/rosa/package/go: 1.26.4 to 1.26.5
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package/go')
-rw-r--r--internal/rosa/package/go/746640.patch29
-rw-r--r--internal/rosa/package/go/799064.patch135
-rw-r--r--internal/rosa/package/go/package.az63
3 files changed, 227 insertions, 0 deletions
diff --git a/internal/rosa/package/go/746640.patch b/internal/rosa/package/go/746640.patch
new file mode 100644
index 00000000..be1e732d
--- /dev/null
+++ b/internal/rosa/package/go/746640.patch
@@ -0,0 +1,29 @@
+From 45929774c3d5c084cc478afba63c77cf67a68bd7 Mon Sep 17 00:00:00 2001
+From: khr@golang.org <khr@golang.org>
+Date: Wed, 18 Feb 2026 09:09:57 -0800
+Subject: [PATCH] internal/runtime/gc/scan: require popcnt for x86
+
+The GOAMD64=v1 test disables popcnt instructions, which is a feature
+this package's amd64 assembly uses.
+
+Fixes #77674
+
+Change-Id: I7be9bb665838f5da50275f96ef3df398412bb44a
+Reviewed-on: https://go-review.googlesource.com/c/go/+/746640
+LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
+Reviewed-by: Michael Knyszek <mknyszek@google.com>
+Reviewed-by: Keith Randall <khr@google.com>
+Auto-Submit: Keith Randall <khr@golang.org>
+---
+
+diff --git a/src/internal/runtime/gc/scan/scan_amd64.go b/src/internal/runtime/gc/scan/scan_amd64.go
+index c03021c7d4..544b237770 100644
+--- a/src/internal/runtime/gc/scan/scan_amd64.go
++++ b/src/internal/runtime/gc/scan/scan_amd64.go
+@@ -39,4 +39,5 @@ var avx512ScanPackedReqsMet = cpu.X86.HasAVX512VL &&
+ cpu.X86.HasGFNI &&
+ cpu.X86.HasAVX512BITALG &&
+ cpu.X86.HasAVX512DQ && // for kmovb, see #79871
+- cpu.X86.HasAVX512VBMI
++ cpu.X86.HasAVX512VBMI &&
++ cpu.X86.HasPOPCNT
diff --git a/internal/rosa/package/go/799064.patch b/internal/rosa/package/go/799064.patch
new file mode 100644
index 00000000..cc1cc16f
--- /dev/null
+++ b/internal/rosa/package/go/799064.patch
@@ -0,0 +1,135 @@
+From 06f90ebfa6f3e0a744584513e2786988b26569da Mon Sep 17 00:00:00 2001
+From: Damien Neil <dneil@google.com>
+Date: Wed, 08 Jul 2026 11:11:48 -0700
+Subject: [PATCH] os: properly handle trailing / in Root.MkdirAll
+
+MkdirAll("dir/") should create "dir", not return an error.
+
+Fixes #80308
+
+Change-Id: I75458c30b6cb94be3a3d368f6024caef6a6a6964
+---
+
+diff --git a/src/os/root_noopenat.go b/src/os/root_noopenat.go
+index 228b580..a84e952 100644
+--- a/src/os/root_noopenat.go
++++ b/src/os/root_noopenat.go
+@@ -158,6 +158,9 @@
+ if err := checkPathEscapes(r, name); err == errPathEscapes {
+ return &PathError{Op: "mkdirat", Path: name, Err: err}
+ }
++ if name == "" {
++ return &PathError{Op: "mkdirat", Path: name, Err: syscall.ENOENT}
++ }
+ prefix := r.root.name + string(PathSeparator)
+ if err := MkdirAll(prefix+name, perm); err != nil {
+ if pe, ok := err.(*PathError); ok {
+diff --git a/src/os/root_openat.go b/src/os/root_openat.go
+index d7c9334..92865e4 100644
+--- a/src/os/root_openat.go
++++ b/src/os/root_openat.go
+@@ -167,6 +167,12 @@
+ fi, e := r.Stat(fullname)
+ if e == nil && fi.Mode().IsDir() {
+ err = nil
++ } else if e == nil {
++ err = syscall.ENOTDIR
++ } else if !IsNotExist(e) {
++ // EPERM, ELOOP, etc.,
++ // probably more useful than EEXIST.
++ err = e
+ }
+ }
+ }
+@@ -177,7 +183,12 @@
+ }
+ return struct{}{}, &PathError{Op: "mkdirat", Err: err}
+ }
+- _, err := doInRoot(r, fullname, 0, openDirFunc, openLastComponentFunc)
++ flags := uint(doInRootCreatingDirectory)
++ switch runtime.GOOS {
++ case "linux", "windows":
++ flags = doInRootNoHandleTerminalSlash // see rootMkdir
++ }
++ _, err := doInRoot(r, fullname, flags, openDirFunc, openLastComponentFunc)
+ if err != nil {
+ if _, ok := err.(*PathError); !ok {
+ err = &PathError{Op: "mkdirat", Path: fullname, Err: err}
+diff --git a/src/os/root_test.go b/src/os/root_test.go
+index 5e0acf9..33a2f33 100644
+--- a/src/os/root_test.go
++++ b/src/os/root_test.go
+@@ -585,6 +585,11 @@
+
+ func TestRootMkdirAll(t *testing.T) {
+ for _, test := range rootTestCases {
++ if test.name == "directory does not exist" {
++ // Test expects error, mkdirall creates the missing directory.
++ // TestRootMultiMkdirAll covers this case better anyway, just skip.
++ continue
++ }
+ test.run(t, func(t *testing.T, target string, root *os.Root) {
+ wantError := test.wantError
+ if test.ltarget != "" {
+@@ -593,7 +598,7 @@
+ wantError = true
+ }
+
+- err := root.Mkdir(test.open, 0o777)
++ err := root.MkdirAll(test.open, 0o777)
+ if errEndsTest(t, err, wantError, "root.MkdirAll(%q)", test.open) {
+ return
+ }
+@@ -3133,6 +3138,52 @@
+ })
+ }
+
++func TestRootMultiMkdirAllShallow(t *testing.T) {
++ runRootMultiTest(t, func(t *testing.T, test *rootMultiTest) (string, error) {
++ return testRootMultiMkdirAll(t, test, test.targetPath)
++ })
++}
++
++func TestRootMultiMkdirAllDeep(t *testing.T) {
++ runRootMultiTest(t, func(t *testing.T, test *rootMultiTest) (string, error) {
++ targetPath := test.targetPath
++ if len(targetPath) > 0 && os.IsPathSeparator(targetPath[len(targetPath)-1]) {
++ targetPath += "a/b/"
++ } else {
++ targetPath += "/a/b"
++ }
++ return testRootMultiMkdirAll(t, test, targetPath)
++ })
++}
++
++func testRootMultiMkdirAll(t *testing.T, test *rootMultiTest, targetPath string) (string, error) {
++ var mkdirAll = os.MkdirAll
++ if test.root != nil {
++ mkdirAll = test.root.MkdirAll
++ }
++
++ test.setOp("MkdirAll(%q, 0o777)", targetPath)
++ gotErr := mkdirAll(targetPath, 0o777)
++
++ switch {
++ case test.root != nil && test.target.lescapes():
++ // "mkdir ../target", or equivalent escaping path.
++ test.wantError(t, gotErr, os.ErrPathEscapes)
++ case test.root != nil && test.target.escapes():
++ // "mkdir ../target", or equivalent escaping path.
++ test.wantError(t, gotErr, errAny)
++ return "", errSkipRootConsistencyCheck
++ case test.root != nil && test.target.kind == testFileSymlink && test.target.target.kind == testFileAbsent && targetPath != test.targetPath:
++ // A minor inconsistency between Root.MkdirAll and os.MkdirAll:
++ // When an intermediate component of the tree being constructed is a
++ // dangling symlink, Root.MkdirAll will follow the symlink and create
++ // its target directory, while os.MkdirAll will fail with an error.
++ return "", errSkipRootConsistencyCheck
++ default:
++ }
++ return "", gotErr
++}
++
+ func TestRootMultiRename(t *testing.T) {
+ if runtime.GOOS == "wasip1" {
+ switch os.Getenv("GOWASIRUNTIME") {
diff --git a/internal/rosa/package/go/package.az b/internal/rosa/package/go/package.az
new file mode 100644
index 00000000..d2ab4f9d
--- /dev/null
+++ b/internal/rosa/package/go/package.az
@@ -0,0 +1,63 @@
+package go {
+ description = "the Go programming language toolchain";
+ website = "https://go.dev";
+ anitya = 1227;
+
+ version# = "1.26.5";
+ source = remoteTar {
+ url = "https://go.dev/dl/go"+version+".src.tar.gz";
+ checksum = "13yt1u_NGOd62LO-WZ8W6CUXodOrEF5CdkiTTiH9E635IHn1luvlXYjsHpBXNFSw";
+ compress = gzip;
+ };
+
+ patches = [
+ // https://go.dev/issue/77674
+ "746640.patch",
+ // https://go.dev/issue/80308
+ "799064.patch",
+ ];
+
+ env = [
+ "CC=cc",
+ "GOCACHE=/tmp/gocache",
+ "GOROOT_BOOTSTRAP=/system/go",
+ "TMPDIR=/dev/shm/go",
+ ];
+
+ enterSource = true;
+
+ exec = generic {
+ inPlace = true;
+ build = `
+mkdir /work/system/ "${TMPDIR}"
+cp -r . /work/system/go
+cd /work/system/go/src/
+chmod -R +w ..
+
+sed -i \
+ 's,/lib/ld-musl-`+linuxArch+`.so.1,/system/bin/linker,' \
+ cmd/link/internal/`+arch+`/obj.go
+
+rm \
+ os/root_unix_test.go \
+ cmd/cgo/internal/testsanitizers/tsan_test.go \
+ cmd/cgo/internal/testsanitizers/cshared_test.go
+
+set +u
+. ./make.bash "$@" --no-banner
+set -u
+`;
+ check = "bash run.bash --no-rebuild\n";
+ install = `
+../bin/go tool dist banner # print build info
+
+mkdir /work/system/bin
+ln -s \
+ ../go/bin/go \
+ ../go/bin/gofmt \
+ /work/system/bin
+`;
+ };
+
+ inputs = [ bash, go-bootstrap ];
+}