internal/rosa/make: split build and check
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m41s
Test / Hakurei (push) Successful in 3m53s
Test / ShareFS (push) Successful in 3m57s
Test / Hpkg (push) Successful in 4m28s
Test / Sandbox (race detector) (push) Successful in 5m5s
Test / Hakurei (race detector) (push) Successful in 6m9s
Test / Flake checks (push) Successful in 2m26s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m41s
Test / Hakurei (push) Successful in 3m53s
Test / ShareFS (push) Successful in 3m57s
Test / Hpkg (push) Successful in 4m28s
Test / Sandbox (race detector) (push) Successful in 5m5s
Test / Hakurei (race detector) (push) Successful in 6m9s
Test / Flake checks (push) Successful in 2m26s
Doing these together breaks far too many buggy makefiles. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -24,14 +24,13 @@ func (t Toolchain) newCMake() pkg.Artifact {
|
||||
), &MakeAttr{
|
||||
OmitDefaults: true,
|
||||
|
||||
SkipConfigure: true,
|
||||
ScriptConfigured: `
|
||||
/usr/src/cmake/bootstrap \
|
||||
--prefix=/system \
|
||||
--parallel="$(nproc)" \
|
||||
-- \
|
||||
-DCMAKE_USE_OPENSSL=OFF
|
||||
`,
|
||||
ConfigureName: "/usr/src/cmake/bootstrap",
|
||||
Configure: [][2]string{
|
||||
{"prefix", "/system"},
|
||||
{"parallel", `"$(nproc)"`},
|
||||
{"--"},
|
||||
{"-DCMAKE_USE_OPENSSL", "OFF"},
|
||||
},
|
||||
SkipCheck: true,
|
||||
},
|
||||
t.Load(KernelHeaders),
|
||||
|
||||
@@ -19,9 +19,6 @@ func (t Toolchain) newCurl() pkg.Artifact {
|
||||
{"with-openssl"},
|
||||
{"with-ca-bundle", "/system/etc/ssl/certs/ca-bundle.crt"},
|
||||
},
|
||||
ScriptConfigured: `
|
||||
make "-j$(nproc)"
|
||||
`,
|
||||
},
|
||||
t.Load(Perl),
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package rosa
|
||||
|
||||
import (
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
import "hakurei.app/internal/pkg"
|
||||
|
||||
func (t Toolchain) newGit() pkg.Artifact {
|
||||
const (
|
||||
@@ -21,20 +19,14 @@ func (t Toolchain) newGit() pkg.Artifact {
|
||||
Writable: true,
|
||||
InPlace: true,
|
||||
|
||||
// test suite in subdirectory
|
||||
SkipCheck: true,
|
||||
|
||||
Make: []string{"all"},
|
||||
ScriptEarly: `
|
||||
cd /usr/src/git
|
||||
|
||||
make configure
|
||||
`,
|
||||
Script: `
|
||||
ln -s ../../system/bin/perl /usr/bin/ || true
|
||||
|
||||
function disable_test {
|
||||
local test=$1 pattern=$2
|
||||
local test=$1 pattern=${2:-''}
|
||||
if [ $# -eq 1 ]; then
|
||||
rm "t/${test}.sh"
|
||||
else
|
||||
@@ -56,12 +48,12 @@ disable_test t9300-fast-import
|
||||
disable_test t0211-trace2-perf
|
||||
disable_test t1517-outside-repo
|
||||
disable_test t2200-add-update
|
||||
|
||||
make \
|
||||
-C t \
|
||||
GIT_PROVE_OPTS="--jobs 32 --failures" \
|
||||
prove
|
||||
`,
|
||||
Check: []string{
|
||||
"-C t",
|
||||
`GIT_PROVE_OPTS="--jobs 32 --failures"`,
|
||||
"prove",
|
||||
},
|
||||
},
|
||||
t.Load(Perl),
|
||||
t.Load(Diffutils),
|
||||
|
||||
@@ -65,8 +65,9 @@ func (t Toolchain) newAutoconf() pkg.Artifact {
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), &MakeAttr{
|
||||
Make: []string{
|
||||
Check: []string{
|
||||
`TESTSUITEFLAGS="-j$(nproc)"`,
|
||||
"check",
|
||||
},
|
||||
Flag: TExclusive,
|
||||
},
|
||||
@@ -122,8 +123,9 @@ func (t Toolchain) newLibtool() pkg.Artifact {
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), &MakeAttr{
|
||||
Make: []string{
|
||||
`TESTSUITEFLAGS=32`,
|
||||
Check: []string{
|
||||
`TESTSUITEFLAGS="-j$(nproc)"`,
|
||||
"check",
|
||||
},
|
||||
},
|
||||
t.Load(M4),
|
||||
@@ -442,8 +444,9 @@ func (t Toolchain) newTar() pkg.Artifact {
|
||||
{"without-posix-acls"},
|
||||
{"without-xattrs"},
|
||||
},
|
||||
Make: []string{
|
||||
Check: []string{
|
||||
`TESTSUITEFLAGS="-j$(nproc)"`,
|
||||
"check",
|
||||
},
|
||||
},
|
||||
t.Load(Diffutils),
|
||||
@@ -464,11 +467,7 @@ func (t Toolchain) newBinutils() pkg.Artifact {
|
||||
nil, "https://ftpmirror.gnu.org/gnu/binutils/binutils-"+version+".tar.bz2",
|
||||
mustDecode(checksum),
|
||||
pkg.TarBzip2,
|
||||
), &MakeAttr{
|
||||
ScriptConfigured: `
|
||||
make "-j$(nproc)"
|
||||
`,
|
||||
},
|
||||
), nil,
|
||||
t.Load(Bash),
|
||||
)
|
||||
}
|
||||
@@ -484,11 +483,7 @@ func (t Toolchain) newGMP() pkg.Artifact {
|
||||
"gmp-"+version+".tar.bz2",
|
||||
mustDecode(checksum),
|
||||
pkg.TarBzip2,
|
||||
), &MakeAttr{
|
||||
ScriptConfigured: `
|
||||
make "-j$(nproc)"
|
||||
`,
|
||||
},
|
||||
), nil,
|
||||
t.Load(M4),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ echo '# Building hakurei.'
|
||||
go generate -v ./...
|
||||
go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
|
||||
-buildid=
|
||||
-linkmode external
|
||||
-extldflags=-static
|
||||
-X hakurei.app/internal/info.buildVersion="$HAKUREI_VERSION"
|
||||
-X hakurei.app/internal/info.hakureiPath=/system/bin/hakurei
|
||||
|
||||
@@ -29,7 +29,7 @@ func (t Toolchain) newKernelHeaders() pkg.Artifact {
|
||||
"-f /usr/src/kernel-headers/Makefile",
|
||||
"O=/tmp/kbuild",
|
||||
"LLVM=1",
|
||||
`HOSTLDFLAGS="${LDFLAGS}"`,
|
||||
`HOSTLDFLAGS="${LDFLAGS:-''}"`,
|
||||
"INSTALL_HDR_PATH=/work/system",
|
||||
"headers_install",
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ cd /usr/src/libcap
|
||||
"CC=cc",
|
||||
"all",
|
||||
},
|
||||
CheckName: "test",
|
||||
Check: []string{"test"},
|
||||
},
|
||||
t.Load(Bash),
|
||||
t.Load(Diffutils),
|
||||
|
||||
@@ -20,9 +20,6 @@ func (t Toolchain) newLibgd() pkg.Artifact {
|
||||
ScriptEarly: `
|
||||
mkdir /dev/shm/gd
|
||||
`,
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
},
|
||||
t.Load(Zlib),
|
||||
)
|
||||
|
||||
@@ -19,9 +19,6 @@ func (t Toolchain) newLibseccomp() pkg.Artifact {
|
||||
ScriptEarly: `
|
||||
ln -s ../system/bin/bash /bin/
|
||||
`,
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
},
|
||||
t.Load(Bash),
|
||||
t.Load(Diffutils),
|
||||
|
||||
@@ -22,9 +22,6 @@ cd /usr/src/
|
||||
tar xf libxml2.tar.xz
|
||||
mv libxml2-` + version + ` libxml2
|
||||
`,
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
SourceSuffix: ".tar.xz",
|
||||
},
|
||||
t.Load(Diffutils),
|
||||
|
||||
@@ -22,9 +22,6 @@ cd /usr/src/
|
||||
tar xf libxslt.tar.xz
|
||||
mv libxslt-` + version + ` libxslt
|
||||
`,
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
SourceSuffix: ".tar.xz",
|
||||
|
||||
// python libxml2 cyclic dependency
|
||||
|
||||
@@ -45,6 +45,8 @@ type MakeAttr struct {
|
||||
ScriptEarly string
|
||||
// Runs after configure.
|
||||
ScriptConfigured string
|
||||
// Runs before check.
|
||||
ScriptCheckEarly string
|
||||
// Runs after install.
|
||||
Script string
|
||||
|
||||
@@ -66,7 +68,7 @@ type MakeAttr struct {
|
||||
// Whether to skip the check target.
|
||||
SkipCheck bool
|
||||
// Name of the check target, zero value is equivalent to "check".
|
||||
CheckName string
|
||||
Check []string
|
||||
// Replaces the default install command.
|
||||
ScriptInstall string
|
||||
|
||||
@@ -93,31 +95,30 @@ func (t Toolchain) NewViaMake(
|
||||
attr = new(MakeAttr)
|
||||
}
|
||||
|
||||
host := `"${ROSA_TRIPLE}"`
|
||||
if attr.Host != "" {
|
||||
host = attr.Host
|
||||
}
|
||||
build := `"${ROSA_TRIPLE}"`
|
||||
if attr.Build != "" {
|
||||
build = attr.Build
|
||||
}
|
||||
|
||||
var configure string
|
||||
if !attr.SkipConfigure {
|
||||
configure = attr.ConfigureName
|
||||
if configure == "" {
|
||||
configure += `
|
||||
/usr/src/` + name + `/configure \
|
||||
configure += `/usr/src/` + name + `/configure \
|
||||
--prefix=/system`
|
||||
}
|
||||
|
||||
if attr.Host != `""` {
|
||||
configure += ` \
|
||||
host := `"${ROSA_TRIPLE}"`
|
||||
if attr.Host != "" {
|
||||
host = attr.Host
|
||||
}
|
||||
if attr.Host != `""` {
|
||||
configure += ` \
|
||||
--host=` + host
|
||||
}
|
||||
if attr.Build != `""` {
|
||||
configure += ` \
|
||||
}
|
||||
|
||||
build := `"${ROSA_TRIPLE}"`
|
||||
if attr.Build != "" {
|
||||
build = attr.Build
|
||||
}
|
||||
if attr.Build != `""` {
|
||||
configure += ` \
|
||||
--build=` + build
|
||||
}
|
||||
}
|
||||
|
||||
if len(attr.Configure) > 0 {
|
||||
@@ -149,17 +150,25 @@ func (t Toolchain) NewViaMake(
|
||||
}
|
||||
}
|
||||
|
||||
makeTargets := make([]string, 1, 2+len(attr.Make))
|
||||
if !attr.SkipCheck {
|
||||
if attr.CheckName == "" {
|
||||
makeTargets = append(makeTargets, "check")
|
||||
} else {
|
||||
makeTargets = append(makeTargets, attr.CheckName)
|
||||
}
|
||||
scriptMake := `
|
||||
make \
|
||||
"-j$(nproc)"`
|
||||
if len(attr.Make) > 0 {
|
||||
scriptMake += " \\\n\t" + strings.Join(attr.Make, " \\\n\t")
|
||||
}
|
||||
makeTargets = append(makeTargets, attr.Make...)
|
||||
if len(makeTargets) == 1 {
|
||||
makeTargets = nil
|
||||
scriptMake += "\n"
|
||||
|
||||
if !attr.SkipCheck {
|
||||
scriptMake += attr.ScriptCheckEarly + `
|
||||
make \
|
||||
"-j$(nproc)" \
|
||||
`
|
||||
if len(attr.Check) > 0 {
|
||||
scriptMake += strings.Join(attr.Check, " \\\n\t")
|
||||
} else {
|
||||
scriptMake += "check"
|
||||
}
|
||||
scriptMake += "\n"
|
||||
}
|
||||
|
||||
var finalExtra []pkg.Artifact
|
||||
@@ -176,7 +185,9 @@ func (t Toolchain) NewViaMake(
|
||||
|
||||
scriptEarly := attr.ScriptEarly
|
||||
if !attr.InPlace {
|
||||
scriptEarly += "\ncd \"$(mktemp -d)\""
|
||||
scriptEarly += `
|
||||
cd "$(mktemp -d)"
|
||||
`
|
||||
} else if scriptEarly == "" {
|
||||
panic("cannot remain in root")
|
||||
}
|
||||
@@ -187,14 +198,25 @@ func (t Toolchain) NewViaMake(
|
||||
}
|
||||
scriptInstall += "\n"
|
||||
|
||||
return t.New(name+"-"+version, attr.Flag, stage0Concat(t,
|
||||
attr.NonStage0,
|
||||
finalExtra...,
|
||||
), nil, attr.Env, scriptEarly+configure+attr.ScriptConfigured+`
|
||||
make "-j$(nproc)"`+strings.Join(makeTargets, " ")+`
|
||||
`+scriptInstall+attr.Script, slices.Concat(attr.Paths, []pkg.ExecPath{
|
||||
pkg.Path(AbsUsrSrc.Append(
|
||||
name+attr.SourceSuffix,
|
||||
), attr.Writable, source),
|
||||
})...)
|
||||
return t.New(
|
||||
name+"-"+version,
|
||||
attr.Flag,
|
||||
stage0Concat(t,
|
||||
attr.NonStage0,
|
||||
finalExtra...,
|
||||
),
|
||||
nil,
|
||||
attr.Env,
|
||||
scriptEarly+
|
||||
configure+
|
||||
attr.ScriptConfigured+
|
||||
scriptMake+
|
||||
scriptInstall+
|
||||
attr.Script,
|
||||
slices.Concat(attr.Paths, []pkg.ExecPath{
|
||||
pkg.Path(AbsUsrSrc.Append(
|
||||
name+attr.SourceSuffix,
|
||||
), attr.Writable, source),
|
||||
})...,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -13,24 +13,24 @@ func (t Toolchain) newOpenSSL() pkg.Artifact {
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), &MakeAttr{
|
||||
OmitDefaults: true,
|
||||
SkipConfigure: true,
|
||||
OmitDefaults: true,
|
||||
|
||||
Env: []string{
|
||||
"CC=cc",
|
||||
},
|
||||
ScriptConfigured: `
|
||||
/usr/src/openssl/Configure \
|
||||
--prefix=/system \
|
||||
--libdir=lib \
|
||||
--openssldir=etc/ssl
|
||||
`,
|
||||
CheckName: "test",
|
||||
Make: []string{
|
||||
ConfigureName: "/usr/src/openssl/Configure",
|
||||
Configure: [][2]string{
|
||||
{"prefix", "/system"},
|
||||
{"libdir", "lib"},
|
||||
{"openssldir", "etc/ssl"},
|
||||
},
|
||||
Check: []string{
|
||||
`HARNESS_JOBS="$(expr "$(nproc)" '*' 2)"`,
|
||||
"test",
|
||||
},
|
||||
},
|
||||
t.Load(Perl),
|
||||
t.Load(Coreutils),
|
||||
|
||||
t.Load(Zlib),
|
||||
t.Load(KernelHeaders),
|
||||
|
||||
@@ -29,8 +29,6 @@ echo 'print STDOUT "1..0 # Skip broken test\n";' > ext/Pod-Html/t/htmldir3.t
|
||||
rm -f /system/bin/ps # perl does not like toybox ps
|
||||
`,
|
||||
ConfigureName: "./Configure",
|
||||
Host: `""`,
|
||||
Build: `""`,
|
||||
Configure: [][2]string{
|
||||
{"-des"},
|
||||
{"Dprefix", "/system"},
|
||||
@@ -40,7 +38,10 @@ rm -f /system/bin/ps # perl does not like toybox ps
|
||||
{"Doptimize", "'-O2 -fno-strict-aliasing'"},
|
||||
{"Duseithreads"},
|
||||
},
|
||||
CheckName: "TEST_JOBS=256 test_harness",
|
||||
Check: []string{
|
||||
"TEST_JOBS=256",
|
||||
"test_harness",
|
||||
},
|
||||
ScriptInstall: "./perl -Ilib -I. installperl --destdir=/work",
|
||||
|
||||
Flag: TEarly,
|
||||
@@ -95,16 +96,18 @@ func (t Toolchain) newViaPerlMakeMaker(
|
||||
return t.NewViaMake("perl-"+name, version, t.NewPatchedSource(
|
||||
"perl-"+name, version, source, false, patches...,
|
||||
), &MakeAttr{
|
||||
Writable: true,
|
||||
OmitDefaults: true,
|
||||
SkipConfigure: true,
|
||||
InPlace: true,
|
||||
Writable: true,
|
||||
OmitDefaults: true,
|
||||
InPlace: true,
|
||||
|
||||
ScriptEarly: `
|
||||
cd /usr/src/perl-` + name + `
|
||||
perl Makefile.PL PREFIX=/system
|
||||
`,
|
||||
CheckName: "test",
|
||||
ConfigureName: "perl Makefile.PL",
|
||||
Configure: [][2]string{
|
||||
{"PREFIX", "/system"},
|
||||
},
|
||||
Check: []string{"test"},
|
||||
}, slices.Concat(extra, []pkg.Artifact{
|
||||
t.Load(Perl),
|
||||
})...)
|
||||
|
||||
@@ -48,12 +48,7 @@ func (t Toolchain) newPython() pkg.Artifact {
|
||||
"LDFLAGS=-Wl,--dynamic-linker=/system/lib/" +
|
||||
"ld-musl-" + linuxArch() + ".so.1",
|
||||
},
|
||||
|
||||
ScriptEarly: `
|
||||
export HOME="$(mktemp -d)"
|
||||
`,
|
||||
|
||||
CheckName: "test",
|
||||
Check: []string{"test"},
|
||||
},
|
||||
t.Load(Zlib),
|
||||
t.Load(Libffi),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package rosa
|
||||
|
||||
import (
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
import "hakurei.app/internal/pkg"
|
||||
|
||||
func (t Toolchain) newQEMU() pkg.Artifact {
|
||||
const (
|
||||
@@ -57,7 +55,6 @@ _notrun 'appears to spuriously fail on zfs'
|
||||
EOF
|
||||
)
|
||||
`,
|
||||
|
||||
Configure: [][2]string{
|
||||
{"disable-download"},
|
||||
{"disable-docs"},
|
||||
@@ -70,10 +67,6 @@ EOF
|
||||
"ppc-softmmu," +
|
||||
"ppc64-softmmu"},
|
||||
},
|
||||
|
||||
ScriptConfigured: `
|
||||
make "-j$(nproc)"
|
||||
`,
|
||||
},
|
||||
t.Load(Bash),
|
||||
t.Load(Python),
|
||||
|
||||
@@ -19,7 +19,7 @@ func (t Toolchain) newToybox(suffix, script string) pkg.Artifact {
|
||||
SkipConfigure: true,
|
||||
|
||||
ScriptEarly: `
|
||||
LDFLAGS="${LDFLAGS} -static"
|
||||
LDFLAGS="${LDFLAGS:-''} -static"
|
||||
|
||||
chmod +w /bin/
|
||||
ln -rs "$(which bash)" /bin/ || true
|
||||
@@ -37,13 +37,14 @@ make defconfig
|
||||
sed -i \
|
||||
's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \
|
||||
.config
|
||||
|
||||
make "-j$(nproc)"
|
||||
`,
|
||||
ScriptConfigured: script,
|
||||
CheckName: "USER=cure tests",
|
||||
SkipCheck: t.isStage0(),
|
||||
ScriptInstall: "PREFIX=/work/system/bin make install_flat",
|
||||
Check: []string{
|
||||
"USER=cure",
|
||||
"tests",
|
||||
},
|
||||
ScriptInstall: "PREFIX=/work/system/bin make install_flat",
|
||||
Script: `
|
||||
mkdir -p /work/usr/bin
|
||||
ln -s ../../system/bin/env /work/usr/bin
|
||||
|
||||
@@ -64,10 +64,6 @@ func (t Toolchain) newLibXau() pkg.Artifact {
|
||||
cd /usr/src/libXau
|
||||
autoreconf -if
|
||||
`,
|
||||
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
},
|
||||
t.Load(M4),
|
||||
t.Load(Perl),
|
||||
|
||||
@@ -11,11 +11,7 @@ func (t Toolchain) newXCBProto() pkg.Artifact {
|
||||
nil, "https://xcb.freedesktop.org/dist/xcb-proto-"+version+".tar.gz",
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), &MakeAttr{
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
},
|
||||
), nil,
|
||||
t.Load(Python),
|
||||
)
|
||||
}
|
||||
@@ -30,11 +26,7 @@ func (t Toolchain) newXCB() pkg.Artifact {
|
||||
nil, "https://xcb.freedesktop.org/dist/libxcb-"+version+".tar.gz",
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
), &MakeAttr{
|
||||
Configure: [][2]string{
|
||||
{"enable-static"},
|
||||
},
|
||||
},
|
||||
), nil,
|
||||
t.Load(Python),
|
||||
t.Load(PkgConfig),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user