internal/rosa: migrate to make helper
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m43s
Test / ShareFS (push) Successful in 4m0s
Test / Hpkg (push) Successful in 4m29s
Test / Sandbox (race detector) (push) Successful in 5m6s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Hakurei (push) Successful in 2m41s
Test / Flake checks (push) Successful in 1m45s
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m43s
Test / ShareFS (push) Successful in 4m0s
Test / Hpkg (push) Successful in 4m29s
Test / Sandbox (race detector) (push) Successful in 5m6s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Hakurei (push) Successful in 2m41s
Test / Flake checks (push) Successful in 1m45s
This migrates artifacts that the helper cannot produce an identical instance of. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -21,8 +21,7 @@ cd "$(mktemp -d)"
|
||||
./build.sh
|
||||
./make DESTDIR=/work install check
|
||||
`, pkg.Path(AbsUsrSrc.Append("make"), false, pkg.NewHTTPGetTar(
|
||||
nil,
|
||||
"https://ftp.gnu.org/gnu/make/make-"+version+".tar.gz",
|
||||
nil, "https://ftp.gnu.org/gnu/make/make-"+version+".tar.gz",
|
||||
mustDecode(checksum),
|
||||
pkg.TarGzip,
|
||||
)))
|
||||
@@ -37,6 +36,8 @@ type MakeAttr struct {
|
||||
|
||||
// Do not include default extras.
|
||||
OmitDefaults bool
|
||||
// Dependencies not provided by stage3.
|
||||
NonStage3 []pkg.Artifact
|
||||
|
||||
// Additional environment variables.
|
||||
Env []string
|
||||
@@ -45,12 +46,19 @@ type MakeAttr struct {
|
||||
// Runs after cmake.
|
||||
Script string
|
||||
|
||||
// Remain in working directory set up during ScriptEarly.
|
||||
InPlace bool
|
||||
|
||||
// Flags passed to the configure script.
|
||||
Configure [][2]string
|
||||
// Extra make targets.
|
||||
Make []string
|
||||
// Target triple, zero value is equivalent to the Rosa OS triple.
|
||||
Build string
|
||||
// Whether to skip the check target.
|
||||
SkipCheck bool
|
||||
// Name of the check target, zero value is equivalent to "check".
|
||||
CheckName string
|
||||
|
||||
// Suffix appended to the source pathname.
|
||||
SourceSuffix string
|
||||
@@ -101,30 +109,50 @@ func (t Toolchain) NewViaMake(
|
||||
)
|
||||
}
|
||||
|
||||
defaults := []pkg.Artifact{
|
||||
var buildFlag string
|
||||
if attr.Build != `""` {
|
||||
buildFlag = ` \
|
||||
--build=` + build
|
||||
}
|
||||
|
||||
makeTargets := make([]string, 1, 2+len(attr.Make))
|
||||
if !attr.SkipCheck {
|
||||
if attr.CheckName == "" {
|
||||
makeTargets = append(makeTargets, "check")
|
||||
} else {
|
||||
makeTargets = append(makeTargets, attr.CheckName)
|
||||
}
|
||||
}
|
||||
makeTargets = append(makeTargets, attr.Make...)
|
||||
if len(makeTargets) == 1 {
|
||||
makeTargets = nil
|
||||
}
|
||||
|
||||
finalExtra := []pkg.Artifact{
|
||||
t.Load(Make),
|
||||
}
|
||||
if attr.OmitDefaults || attr.Flag&TEarly == 0 {
|
||||
defaults = append(defaults,
|
||||
finalExtra = append(finalExtra,
|
||||
t.Load(Gawk),
|
||||
t.Load(Coreutils),
|
||||
)
|
||||
}
|
||||
finalExtra = append(finalExtra, extra...)
|
||||
|
||||
var makeSuffix string
|
||||
if !attr.SkipCheck {
|
||||
makeSuffix += " check"
|
||||
scriptEarly := attr.ScriptEarly
|
||||
if !attr.InPlace {
|
||||
scriptEarly += "\ncd \"$(mktemp -d)\""
|
||||
} else if scriptEarly == "" {
|
||||
panic("cannot remain in root")
|
||||
}
|
||||
|
||||
return t.New(name+"-"+version, attr.Flag, stage3Concat(t,
|
||||
defaults,
|
||||
extra...,
|
||||
), nil, attr.Env, attr.ScriptEarly+`
|
||||
cd "$(mktemp -d)"
|
||||
attr.NonStage3,
|
||||
finalExtra...,
|
||||
), nil, attr.Env, scriptEarly+`
|
||||
/usr/src/`+name+`/configure \
|
||||
--prefix=/system \
|
||||
--build=`+build+configureFlags+`
|
||||
make "-j$(nproc)"`+makeSuffix+`
|
||||
--prefix=/system`+buildFlag+configureFlags+`
|
||||
make "-j$(nproc)"`+strings.Join(makeTargets, " ")+`
|
||||
make DESTDIR=/work install
|
||||
`+attr.Script, pkg.Path(AbsUsrSrc.Append(
|
||||
name+attr.SourceSuffix,
|
||||
|
||||
Reference in New Issue
Block a user