aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index f5a67a98..32c1bd00 100644
--- a/internal/rosa/rosa.go
+++ b/internal/rosa/rosa.go
@@ -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")
}