diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-01 03:42:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-01 03:42:48 +0900 |
| commit | 445d95023b1d9d152417838c4edad54f7bf4efe3 (patch) | |
| tree | 95ba56140b93cc3220472f16a6c9e699d8c5a83e /internal/rosa/all.go | |
| parent | fc66f0bb47dd4634f81aa67bf8fc092945643520 (diff) | |
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/all.go')
| -rw-r--r-- | internal/rosa/all.go | 16 |
1 files changed, 15 insertions, 1 deletions
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) } |
