internal/rosa: optionally block packages from early stages
Test / Create distribution (push) Successful in 53s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m46s
Test / Sandbox (race detector) (push) Successful in 5m49s
Test / Hakurei (race detector) (push) Successful in 7m6s
Test / ShareFS (push) Successful in 7m33s
Test / Flake checks (push) Successful in 1m13s
Test / Create distribution (push) Successful in 53s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m46s
Test / Sandbox (race detector) (push) Successful in 5m49s
Test / Hakurei (race detector) (push) Successful in 7m6s
Test / ShareFS (push) Successful in 7m33s
Test / Flake checks (push) Successful in 1m13s
This helps avoid inadvertently increasing bootstrap input count. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -3,6 +3,9 @@ package python {
|
||||
website = "https://www.python.org";
|
||||
anitya = 13254;
|
||||
|
||||
// too many inputs; early variant available
|
||||
bootstrap = false;
|
||||
|
||||
version# = "3.14.7";
|
||||
source = remoteTar {
|
||||
url = "https://www.python.org/ftp/python/"+version+
|
||||
|
||||
@@ -320,6 +320,8 @@ type PackageAttr struct {
|
||||
// Whether to replace /usr/bin/ with a symlink to /bin/.
|
||||
PopulateUsrBin bool
|
||||
|
||||
// Whether this package is disallowed from bootstrap stages.
|
||||
Std bool
|
||||
// Hint for an early variant of toybox to be used when available.
|
||||
Early bool
|
||||
// Whether to omit output colour environment variables.
|
||||
@@ -375,6 +377,14 @@ func (t Toolchain) Append(a []pkg.Artifact, handles ...ArtifactH) []pkg.Artifact
|
||||
return a
|
||||
}
|
||||
|
||||
// A BootstrapError describes a package disallowed from bootstrap stages.
|
||||
type BootstrapError string
|
||||
|
||||
func (e BootstrapError) Error() string {
|
||||
return "package " + strconv.Quote(string(e)) +
|
||||
" must not be built by bootstrap stages"
|
||||
}
|
||||
|
||||
// New constructs a [pkg.Artifact] via a build system helper.
|
||||
func (t Toolchain) New(
|
||||
name, version string,
|
||||
@@ -387,6 +397,10 @@ func (t Toolchain) New(
|
||||
attr = new(PackageAttr)
|
||||
}
|
||||
|
||||
if attr.Std && !t.stage.isStd() {
|
||||
panic(BootstrapError(name))
|
||||
}
|
||||
|
||||
if name == "" || version == "" {
|
||||
panic("name must be non-empty")
|
||||
}
|
||||
|
||||
@@ -998,6 +998,8 @@ func (ctx *evalContext) pf(
|
||||
overlay string
|
||||
|
||||
inputs, runtimes, extra azalea.Array
|
||||
|
||||
bootstrap = true
|
||||
)
|
||||
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
||||
k("description"): &meta.Description,
|
||||
@@ -1020,6 +1022,7 @@ func (ctx *evalContext) pf(
|
||||
k("exclusive"): &attr.Exclusive,
|
||||
k("toyboxEarly"): &attr.Early,
|
||||
k("minimal"): &attr.NoToolchain,
|
||||
k("bootstrap"): &bootstrap,
|
||||
|
||||
k("checksum"): &kc,
|
||||
k("output"): &output,
|
||||
@@ -1032,6 +1035,7 @@ func (ctx *evalContext) pf(
|
||||
}); err != nil {
|
||||
return
|
||||
}
|
||||
attr.Std = !bootstrap
|
||||
var inputsH, extraH P
|
||||
if inputsH, err = toHandles(inputs); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user