internal/pkg: remove tar built-in decompressor
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 5m13s
Test / Hakurei (push) Successful in 7m56s
Test / ShareFS (push) Successful in 7m57s
Test / Hakurei (race detector) (push) Successful in 10m12s
Test / Sandbox (race detector) (push) Successful in 3m3s
Test / Flake checks (push) Successful in 1m47s
All checks were successful
Test / Create distribution (push) Successful in 1m30s
Test / Sandbox (push) Successful in 5m13s
Test / Hakurei (push) Successful in 7m56s
Test / ShareFS (push) Successful in 7m57s
Test / Hakurei (race detector) (push) Successful in 10m12s
Test / Sandbox (race detector) (push) Successful in 3m3s
Test / Flake checks (push) Successful in 1m47s
This is replaced by decompressArtifact and is no longer necessary. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -21,8 +21,13 @@ const (
|
||||
)
|
||||
|
||||
// newTar wraps [pkg.NewHTTPGetTar] with a simpler function signature.
|
||||
func newTar(url, checksum string, compression uint32) pkg.Artifact {
|
||||
return pkg.NewHTTPGetTar(nil, url, mustDecode(checksum), compression)
|
||||
func newTar(url, checksum string, compress uint32) pkg.Artifact {
|
||||
return pkg.NewTar(
|
||||
pkg.NewDecompress(
|
||||
pkg.NewHTTPGet(nil, url, mustDecode(checksum)),
|
||||
compress,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
// newFromCPAN is a helper for downloading release from CPAN.
|
||||
@@ -32,7 +37,7 @@ func newFromCPAN(author, name, version, checksum string) pkg.Artifact {
|
||||
author[:1]+"/"+author[:2]+"/"+author+"/"+
|
||||
name+"-"+version+".tar.gz",
|
||||
checksum,
|
||||
pkg.TarGzip,
|
||||
pkg.Gzip,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -43,7 +48,7 @@ func newFromGitLab(domain, suffix, ref, checksum string) pkg.Artifact {
|
||||
ref+"/"+path.Base(suffix)+"-"+
|
||||
strings.ReplaceAll(ref, "/", "-")+".tar.bz2",
|
||||
checksum,
|
||||
pkg.TarBzip2,
|
||||
pkg.Bzip2,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -53,7 +58,7 @@ func newFromGitHub(suffix, tag, checksum string) pkg.Artifact {
|
||||
"https://github.com/"+suffix+
|
||||
"/archive/refs/tags/"+tag+".tar.gz",
|
||||
checksum,
|
||||
pkg.TarGzip,
|
||||
pkg.Gzip,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ func newIANAEtc() pkg.Artifact {
|
||||
version,
|
||||
"iana-etc-"+version+".tar.gz",
|
||||
checksum,
|
||||
pkg.TarGzip,
|
||||
pkg.Gzip,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ func (t Toolchain) newGo(
|
||||
return t.NewPackage("go", version, newTar(
|
||||
"https://go.dev/dl/go"+version+".src.tar.gz",
|
||||
checksum,
|
||||
pkg.TarGzip,
|
||||
pkg.Gzip,
|
||||
), &PackageAttr{
|
||||
EnterSource: true,
|
||||
Env: slices.Concat([]string{
|
||||
@@ -79,7 +79,7 @@ func init() {
|
||||
bootstrapEarly = []pkg.Artifact{t.NewPackage("go", "1.4-bootstrap", newTar(
|
||||
"https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz",
|
||||
"8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23",
|
||||
pkg.TarGzip,
|
||||
pkg.Gzip,
|
||||
), &PackageAttr{
|
||||
EnterSource: true,
|
||||
Env: []string{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func TestLLVMInputs(t *testing.T) {
|
||||
const wantInputCount = 688
|
||||
const wantInputCount = 857
|
||||
|
||||
_, llvm := rosa.Native().Std().MustLoad(rosa.H("llvm"))
|
||||
var n int
|
||||
|
||||
@@ -433,10 +433,11 @@ func (s *S) getFrame() azalea.Frame {
|
||||
identDefault := k("default")
|
||||
identArch := unique.Make(azalea.Ident(s.arch))
|
||||
|
||||
const compressOffset = 1 << 8
|
||||
enumCompress := map[unique.Handle[azalea.Ident]]any{
|
||||
k("uncompressed"): uint32(pkg.TarUncompressed),
|
||||
k("gzip"): uint32(pkg.TarGzip),
|
||||
k("bzip2"): uint32(pkg.TarBzip2),
|
||||
k("uncompressed"): 0,
|
||||
k("gzip"): pkg.Gzip + compressOffset,
|
||||
k("bzip2"): pkg.Bzip2 + compressOffset,
|
||||
}
|
||||
|
||||
s.frame.Val = map[unique.Handle[azalea.Ident]]any{
|
||||
@@ -609,15 +610,19 @@ func (s *S) getFrame() azalea.Frame {
|
||||
args azalea.FArgs,
|
||||
) (v any, set bool, err error) {
|
||||
var url, checksum string
|
||||
var compress uint32
|
||||
var _compress int
|
||||
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
||||
k("url"): &url,
|
||||
k("checksum"): &checksum,
|
||||
k("compress"): &compress,
|
||||
k("compress"): &_compress,
|
||||
}); err != nil {
|
||||
return
|
||||
}
|
||||
v = pkg.NewHTTPGetTar(nil, url, mustDecode(checksum), compress)
|
||||
f := pkg.NewHTTPGet(nil, url, mustDecode(checksum))
|
||||
if _compress != 0 {
|
||||
f = pkg.NewDecompress(f, uint32(_compress-compressOffset))
|
||||
}
|
||||
v = pkg.NewTar(f)
|
||||
set = true
|
||||
return
|
||||
}, V: enumCompress},
|
||||
@@ -744,7 +749,10 @@ func (s *S) getFrame() azalea.Frame {
|
||||
v = newFromGitHubRelease(suffix, tag, name, checksum, compress)
|
||||
set = true
|
||||
return
|
||||
}, V: enumCompress},
|
||||
}, V: map[unique.Handle[azalea.Ident]]any{
|
||||
k("gzip"): uint32(pkg.Gzip),
|
||||
k("bzip2"): uint32(pkg.Bzip2),
|
||||
}},
|
||||
|
||||
// high-level helpers
|
||||
|
||||
@@ -1275,7 +1283,7 @@ func (s *S) SetSource(fsys fs.FS) error {
|
||||
Description: "hakurei source tree (current)",
|
||||
Version: "1.0.0-CURRENT",
|
||||
Exclude: true,
|
||||
}, pkg.NewTar(a, pkg.TarGzip)
|
||||
}, pkg.NewTar(pkg.NewDecompress(a, pkg.Gzip))
|
||||
}),
|
||||
)
|
||||
s.DropCaches(s.Arch(), s.Flags())
|
||||
|
||||
Reference in New Issue
Block a user