From 3a27514df88075d2f7c3b39fca02f9cd89e5e0d5 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 27 Nov 2026 13:49:03 +0900 Subject: internal/rosa: optionally reject cross-compilation This provides a generic way for any package to reject cross-compilation without going through its helper. Signed-off-by: Ophestra --- internal/rosa/rosa.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/rosa/rosa.go') diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 3d4914f2..ac6648ab 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -375,6 +375,8 @@ type PackageAttr struct { // Whether to create [pkg.KindExecNet] instead of [pkg.KindExec]. HostNet bool + // Whether cross-compilation is broken. + RejectCross bool // Whether the [Helper] behaves identically across all architectures. NoArch bool // Whether libc can be omitted. @@ -495,6 +497,10 @@ func (t Toolchain) New( cross := t.cross() var rootCross []pkg.Artifact if cross { + if attr.RejectCross { + panic(CrossError(name)) + } + rootCross = make([]pkg.Artifact, 0, 1+len(inputs)+len(attr.Cross)) } -- cgit v1.3.1