Skip to content

bump libpkgx to prefer .xz (.gz deprecated)#86

Merged
jhheider merged 2 commits into
mainfrom
v0.22-xz-gz-fallback
Jul 8, 2026
Merged

bump libpkgx to prefer .xz (.gz deprecated)#86
jhheider merged 2 commits into
mainfrom
v0.22-xz-gz-fallback

Conversation

@jhheider

@jhheider jhheider commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

We've deprecated .gz bottles. Older users of v1 don't automatically fall back on linux. Patch that hole. ref: pkgxdev/pantry#13729

@jhheider jhheider marked this pull request as ready for review July 8, 2026 15:30
Copilot AI review requested due to automatic review settings July 8, 2026 15:30
@jhheider jhheider merged commit 74f3cb4 into main Jul 8, 2026
11 checks passed
@jhheider jhheider deleted the v0.22-xz-gz-fallback branch July 8, 2026 15:31
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 28954802113

Coverage decreased (-0.1%) to 82.674%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 12 uncovered changes across 1 file (55 of 67 lines covered, 82.09%).
  • 2 coverage regressions across 2 files.

Uncovered Changes

File Changed Covered %
src/plumbing/install.ts 66 54 81.82%
Total (2 files) 67 55 82.09%

Coverage Regressions

2 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
src/hooks/useConfig.ts 1 69.46%
src/plumbing/install.ts 1 79.88%

Coverage Stats

Coverage Status
Relevant Lines: 2971
Covered Lines: 2511
Line Coverage: 84.52%
Relevant Branches: 746
Covered Branches: 562
Branch Coverage: 75.34%
Branches in Coverage %: Yes
Coverage Strength: 3187.6 hits per line

💛 - Coveralls

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates libpkgx’s bottle installation behavior to prefer .xz artifacts by default while preserving compatibility by falling back to .gz when the preferred artifact is missing (eg. older v1 bottles on Linux). This aligns with the .gz deprecation while preventing installs from failing when only gzip bottles exist.

Changes:

  • Prefer xz as the default bottle compression in config.
  • Add install-time fallback logic to try the alternate compression when a 404 is encountered.
  • Update/install tests to exercise the fallback path, and tweak CI coverage upload setup for macOS.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/plumbing/install.ts Adds compression fallback logic and refactors bottle install into a helper, with 404 detection.
src/plumbing/install.test.ts Adjusts fetch stubs and fixtures to validate fallback from .xz to .gz.
src/hooks/useConfig.ts Changes default compression option to always prefer xz.
src/hooks/useConfig.test.ts Updates expectation for default compression to xz.
.github/workflows/ci.yml Adds a macOS-only Homebrew tap/trust step before Coveralls upload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/plumbing/install.ts
Comment on lines +136 to +143
function compressions(preferred: Compression): Compression[] {
switch (preferred) {
case 'xz':
return ['xz', 'gz']
case 'gz':
return ['gz', 'xz']
}
}
Comment thread src/plumbing/install.ts

export default async function install(pkg: Package, logger?: Logger): Promise<Installation> {
const { project, version } = pkg
type Compression = 'xz' | 'gz'
Comment thread src/plumbing/install.ts
Comment on lines +78 to +87
const tar_args = compression == 'xz' ? 'xJf' : 'xzf' // laughably confusing
const untar = new Deno.Command("tar", {
args: [tar_args, "-", "--strip-components", (pkg.project.split("/").length + 1).toString()],
stdin: 'piped', stdout: "inherit", stderr: "inherit",
cwd: tmpdir.string,
/// hard coding path to ensure we don’t deadlock trying to use ourselves to untar ourselves
env: { PATH }
}).spawn()
const hasher = createHash("sha256")
const writer = untar.stdin.getWriter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants