internal/rosa: remove xz utils hack
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m33s
Test / Sandbox (race detector) (push) Successful in 6m5s
Test / Hakurei (race detector) (push) Successful in 8m0s
Test / ShareFS (push) Successful in 8m32s
Test / Flake checks (push) Successful in 1m27s

This replaces all xz invocations with the native decompressor. This also significantly cleans up the Gentoo stage3 bootstrap path.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
cat
2026-07-25 14:14:34 +09:00
parent 35147f6dfb
commit 0d3efeb456
6 changed files with 131 additions and 176 deletions
+9 -6
View File
@@ -213,10 +213,8 @@ type S struct {
// Cached [pkg.Artifact].
c [_stageEnd]sync.Map
// URL of a Gentoo stage3 tarball.
gentooStage3 string
// Expected checksum of gentooStage3.
gentooStage3Checksum pkg.Checksum
// Unpacked Gentoo LLVM stage3.
gentooStage3 pkg.Artifact
}
// Clone returns a copy of s.
@@ -485,6 +483,7 @@ func (s *S) getFrame() azalea.Frame {
k("gzip"): pkg.Gzip + compressOffset,
k("bzip2"): pkg.Bzip2 + compressOffset,
k("zstd"): pkg.Zstd + compressOffset,
k("xz"): pkg.XZ + compressOffset,
}
s.frame.Val = map[unique.Handle[azalea.Ident]]any{
@@ -803,6 +802,7 @@ func (s *S) getFrame() azalea.Frame {
k("gzip"): uint32(pkg.Gzip),
k("bzip2"): uint32(pkg.Bzip2),
k("zstd"): uint32(pkg.Zstd),
k("xz"): uint32(pkg.XZ),
}},
// high-level helpers
@@ -1372,12 +1372,15 @@ func (s *S) SetSource(fsys fs.FS) error {
// SetGentooStage3 sets the Gentoo stage3 tarball url and checksum. It panics
// if given zero values or if these values have already been set.
func (s *S) SetGentooStage3(url string, checksum pkg.Checksum) {
if s.gentooStage3 != "" {
if s.gentooStage3 != nil {
panic(errors.New("attempting to set Gentoo stage3 url twice"))
}
if url == "" {
panic(errors.New("attempting to set Gentoo stage3 url to the zero value"))
}
s.gentooStage3, s.gentooStage3Checksum = url, checksum
s.gentooStage3 = pkg.NewTar(pkg.NewDecompress(
pkg.NewHTTPGet(nil, url, checksum),
pkg.XZ,
))
s.DropCaches(s.Arch(), s.Flags())
}