internal/rosa/go: run toolchain tests
All checks were successful
Test / Create distribution (push) Successful in 49s
Test / Sandbox (push) Successful in 2m41s
Test / ShareFS (push) Successful in 3m58s
Test / Hpkg (push) Successful in 4m33s
Test / Sandbox (race detector) (push) Successful in 4m56s
Test / Hakurei (race detector) (push) Successful in 6m5s
Test / Hakurei (push) Successful in 2m33s
Test / Flake checks (push) Successful in 1m38s

LLVM patches and a TMPDIR backed by tmpfs fixed most tests. Broken tests in older versions are disabled.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-25 19:05:07 +09:00
parent 861801597d
commit e34a59e332

View File

@@ -1,6 +1,7 @@
package rosa package rosa
import ( import (
"runtime"
"slices" "slices"
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
@@ -15,8 +16,8 @@ func (t Toolchain) newGoBootstrap() pkg.Artifact {
"CGO_ENABLED=0", "CGO_ENABLED=0",
}, ` }, `
mkdir -p /var/tmp mkdir -p /var/tmp
cp -r /usr/src/go1.4-bootstrap /work cp -r /usr/src/go /work
cd /work/go1.4-bootstrap/src cd /work/go/src
chmod -R +w .. chmod -R +w ..
ln -s ../system/bin/busybox /bin/pwd ln -s ../system/bin/busybox /bin/pwd
@@ -31,8 +32,11 @@ rm \
syscall/creds_test.go \ syscall/creds_test.go \
net/multicast_test.go net/multicast_test.go
CC="cc -Qunused-arguments ${LDFLAGS}" ./all.bash ./all.bash
`, pkg.Path(AbsUsrSrc.Append("go1.4-bootstrap"), false, pkg.NewHTTPGetTar( cd /work/
mkdir system/
mv go/ system/
`, pkg.Path(AbsUsrSrc.Append("go"), false, pkg.NewHTTPGetTar(
nil, "https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz", nil, "https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz",
mustDecode(checksum), mustDecode(checksum),
pkg.TarGzip, pkg.TarGzip,
@@ -42,22 +46,24 @@ CC="cc -Qunused-arguments ${LDFLAGS}" ./all.bash
// newGo returns a specific version of the Go toolchain. // newGo returns a specific version of the Go toolchain.
func (t Toolchain) newGo( func (t Toolchain) newGo(
version, checksum string, version, checksum string,
boot pkg.Artifact, env []string,
env ...string, script string,
extra ...pkg.Artifact,
) pkg.Artifact { ) pkg.Artifact {
return t.New("go"+version, []pkg.Artifact{ return t.New("go"+version, slices.Concat([]pkg.Artifact{
boot, t.Load(Bash),
}, nil, slices.Concat([]string{ }, extra), nil, slices.Concat([]string{
"CC=cc", "CC=cc",
"GOCACHE=/tmp/gocache", "GOCACHE=/tmp/gocache",
"GOROOT_BOOTSTRAP=/system/go", "GOROOT_BOOTSTRAP=/system/go",
"TMPDIR=/dev/shm/go",
}, env), ` }, env), `
mkdir /work/system mkdir /work/system "${TMPDIR}"
cp -r /usr/src/go /work/system cp -r /usr/src/go /work/system
cd /work/system/go/src cd /work/system/go/src
chmod -R +w .. chmod -R +w ..
sed -i 's/bash run.bash/sh run.bash/' all.bash `+script+`
sh make.bash ./all.bash
`, pkg.Path(AbsUsrSrc.Append("go"), false, pkg.NewHTTPGetTar( `, pkg.Path(AbsUsrSrc.Append("go"), false, pkg.NewHTTPGetTar(
nil, "https://go.dev/dl/go"+version+".src.tar.gz", nil, "https://go.dev/dl/go"+version+".src.tar.gz",
mustDecode(checksum), mustDecode(checksum),
@@ -69,24 +75,46 @@ func (t Toolchain) newGoLatest() pkg.Artifact {
go119 := t.newGo( go119 := t.newGo(
"1.19", "1.19",
"9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro", "9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro",
t.newGoBootstrap(), []string{"CGO_ENABLED=0"}, `
"GOROOT_BOOTSTRAP=/go1.4-bootstrap", rm \
crypto/tls/handshake_client_test.go
`, t.newGoBootstrap(),
) )
go121 := t.newGo( go121 := t.newGo(
"1.21.13", "1.21.13",
"YtrDka402BOAEwywx03Vz4QlVwoBiguJHzG7PuythMCPHXS8CVMLvzmvgEbu4Tzu", "YtrDka402BOAEwywx03Vz4QlVwoBiguJHzG7PuythMCPHXS8CVMLvzmvgEbu4Tzu",
go119, []string{"CGO_ENABLED=0"}, `
sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+runtime.GOARCH+`/obj.go
rm \
crypto/tls/handshake_client_test.go \
crypto/tls/handshake_server_test.go
`, go119,
) )
go123 := t.newGo( go123 := t.newGo(
"1.23.12", "1.23.12",
"wcI32bl1tkqbgcelGtGWPI4RtlEddd-PTd76Eb-k7nXA5LbE9yTNdIL9QSOOxMOs", "wcI32bl1tkqbgcelGtGWPI4RtlEddd-PTd76Eb-k7nXA5LbE9yTNdIL9QSOOxMOs",
go121, nil, `
sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+runtime.GOARCH+`/obj.go
`, go121,
) )
go125 := t.newGo( go125 := t.newGo(
"1.25.6", "1.25.6",
"x0z430qoDvQbbw_fftjW0rh_GSoh0VJhPzttWk_0hj9yz9AKOjuwRMupF_Q0dbt7", "x0z430qoDvQbbw_fftjW0rh_GSoh0VJhPzttWk_0hj9yz9AKOjuwRMupF_Q0dbt7",
go123, nil, `
sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+runtime.GOARCH+`/obj.go
`, go123,
) )
return go125 return go125
} }
func init() { artifactsF[Go] = Toolchain.newGoLatest } func init() { artifactsF[Go] = Toolchain.newGoLatest }