bump libpkgx to prefer .xz (.gz deprecated)#86
Merged
Conversation
Add coveralls setup for macOS in CI workflow
Coverage Report for CI Build 28954802113Coverage decreased (-0.1%) to 82.674%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
There was a problem hiding this comment.
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
xzas 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 on lines
+136
to
+143
| function compressions(preferred: Compression): Compression[] { | ||
| switch (preferred) { | ||
| case 'xz': | ||
| return ['xz', 'gz'] | ||
| case 'gz': | ||
| return ['gz', 'xz'] | ||
| } | ||
| } |
|
|
||
| export default async function install(pkg: Package, logger?: Logger): Promise<Installation> { | ||
| const { project, version } = pkg | ||
| type Compression = 'xz' | 'gz' |
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We've deprecated .gz bottles. Older users of v1 don't automatically fall back on linux. Patch that hole. ref: pkgxdev/pantry#13729