-
-
Notifications
You must be signed in to change notification settings - Fork 69
Support non-tar
'd .gz
files as a package format
#2119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes I think it can be done relatively easily, though I don't have time to add that now. If you are willing to open a PR, I am more than happy to review and merge it |
@NobodyXu I'd be willing to make a PR. However, I don't have much knowledge of cargo-binstall's internals. So it might take a few days while I acquaint myself with the codebase. |
No worries! The PkgFmt is defined in binstalk-types and shared among all binstalk packages, and the guessing of PkgFmt from filename binstalk-downloader handles the actual download and unpacking, once new PkgFmt is added, updating binstalk-downloader to handle the new variant. You can use async-compression's gz decoders |
@NobodyXu So I managed to implement it... but forgot that single-file archive formats (like Unfortunately, I'm unsure how to get the expected name - so I don't think non- Additionally, I found that if a repository has both a At this point, I'm unsure how to proceed. I feel it may be better to let you try to handle it (since I don't really want to touch anything more than what I already have). My work thus far is at https://github.com/LikeLakers2/cargo-binstall/tree/project/add/non-tar-formats (or you can download the sole commit here) if you want to use any part of it. (In case it needs said for legal stuff: I give you permission to do whatever you wish with those changes, with or without credit.) |
If it's a single file, then it shouldn't be a problem right? We just use gz for compression, not using it as an archive?
I think this shouldn't happen, for a crate to have two archive formats with different content, and not specify pkg-fmt manually. We don't need to consider this case, at the very most we can add a warning message. |
It is - because formats like This means that if the uploaded |
Yeah that how I think it should work
Yeah I think it sounds good? I.e. for cargo-binstall it would be |
1 similar comment
Yeah that how I think it should work
Yeah I think it sounds good? I.e. for cargo-binstall it would be |
Not really, because then the file name doesn't tell us what OS (Linux/Darwin/etc.) or architecture (aarch64/x86/powerpc/etc.) the contained binary is for. If we try to rename it to include such information (i.e. |
Oh right I forgot that. On the second thought the bin pkg-fmt also has the same problem, and that isn't a problem because for installation we use the binary name recorded in Cargo.toml in a crate, so it also won't be a problem for .gz files |
I also encountered this when trying to make See also #2126 Glad to see people are already looking at it! |
Hi! Whilst trying to add some binstall metadata to
taplo-cli
, I came across an issue. Specifically,taplo-cli
is released in a non-tar
'd.gz
format for all platforms (except Windows, which uses.zip
).Unfortunately, I found that
cargo-binstall
has no supportedpkg-fmt
option for just.gz
. Looking over the formats thatcargo-binstall
supports, it seems to assume that if.gz
is used, then we'll also be using a.tar
.With
cargo-binstall
already using some dependencies to extract.gz
files, I would think that including support for non-tar
'd.gz
files would be trivial to add. You could probably even add the same sort of support to.bz2
,.xz
, and.zst
files.So if it isn't too unreasonable, perhaps this could be done?
The text was updated successfully, but these errors were encountered: