pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Convenient pinned installation

Open davireis opened this issue 9 months ago • 1 comments

The shell installer has no option to specify a version and the tgz target it uses only serves the latest version. The only mechanism to install a pinned version are the github releases. However, they do not work with convenience scripts like https://github.com/jpillora/installer due to the unusual xz packaging.

Life would better if the github releases simply used .tar.gz, and the installer script relied on them directly (or in the latest release mirrored).

davireis avatar Feb 27 '25 21:02 davireis

it's strange that installer doesn't support xz compression, due to its ubiquity, but it should be trivial enough to submit a patch here: https://github.com/jpillora/installer/blob/397db1c2de0fe2d3ff11e347027eefd30da06500/scripts/install.sh.tmpl#L116-L139

jhheider avatar Feb 27 '25 21:02 jhheider

There's .tar.gzs here: https://dist.pkgx.dev/?prefix=pkgx.sh/linux/x86-64/

Certainly our shell installer should allow a version to be specified.

mxcl avatar Mar 13 '25 15:03 mxcl

I agree .tar.gz as the github release assets would be better. We were using .xz since pkgx^1 used deno and the deno compiled binaries were ~100MB so xz saved a lot of space.

I am reluctant to change the asset type now as scripts may exist that expect the .xz and I am reluctant to provide both on the assets since it makes browsing the release assets more confusing and we provide .gzs elsewhere.

mxcl avatar Mar 13 '25 15:03 mxcl

Oh I see, jpillora/installer uses github releases. Well they really should support all common archive formats.

mxcl avatar Mar 13 '25 15:03 mxcl

right. surprising in 2025 that .xz isn't supported.

jhheider avatar Mar 13 '25 15:03 jhheider

I guess we can start adding .gz to releases too.

If we were extra keen we could write a script to retroactively add .gz to previous releases as well.

mxcl avatar Mar 13 '25 16:03 mxcl

FWIW, it is true that https://github.com/jpillora/installer can be trivially extended to support .xz, but I do not think .xz is that ubiquitous. Evidence:

docker run -i -t ubuntu
root@27b2bb510727:/# gunzip
gzip: compressed data not read from a terminal. Use -f to force decompression.
For help, type: gzip -h
root@27b2bb510727:/# xz
bash: xz: command not found
root@27b2bb510727:/#

Of course one can just apt update && apt install xz-utils, but inside a docker image, part of the pkgx magic is that you don't need other package managers which have inferior properties.

davireis avatar Mar 18 '25 15:03 davireis

I am running a script to update all releases with .gz files and new releases will also publish .tar.gz files.

mxcl avatar Mar 18 '25 15:03 mxcl

installer should still support .xz files IMO (easy to do if they use pkgxdev/setup@v3 ofc). It’s not ubiquitous, I agree, but it is common.

mxcl avatar Mar 18 '25 16:03 mxcl

Just FYI, I have confirmed this now works:

docker run -i -t chainguard/wolfi-base
apk add curl bash
curl https://i.jpillora.com/pkgxdev/[email protected]! | bash

Thanks!

davireis avatar Mar 23 '25 11:03 davireis