From 1d8b1807aa5a4a232f9fe81994885f05aa080ce9 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 8 Feb 2026 01:44:08 +0900 Subject: [PATCH] internal/rosa/go: alternative bootstrap path For targets where the bootstrap toolchain is not available. Signed-off-by: Ophestra --- internal/rosa/go.go | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/internal/rosa/go.go b/internal/rosa/go.go index 31417ee..74e5d29 100644 --- a/internal/rosa/go.go +++ b/internal/rosa/go.go @@ -63,18 +63,50 @@ ln -s \ } func (t Toolchain) newGoLatest() pkg.Artifact { + var ( + bootstrapEnv []string + bootstrapExtra []pkg.Artifact + ) + switch runtime.GOARCH { + case "amd64": + bootstrapExtra = append(bootstrapExtra, t.newGoBootstrap()) + + case "arm64": + bootstrapEnv = append(bootstrapEnv, + "GOROOT_BOOTSTRAP=/system", + ) + bootstrapExtra = append(bootstrapExtra, + t.Load(Binutils), + + t.Load(GMP), + t.Load(MPFR), + t.Load(MPC), + + t.Load(Zlib), + t.Load(Libucontext), + + t.Load(gcc), + ) + + default: + panic("unsupported target " + runtime.GOARCH) + } + go119 := t.newGo( "1.19", "9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro", - []string{"CGO_ENABLED=0"}, ` + append(bootstrapEnv, "CGO_ENABLED=0"), ` rm \ crypto/tls/handshake_client_test.go \ + cmd/pprof/pprof_test.go \ os/os_unix_test.go +sed -i \ + 's/os\.Getenv("GCCGO")$/"nonexistent"/' \ + go/internal/gccgoimporter/importer_test.go echo \ 'type syscallDescriptor = int' >> \ os/rawconn_test.go -`, t.newGoBootstrap(), - ) +`, bootstrapExtra...) go121 := t.newGo( "1.21.13",