cargo-bins / cargo-binstall

Binary installation for rust projects
GNU General Public License v3.0
1.58k stars 54 forks source link

[Github Action][QEMU][aarch64] Install fails #1292

Closed AzHicham closed 1 year ago

AzHicham commented 1 year ago

Hello,

I have a simple docker image that fails to build (since last week). It fails when I try to install binstall, the probleme happens only on aarch64 with qemu on github action. github action / amd64 -> OK macbook m1 / aarch64 -> OK

My dockerfile:

RUN \
    # Rust Toolchain
    curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VERSION --no-modify-path --profile minimal && \
    # Rust packages
    rustup component add llvm-tools-preview clippy && \
    curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/v1.2.1/install-from-binstall-release.sh | bash && \
    cargo binstall cargo-llvm-cov --no-confirm --locked --version 0.5.26 && \
    cargo binstall cargo-nextest --no-confirm --locked --version 0.9.57 && \
    cargo binstall cargo-sonar --no-confirm --locked --version 0.20.0

Here is the error:

190.4 + target=aarch64-unknown-linux-musl
190.4 + '[' aarch64 == armv7 ']'
190.4 + url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz
190.4 + tar -xvzf -
190.4 + curl -L --proto =https --tlsv1.2 -sSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz
191.6 cargo-binstall
192.0 + ./cargo-binstall -y --force cargo-binstall
192.1 thread 'main' panicked at 'unable to create QUIC endpoint: Os *** code: 92, kind: Uncategorized, message: "Protocol not available" ***', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.11.18/src/async_impl/h3_client/connect.rs:41:58
192.1 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
192.4 bash: line 28:  2776 Aborted                 (core dumped) ./cargo-binstall -y --force cargo-binstall

PS: Issue observed with version v1.1.2 and also v1.2.1

AzHicham commented 1 year ago

I just found out that even if I want to install binstall v1.1.2 using curl + bash ie curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/v1.1.2/install-from-binstall-release.sh | bash

It will install the latest release in sh script -> base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-"

Also http3 support has been added recently > v1.2.0

passcod commented 1 year ago

Hmm reqwest really shouldn't try HTTP/3 if the support isn't available...

In the meantime you can install by downloading the binary directly instead of using the scripts.

AzHicham commented 1 year ago

Nice! I download manually the release v1.1.2 an it works :)

Thank you

Feel free to close the issue or wait for a fix :)

passcod commented 1 year ago

@NobodyXu do you think we could catch that error somehow and opt out of HTTP/3 at runtime or better to report upstream? Also may be a good idea to provide a flag to disable HTTP/3 even when supported.

NobodyXu commented 1 year ago

@NobodyXu do you think we could catch that error somehow and opt out of HTTP/3 at runtime or better to report upstream? Also may be a good idea to provide a flag to disable HTTP/3 even when supported.

Didn't find anything related to this in reqwest doc, perhaps we should open an issue in upstream.

NobodyXu commented 1 year ago

P.S. @AzHicham you could run

cargo binstall cargo-llvm-cov@0.5.26 cargo-nextest@0.9.57 cargo-sonar@020.0 --no-confirm --locked

to speedup installation by resolving and installing in parallel

NobodyXu commented 1 year ago

@passcod @AzHicham I read the message again and realize that it's the udp protocol that isn't available, not that reqwest cannot fallback to http/2.

@AzHicham Can you try enabling udp support in ur docker and see if it will work?

AzHicham commented 1 year ago

@NobodyXu Thank you for the tips !!

WDYM by enabling udp support ? base image is debian:11-slim should udp be already enabled ?

NobodyXu commented 1 year ago

@NobodyXu Thank you for the tips !!

WDYM by enabling udp support ? base image is debian:11-slim should udp be already enabled ?

I think it's a docker issue, it's probably blocked using seccomp filters.

NobodyXu commented 1 year ago

@AzHicham We have released cargo-binstall v1.3.0, which bumps reqwest to v0.11.20 and it should fix this.

AzHicham commented 1 year ago

@NobodyXu Thank you It's working now with version 1.3.0 :)