internal/rosa: flags for toolchain-dependent artifact
All checks were successful
Test / Create distribution (push) Successful in 1m1s
Test / Sandbox (push) Successful in 2m42s
Test / Hakurei (push) Successful in 4m1s
Test / ShareFS (push) Successful in 4m1s
Test / Hpkg (push) Successful in 4m32s
Test / Sandbox (race detector) (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 6m14s
Test / Flake checks (push) Successful in 1m49s

This is much cleaner to add extra flags to.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-29 20:41:38 +09:00
parent 6c1e2f10a7
commit 9d9b7294a4
29 changed files with 65 additions and 55 deletions

View File

@@ -175,10 +175,15 @@ func fixupEnviron(env, extras []string, paths ...string) []string {
// build script under.
var absCureScript = fhs.AbsUsrBin.Append(".cure-script")
const (
// TExclusive denotes an exclusive [pkg.Artifact].
TExclusive = 1 << iota
)
// New returns a [pkg.Artifact] compiled on this toolchain.
func (t Toolchain) New(
name string,
exclusive bool,
flag int,
extra []pkg.Artifact,
checksum *pkg.Checksum,
env []string,
@@ -219,7 +224,7 @@ func (t Toolchain) New(
args[0] = "bash"
support = slices.Concat([]pkg.Artifact{
cureEtc{},
toolchainBusybox.New("stage3-"+version, false, nil, nil, nil, `
toolchainBusybox.New("stage3-"+version, 0, nil, nil, nil, `
tar -C /work -xf /usr/src/stage3.tar.xz
rm -rf /work/dev/ /work/proc/
ln -vs ../usr/bin /work/bin
@@ -272,7 +277,7 @@ ln -vs ../usr/bin /work/bin
}
return pkg.NewExec(
name, checksum, pkg.ExecTimeoutMax, exclusive,
name, checksum, pkg.ExecTimeoutMax, flag&TExclusive != 0,
fhs.AbsRoot, env,
path, args,
@@ -321,7 +326,7 @@ cat /usr/src/` + name + `-patches/* | \
`
aname += "-patched"
}
return t.New(aname, false, stage3Concat(t, []pkg.Artifact{},
return t.New(aname, 0, stage3Concat(t, []pkg.Artifact{},
t.Load(Patch),
), nil, nil, script, paths...)
}