internal/rosa/package: migrate tamago
All checks were successful
Test / Create distribution (push) Successful in 1m6s
Test / Sandbox (push) Successful in 3m4s
Test / ShareFS (push) Successful in 4m10s
Test / Hakurei (push) Successful in 4m24s
Test / Sandbox (race detector) (push) Successful in 5m53s
Test / Hakurei (race detector) (push) Successful in 7m6s
Test / Flake checks (push) Successful in 1m46s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-21 18:47:05 +09:00
parent af4c3bbff2
commit 25d9edfc64
3 changed files with 51 additions and 50 deletions

View File

@@ -0,0 +1,50 @@
package tamago {
description = "a Go toolchain extended with support for bare metal execution";
website = "https://github.com/usbarmory/tamago-go";
anitya = 388872;
version* = "1.26.3";
source = remoteGitHub {
suffix = "usbarmory/tamago-go";
tag = "tamago-go"+version;
checksum = "-nH3MjAzDDLTeJ2hRKYJcJwo5-Ikci4zOHfB8j1vKn7zrF9TS6zYaoLi8qohGwAE";
};
env = [
"CC=cc",
"GOCACHE=/tmp/gocache",
"CGO_ENABLED=0",
];
enterSource = true;
exec = generic {
inPlace = true;
build = `
mkdir /work/system/
cp -r . /work/system/tamago
cd /work/system/tamago/src
chmod -R +w ..
sed -i \
's,/lib/ld-musl-` + linuxArch + `.so.1,/system/bin/linker,' \
cmd/link/internal/` + arch + `/obj.go
sed -i \
's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \
internal/runtime/gc/scan/scan_amd64.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";
};
inputs = [ bash, go ];
}

View File

@@ -453,6 +453,7 @@ func (s *S) getFrame() azalea.Frame {
k("unversioned"): Unversioned,
k("triple"): s.triple(),
k("arch"): s.arch,
k("linuxArch"): s.linuxArch(),
k("earlyLDFLAGS"): s.earlyLDFLAGS(false),

View File

@@ -1,50 +0,0 @@
package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newTamaGo() (pkg.Artifact, string) {
const (
version = "1.26.3"
checksum = "-nH3MjAzDDLTeJ2hRKYJcJwo5-Ikci4zOHfB8j1vKn7zrF9TS6zYaoLi8qohGwAE"
)
return t.New("tamago-go"+version, 0, t.Append(nil,
_bash,
_go,
), nil, []string{
"CC=cc",
"GOCACHE=/tmp/gocache",
"CGO_ENABLED=0",
}, `
mkdir /work/system # "${TMPDIR}"
cp -r /usr/src/tamago /work/system
cd /work/system/tamago/src
chmod -R +w ..
sed -i \
's,/lib/ld-musl-`+t.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+t.arch+`/obj.go
sed -i \
's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \
internal/runtime/gc/scan/scan_amd64.go
rm \
os/root_unix_test.go \
cmd/cgo/internal/testsanitizers/tsan_test.go \
cmd/cgo/internal/testsanitizers/cshared_test.go
./all.bash
`, pkg.Path(AbsUsrSrc.Append("tamago"), false, newFromGitHub(
"usbarmory/tamago-go",
"tamago-go"+version,
checksum,
))), version
}
func init() {
native.mustRegister(Toolchain.newTamaGo, &Metadata{
Name: "tamago",
Description: "a Go toolchain extended with support for bare metal execution",
Website: "https://github.com/usbarmory/tamago-go",
ID: 388872,
})
}