diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-06-09 16:01:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-06-09 16:05:04 +0900 |
| commit | ce06539ecaf07b5fe572b3c190b69bd01aaa7c93 (patch) | |
| tree | 9beeac96af791049294f97a5abacdfce3567f670 /cmd | |
| parent | 69908e5a41b76e065cb08734543994a17e2053d7 (diff) | |
internal/rosa: expose supported architectures
This information is useful to external tooling and makes a lot more sense in this package than cmd/mbf. This change also fixes non-native artifact resolution during clean.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/mbf/cache.go | 22 | ||||
| -rw-r--r-- | cmd/mbf/main.go | 14 |
2 files changed, 13 insertions, 23 deletions
diff --git a/cmd/mbf/cache.go b/cmd/mbf/cache.go index b683326f..71cef98b 100644 --- a/cmd/mbf/cache.go +++ b/cmd/mbf/cache.go @@ -8,7 +8,6 @@ import ( "testing" "hakurei.app/check" - "hakurei.app/container" "hakurei.app/internal/pkg" "hakurei.app/internal/rosa" "hakurei.app/message" @@ -111,24 +110,9 @@ func (cache *cache) open() (err error) { return } - pkg.RegisterArch("riscv64", container.BinfmtEntry{ - Offset: 0, - Magic: "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00", - Mask: "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff", - Interpreter: pathname.Append( - "system/bin", - "qemu-riscv64", - ), - }) - pkg.RegisterArch("arm64", container.BinfmtEntry{ - Offset: 0, - Magic: "\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00", - Mask: "\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff", - Interpreter: pathname.Append( - "system/bin", - "qemu-aarch64", - ), - }) + for arch, entry := range rosa.Arches(pathname) { + pkg.RegisterArch(arch, entry) + } } return diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 07ce8f0e..e4c6af96 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -883,13 +883,19 @@ func main() { func([]string) error { return cm.Do(func(cache *pkg.Cache) error { t := rosa.Native().Clone().Std() - a := t.Append(nil, t.CollectAll()...) - for arch := range pkg.Arch() { + handles := t.CollectAll() + + flags := t.Flags() + a := t.Append(nil, handles...) + for arch := range rosa.Arches(nil) { if arch == runtime.GOARCH { continue } - t.DropCaches(arch, t.Flags()) - a = t.Append(a, t.CollectAll()...) + + t.DropCaches(arch, rosa.OptLLVMNoLTO|rosa.OptSkipCheck) + a = t.Append(a, handles...) + t.DropCaches(arch, flags) + a = t.Append(a, handles...) } ids, checksums, err := cache.Clean( |
