forked from rosa/hakurei
Compare commits
39 Commits
bb8a80b540
...
05b79c484e
| Author | SHA1 | Date | |
|---|---|---|---|
|
05b79c484e
|
|||
|
01300f645c
|
|||
|
256fe245f7
|
|||
|
27e1fdbefb
|
|||
|
96df793bba
|
|||
|
9ba3f99eb9
|
|||
|
f9a3f47cda
|
|||
|
ef90d069d4
|
|||
|
c14d1bcf74
|
|||
|
b056707d32
|
|||
|
83c7b73882
|
|||
|
c9108505eb
|
|||
|
5b24dec9ad
|
|||
|
2a515fc698
|
|||
|
158a248322
|
|||
|
e9372c4504
|
|||
|
015050c172
|
|||
|
148bd29cb9
|
|||
|
6a4dd8b2c8
|
|||
|
18616e11c2
|
|||
|
d9a925e0e0
|
|||
|
24ed43726d
|
|||
|
bb0a1c4ea7
|
|||
|
b3ed0dae02
|
|||
|
0d42eaff03
|
|||
|
166ff8379d
|
|||
|
f5f8dc5a58
|
|||
|
67f61a8758
|
|||
|
7b0c1f735a
|
|||
|
e22fc80cea
|
|||
|
4ade2e5de9
|
|||
|
9737d14ff3
|
|||
|
d1d2dc6461
|
|||
|
9907458e5c
|
|||
|
73af5930c9
|
|||
|
172c8a2a66
|
|||
|
aade65f826
|
|||
|
fb3a289e06
|
|||
|
5fe0b2fa74
|
@@ -136,17 +136,7 @@ func main() {
|
|||||||
c.NewCommand(
|
c.NewCommand(
|
||||||
"checksum", "Compute checksum of data read from standard input",
|
"checksum", "Compute checksum of data read from standard input",
|
||||||
func([]string) error {
|
func([]string) error {
|
||||||
done := make(chan struct{})
|
go func() { <-ctx.Done(); os.Exit(1) }()
|
||||||
defer close(done)
|
|
||||||
go func() {
|
|
||||||
select {
|
|
||||||
case <-ctx.Done():
|
|
||||||
os.Exit(1)
|
|
||||||
case <-done:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
h := sha512.New384()
|
h := sha512.New384()
|
||||||
if _, err := io.Copy(h, os.Stdin); err != nil {
|
if _, err := io.Copy(h, os.Stdin); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net"
|
|
||||||
"os"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"hakurei.app/internal/rosa"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
rosa.DropCaches(rosa.OptLLVMNoLTO)
|
|
||||||
os.Exit(m.Run())
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCureAll(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
const env = "ROSA_TEST_DAEMON"
|
|
||||||
|
|
||||||
if !testing.Verbose() {
|
|
||||||
t.Skip("verbose flag not set")
|
|
||||||
}
|
|
||||||
|
|
||||||
pathname, ok := os.LookupEnv(env)
|
|
||||||
if !ok {
|
|
||||||
t.Skip(env + " not set")
|
|
||||||
}
|
|
||||||
|
|
||||||
addr := net.UnixAddr{Net: "unix", Name: pathname}
|
|
||||||
t.Cleanup(func() {
|
|
||||||
if t.Failed() {
|
|
||||||
if err := abortRemote(t.Context(), &addr, false); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
for i := range rosa.PresetEnd {
|
|
||||||
p := rosa.PArtifact(i)
|
|
||||||
t.Run(rosa.GetMetadata(p).Name, func(t *testing.T) {
|
|
||||||
_, err := cureRemote(t.Context(), &addr, rosa.Std.Load(p), 0)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,39 +2,10 @@ package rosa
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"slices"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"hakurei.app/internal/pkg"
|
"hakurei.app/internal/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// skipGNUTests generates a string for skipping specific tests by number in a
|
|
||||||
// GNU test suite. This is nontrivial because the test suite does not support
|
|
||||||
// excluding tests in any way, so ranges for all but the skipped tests have to
|
|
||||||
// be specified instead.
|
|
||||||
//
|
|
||||||
// For example, to skip test 764, ranges around the skipped test must be
|
|
||||||
// specified:
|
|
||||||
//
|
|
||||||
// 1-763 765-
|
|
||||||
//
|
|
||||||
// Tests are numbered starting from 1. The resulting string is unquoted.
|
|
||||||
func skipGNUTests(tests ...int) string {
|
|
||||||
tests = slices.Clone(tests)
|
|
||||||
slices.Sort(tests)
|
|
||||||
|
|
||||||
var buf strings.Builder
|
|
||||||
buf.WriteString("1-")
|
|
||||||
for _, n := range tests {
|
|
||||||
buf.WriteString(strconv.Itoa(n - 1))
|
|
||||||
buf.WriteString(" ")
|
|
||||||
buf.WriteString(strconv.Itoa(n + 1))
|
|
||||||
buf.WriteString("-")
|
|
||||||
}
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t Toolchain) newM4() (pkg.Artifact, string) {
|
func (t Toolchain) newM4() (pkg.Artifact, string) {
|
||||||
const (
|
const (
|
||||||
version = "1.4.21"
|
version = "1.4.21"
|
||||||
@@ -76,15 +47,7 @@ func (t Toolchain) newBison() (pkg.Artifact, string) {
|
|||||||
"https://ftpmirror.gnu.org/gnu/bison/bison-"+version+".tar.gz",
|
"https://ftpmirror.gnu.org/gnu/bison/bison-"+version+".tar.gz",
|
||||||
checksum,
|
checksum,
|
||||||
pkg.TarGzip,
|
pkg.TarGzip,
|
||||||
), nil, &MakeHelper{
|
), nil, (*MakeHelper)(nil),
|
||||||
Check: []string{
|
|
||||||
"TESTSUITEFLAGS=" + jobsFlagE + "' " + skipGNUTests(
|
|
||||||
// clang miscompiles (SIGILL)
|
|
||||||
764,
|
|
||||||
) + "'",
|
|
||||||
"check",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
M4,
|
M4,
|
||||||
Diffutils,
|
Diffutils,
|
||||||
Sed,
|
Sed,
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package rosa
|
|
||||||
|
|
||||||
import (
|
|
||||||
"slices"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestSkipGNUTests(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
testCases := []struct {
|
|
||||||
tests []int
|
|
||||||
want string
|
|
||||||
}{
|
|
||||||
{[]int{764}, "1-763 765-"},
|
|
||||||
{[]int{764, 0xcafe, 37, 9}, "1-8 10-36 38-763 765-51965 51967-"},
|
|
||||||
}
|
|
||||||
for _, tc := range testCases {
|
|
||||||
t.Run(strings.Join(slices.Collect(func(yield func(string) bool) {
|
|
||||||
for _, n := range tc.tests {
|
|
||||||
yield(strconv.Itoa(n))
|
|
||||||
}
|
|
||||||
}), ","), func(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
if got := skipGNUTests(tc.tests...); got != tc.want {
|
|
||||||
t.Errorf("skipGNUTests: %q, want %q", got, tc.want)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,9 +10,9 @@ import (
|
|||||||
// newGoBootstrap returns the Go bootstrap toolchain.
|
// newGoBootstrap returns the Go bootstrap toolchain.
|
||||||
func (t Toolchain) newGoBootstrap() pkg.Artifact {
|
func (t Toolchain) newGoBootstrap() pkg.Artifact {
|
||||||
const checksum = "8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23"
|
const checksum = "8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23"
|
||||||
return t.New("go1.4-bootstrap", 0, t.AppendPresets(nil,
|
return t.New("go1.4-bootstrap", 0, []pkg.Artifact{
|
||||||
Bash,
|
t.Load(Bash),
|
||||||
), nil, []string{
|
}, nil, []string{
|
||||||
"CGO_ENABLED=0",
|
"CGO_ENABLED=0",
|
||||||
}, `
|
}, `
|
||||||
mkdir -p /var/tmp/ /work/system/
|
mkdir -p /var/tmp/ /work/system/
|
||||||
@@ -35,9 +35,9 @@ func (t Toolchain) newGo(
|
|||||||
script string,
|
script string,
|
||||||
extra ...pkg.Artifact,
|
extra ...pkg.Artifact,
|
||||||
) pkg.Artifact {
|
) pkg.Artifact {
|
||||||
return t.New("go"+version, 0, t.AppendPresets(extra,
|
return t.New("go"+version, 0, slices.Concat([]pkg.Artifact{
|
||||||
Bash,
|
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",
|
||||||
@@ -127,8 +127,8 @@ sed -i \
|
|||||||
)
|
)
|
||||||
|
|
||||||
go125 := t.newGo(
|
go125 := t.newGo(
|
||||||
"1.25.9",
|
"1.25.7",
|
||||||
"gShJb9uOMk5AxqPSwvn53ZO56S6PyP6nfojzrHUiJ3krAvrgjJpYa6-DPA-jxbpN",
|
"fyylHdBVRUobnBjYj3NKBaYPUw3kGmo2mEELiZonOYurPfbarNU1x77B99Fjut7Q",
|
||||||
[]string{"CGO_ENABLED=0"}, `
|
[]string{"CGO_ENABLED=0"}, `
|
||||||
sed -i \
|
sed -i \
|
||||||
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
|
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
|
||||||
@@ -156,9 +156,7 @@ sed -i \
|
|||||||
internal/runtime/gc/scan/scan_amd64.go
|
internal/runtime/gc/scan/scan_amd64.go
|
||||||
|
|
||||||
rm \
|
rm \
|
||||||
os/root_unix_test.go \
|
os/root_unix_test.go
|
||||||
cmd/cgo/internal/testsanitizers/tsan_test.go \
|
|
||||||
cmd/cgo/internal/testsanitizers/cshared_test.go
|
|
||||||
`, go125,
|
`, go125,
|
||||||
), version
|
), version
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
rosa.DropCaches(rosa.OptLLVMNoLTO)
|
|
||||||
container.TryArgv0(nil)
|
container.TryArgv0(nil)
|
||||||
|
|
||||||
code := m.Run()
|
code := m.Run()
|
||||||
|
|||||||
@@ -27,14 +27,8 @@ chmod -R +w ..
|
|||||||
sed -i \
|
sed -i \
|
||||||
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
|
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
|
||||||
cmd/link/internal/`+runtime.GOARCH+`/obj.go
|
cmd/link/internal/`+runtime.GOARCH+`/obj.go
|
||||||
sed -i \
|
|
||||||
's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \
|
|
||||||
internal/runtime/gc/scan/scan_amd64.go
|
|
||||||
|
|
||||||
rm \
|
rm \
|
||||||
os/root_unix_test.go \
|
os/root_unix_test.go
|
||||||
cmd/cgo/internal/testsanitizers/tsan_test.go \
|
|
||||||
cmd/cgo/internal/testsanitizers/cshared_test.go
|
|
||||||
|
|
||||||
./all.bash
|
./all.bash
|
||||||
`, pkg.Path(AbsUsrSrc.Append("tamago"), false, newFromGitHub(
|
`, pkg.Path(AbsUsrSrc.Append("tamago"), false, newFromGitHub(
|
||||||
|
|||||||
Reference in New Issue
Block a user