Skip to content
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

UBI downloads incompatible artifacts on MUSL systems #70

Closed
BurnerWah opened this issue Oct 24, 2024 · 4 comments
Closed

UBI downloads incompatible artifacts on MUSL systems #70

BurnerWah opened this issue Oct 24, 2024 · 4 comments

Comments

@BurnerWah
Copy link

Note - I mostly tested this against a small wrapper program to download artifacts for multiple platforms quickly.

ubi tends to download GNU/glibc releases even when looking for files with a musl target. This seems to be caused by it falling back upon whichever artifact comes first alphabetically, and between gnu and musl, gnu comes first alphabetically.

I reproduced this with the following projects:

Also, while I don't have the specific project this occurred on, I had once instance of ubi downloading android artifacts, which very well could be the same issue given that android even comes before gnu alphabetically. If I can find where that occurred I'll mention it here.

Debug output (for cargo-bins/cargo-binstall on arm64 alpine linux):

[ubi][DEBUG] Parsed --project cargo-bins/cargo-binstall = cargo-bins / cargo-binstall
[ubi][DEBUG] exe name = cargo-binstall
[ubi][DEBUG] install path = /tmp/tmp.IBiJDN/bin/cargo-binstall
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[ubi::picker][DEBUG] filtering out assets that do not have a valid extension
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-apple-darwin.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-apple-darwin.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-pc-windows-msvc.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-pc-windows-msvc.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-unknown-linux-gnu.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-unknown-linux-gnu.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-unknown-linux-musl.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-aarch64-unknown-linux-musl.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-armv7-unknown-linux-gnueabihf.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-armv7-unknown-linux-musleabihf.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-universal-apple-darwin.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-universal-apple-darwin.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-apple-darwin.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-apple-darwin.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-pc-windows-msvc.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-pc-windows-msvc.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-unknown-linux-gnu.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-unknown-linux-gnu.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-unknown-linux-musl.full.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64-unknown-linux-musl.tgz.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64h-apple-darwin.full.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: cargo-binstall-x86_64h-apple-darwin.zip.sig
[ubi::picker][DEBUG] skipping asset with invalid extension: minisign.pub
[ubi::picker][DEBUG] current OS = linux
[ubi::picker][DEBUG] matching assets against OS using (?i:(?:\b|_)linux(?:\b|_|32|64))
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-apple-darwin.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-apple-darwin.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-pc-windows-msvc.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-pc-windows-msvc.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-unknown-linux-gnu.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-unknown-linux-musl.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-aarch64-unknown-linux-musl.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-armv7-unknown-linux-gnueabihf.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-armv7-unknown-linux-musleabihf.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-universal-apple-darwin.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-universal-apple-darwin.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-apple-darwin.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-apple-darwin.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-pc-windows-msvc.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-pc-windows-msvc.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-unknown-linux-gnu.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-unknown-linux-gnu.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-unknown-linux-musl.full.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64-unknown-linux-musl.tgz
[ubi::picker][DEBUG] matches our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64h-apple-darwin.full.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] matching OS against asset name = cargo-binstall-x86_64h-apple-darwin.zip
[ubi::picker][DEBUG] does not match our OS
[ubi::picker][DEBUG] current CPU architecture = aarch64
[ubi::picker][DEBUG] matching assets against CPU architecture using (?ix)
        (?:
            \b
            |
            _
        )
        (?:
            aarch_?64
            |
            arm_?64
        )
        (?:
            \b
            |
            _
        )
        
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi::picker][DEBUG] matches our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-aarch64-unknown-linux-gnu.tgz
[ubi::picker][DEBUG] matches our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-aarch64-unknown-linux-musl.full.tgz
[ubi::picker][DEBUG] matches our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-aarch64-unknown-linux-musl.tgz
[ubi::picker][DEBUG] matches our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-armv7-unknown-linux-gnueabihf.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-armv7-unknown-linux-musleabihf.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-x86_64-unknown-linux-gnu.full.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-x86_64-unknown-linux-gnu.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-x86_64-unknown-linux-musl.full.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] matching CPU architecture against asset name = cargo-binstall-x86_64-unknown-linux-musl.tgz
[ubi::picker][DEBUG] does not match our CPU architecture
[ubi::picker][DEBUG] found multiple candidate assets, filtering for 64-bit binaries in ["cargo-binstall-aarch64-unknown-linux-gnu.full.tgz", "cargo-binstall-aarch64-unknown-linux-gnu.tgz", "cargo-binstall-aarch64-unknown-linux-musl.full.tgz", "cargo-binstall-aarch64-unknown-linux-musl.tgz"]
[ubi::picker][DEBUG] found 64-bit assets: cargo-binstall-aarch64-unknown-linux-gnu.full.tgz,cargo-binstall-aarch64-unknown-linux-gnu.tgz,cargo-binstall-aarch64-unknown-linux-musl.full.tgz,cargo-binstall-aarch64-unknown-linux-musl.tgz
[ubi::picker][DEBUG] cannot disambiguate multiple asset names, picking the first one after sorting by name
[ubi::picker][DEBUG] picked asset from matches named cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi][DEBUG] picked asset named cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi][DEBUG] downloading asset from https://api.github.com/repos/cargo-bins/cargo-binstall/releases/assets/198706743
[reqwest::connect][DEBUG] starting new connection: https://api.github.com/
[reqwest::async_impl::client][DEBUG] redirecting 'https://api.github.com/repos/cargo-bins/cargo-binstall/releases/assets/198706743' to 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/321270638/8d0b3749-583c-4ea0-a61c-55062416573f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241024%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241024T152344Z&X-Amz-Expires=300&X-Amz-Signature=f7936141bd13c5a24dd87c000a62e219f80e29f149506ac9d10fde0ee74c1bec&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dcargo-binstall-aarch64-unknown-linux-gnu.full.tgz&response-content-type=application%2Foctet-stream'
[reqwest::connect][DEBUG] starting new connection: https://objects.githubusercontent.com/
[ubi][DEBUG] archive path is /tmp/.tmpti538Z/cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi::installer][DEBUG] extracting binary from tarball at /tmp/.tmpti538Z/cargo-binstall-aarch64-unknown-linux-gnu.full.tgz
[ubi::installer][DEBUG] found tarball entry with path LICENSE
[ubi::installer][DEBUG] found tarball entry with path README.md
[ubi::installer][DEBUG] found tarball entry with path cargo-binstall
[ubi::installer][DEBUG] extracting tarball entry to /tmp/tmp.IBiJDN/bin/cargo-binstall
[ubi::installer][INFO] Installed binary into /tmp/tmp.IBiJDN/bin/cargo-binstall
@autarch
Copy link
Member

autarch commented Oct 26, 2024

Thanks for the report. I should have a fix for the musl issue out soon. For Android, can you point me at something that releases Android artifacts? That'd be helpful.

@autarch
Copy link
Member

autarch commented Oct 26, 2024

I see that chezmoi releaes for Android, but the artifact doesn't have "linux" in the name. It's "chezmoi_2.53.0_android_arm64.tar.gz". So that won't be an issue. If someone does release something like "project-v1.2.0-linux-android.tar.gz" then that would be a problem. Have you seen that pattern in use in the wild?

@autarch
Copy link
Member

autarch commented Oct 27, 2024

The musl issue is fixed in v0.2.1, which I just released. I'll close this issue for now but if you can find an example of an issue with Android builds, please make a new issue. Thanks!

@autarch autarch closed this as completed Oct 27, 2024
@BurnerWah
Copy link
Author

Thanks for the report. I should have a fix for the musl issue out soon. For Android, can you point me at something that releases Android artifacts? That'd be helpful.

I'll report the android issue whenever I can remember where it occurred. I genuinely still can't remember where it occurred but I distinctly remember seeing /system/... show up as an interpreter for something. But it's basically impossible to fix without the filenames that actually caused it to occur lol.
Sorry about that, but also, thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants