From 445d95023b1d9d152417838c4edad54f7bf4efe3 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 1 May 2026 03:42:14 +0900 Subject: internal/rosa: global preset flags These changes preset behaviour globally. Useful for ad hoc workarounds for development or bootstrapping on resource-constrained systems. Signed-off-by: Ophestra --- internal/rosa/all.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'internal/rosa/all.go') diff --git a/internal/rosa/all.go b/internal/rosa/all.go index f61ec62f..fb745c0a 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -322,15 +322,29 @@ var ( } // artifactsOnce is for lazy initialisation of artifacts. artifactsOnce [_toolchainEnd][len(artifactsM)]sync.Once + + // presetOpts globally modifies behaviour of presets. + presetOpts int ) +const ( + // OptSkipCheck skips running all test suites. + OptSkipCheck = 1 << iota + // OptLLVMNoLTO disables LTO in all [LLVM] stages. + OptLLVMNoLTO +) + +// Flags returns the current preset flags +func Flags() int { return presetOpts } + // zero zeros the value pointed to by p. func zero[T any](p *T) { var v T; *p = v } // DropCaches arranges for all cached [pkg.Artifact] to be freed some time after // it returns. Must not be used concurrently with any other function from this // package. -func DropCaches() { +func DropCaches(flags int) { + presetOpts = flags zero(&artifacts) zero(&artifactsOnce) } -- cgit v1.3.1