cargo-bins / cargo-binstall

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

Breaking on macos CI #1953

Closed joaoantoniocardoso closed 1 week ago

joaoantoniocardoso commented 2 weeks ago

Hi, I was running my CIs today on GitHub and they started breaking on macos.

Example:

name: Example

on: [push, pull_request]

env:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
        - os: macos-latest
          TARGET: aarch64-apple-darwin

    - name: Install build dependencies - Cargo-Binstall
      uses: cargo-bins/cargo-binstall@main

github output:

Run cargo-bins/cargo-binstall@main
Run curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
++ mktemp -d
+ cd /var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/tmp.qxu9cJTtSL
+ base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-
++ uname -s
+ os=Darwin
+ '[' Darwin == Darwin ']'
+ url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ curl -LO --proto =https --tlsv1.2 -sSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ unzip cargo-binstall-universal-apple-darwin.zip
Archive:  cargo-binstall-universal-apple-darwin.zip
  inflating: cargo-binstall          
+ ./cargo-binstall -y --force cargo-binstall
 INFO resolve: Resolving package: 'cargo-binstall'
 INFO has_release_artifact{release=GhRelease { repo: GhRepo { owner: "cargo-bins", repo: "cargo-binstall" }, tag: "v1.10.10" } artifact_name="cargo-binstall-aarch64-apple-darwin.bin"}:do_send_request{request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.github.com")), port: None, path: "/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10", query: None, fragment: None }, headers: {"accept": "application/vnd.github+json", "x-github-api-version": "2022-11-28"} } url=[https://api.github.com/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10}:](https://api.github.com/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10%7D:) Received status code 403 Forbidden, will wait for 120s and retry
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher QuickInstall: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher QuickInstall: deadline has elapsed
 WARN The package cargo-binstall v1.10.10 will be installed from source (with cargo)
    Updating crates.io index
 Downloading crates ...
  Downloaded cargo-binstall v1.10.10
  Installing cargo-binstall v1.10.10
    Updating crates.io index
error: failed to compile `cargo-binstall v1.10.10`, intermediate artifacts can be found at `/var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/cargo-install0eMqme`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  failed to select a version for the requirement `fs4 = "^0.10.0"`
  candidate versions found which didn't match: 0.11.0, 0.9.1, 0.8.4, ...
  location searched: crates.io index
  required by package `fs-lock v0.1.5`
      ... which satisfies dependency `fs-lock = "^0.1.5"` of package `binstalk-manifests v0.15.7`
      ... which satisfies dependency `binstalk-manifests = "^0.15.7"` of package `cargo-binstall v1.10.10`
ERROR Cargo errored! ExitStatus(unix_wait_status(25856))
ERROR Fatal error:
  × For crate cargo-binstall: subprocess cargo install cargo-binstall
  │ --version 1.10.10 --force errored with exit status: 101
  ╰─▶ subprocess cargo install cargo-binstall --version 1.10.10 --force
      errored with exit status: 101

Error: Process completed with exit code 70.

I'll fix it for now to @v1.10.9 since it was working last week.

Thanks

joaoantoniocardoso commented 2 weeks ago

Fixating to @v1.10.9 didn't work, so I copied the content of the action.yaml from your root and it worked:

env:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
        - os: macos-latest
          TARGET: aarch64-apple-darwin

    - name: Install build dependencies - Cargo-Binstall
      if: runner.os != 'Windows'
      shell: sh
      run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
    - name: Install build dependencies - Cargo-Binstall
      if: runner.os == 'Windows'
      run: Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content
      shell: powershell

In case it's useful:

Run curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
++ mktemp -d
+ cd /var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/tmp.s8wG9zm6GP
+ base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-
++ uname -s
+ os=Darwin
+ '[' Darwin == Darwin ']'
+ url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ curl -LO --proto =https --tlsv1.2 -sSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ unzip cargo-binstall-universal-apple-darwin.zip
Archive:  cargo-binstall-universal-apple-darwin.zip
  inflating: cargo-binstall          
+ ./cargo-binstall -y --force cargo-binstall
 INFO resolve: Resolving package: 'cargo-binstall'
 INFO resolve: Verified signature for package 'cargo-binstall': gh=cargo-bins/cargo-binstall git=2c1f156332d1d2924a6c78e4f7ad726ee3db2e36 ts=2024-11-02T03:02:00.932Z run=11639295865
 WARN The package cargo-binstall v1.10.10 (aarch64-apple-darwin) has been downloaded from github.com
 INFO This will install the following binaries:
 INFO   - cargo-binstall => /Users/runner/.cargo/bin/cargo-binstall
 INFO Installing binaries...
 INFO Done in 2.308281208s
+ CARGO_HOME=/Users/runner/.cargo
+ [[ :/Users/runner/.cargo/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:/opt/homebrew/opt/ruby@3.0/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools: == *\:\/\U\s\e\r\s\/\r\u\n\n\e\r\/\.\c\a\r\g\o\/\b\i\n\:* ]]

I don't know what is going on there, but somehow, the gh actions testing this on this repo isn't reproducing the external use?

Thanks

joaoantoniocardoso commented 2 weeks ago

This is weird... It is working on my fork actions and failing on the original repo to which I'm submitting my PR.

Here is the output of the same action file of the above output, but on the original repo:

Run curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
++ mktemp -d
+ cd /var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/tmp.erZMqH4k3k
+ base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-
++ uname -s
+ os=Darwin
+ '[' Darwin == Darwin ']'
+ url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ curl -LO --proto =https --tlsv1.2 -sSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ unzip cargo-binstall-universal-apple-darwin.zip
Archive:  cargo-binstall-universal-apple-darwin.zip
  inflating: cargo-binstall          
+ ./cargo-binstall -y --force cargo-binstall
 INFO resolve: Resolving package: 'cargo-binstall'
 INFO has_release_artifact{release=GhRelease { repo: GhRepo { owner: "cargo-bins", repo: "cargo-binstall" }, tag: "v1.10.10" } artifact_name="cargo-binstall-aarch64-apple-darwin.tbz2"}:do_send_request{request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.github.com")), port: None, path: "/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10", query: None, fragment: None }, headers: {"accept": "application/vnd.github+json", "x-github-api-version": "2022-11-28"} } url=[https://api.github.com/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10}:](https://api.github.com/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10%7D:) Received status code 403 Forbidden, will wait for 120s and retry
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher QuickInstall: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher QuickInstall: deadline has elapsed
 WARN The package cargo-binstall v1.10.10 will be installed from source (with cargo)
    Updating crates.io index
 Downloading crates ...
  Downloaded cargo-binstall v1.10.10
  Installing cargo-binstall v1.10.10
    Updating crates.io index
error: failed to compile `cargo-binstall v1.10.10`, intermediate artifacts can be found at `/var/folders/g6/rgtlsw6n123b0gt5483s5_cm0000gn/T/cargo-installhrmF4f`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  failed to select a version for the requirement `fs4 = "^0.10.0"`
  candidate versions found which didn't match: 0.11.0, 0.9.1, 0.8.4, ...
  location searched: crates.io index
  required by package `fs-lock v0.1.5`
      ... which satisfies dependency `fs-lock = "^0.1.5"` of package `binstalk-manifests v0.15.7`
      ... which satisfies dependency `binstalk-manifests = "^0.15.7"` of package `cargo-binstall v1.10.10`
ERROR Cargo errored! ExitStatus(unix_wait_status(25856))
ERROR Fatal error:
  × For crate cargo-binstall: subprocess cargo install cargo-binstall
  │ --version 1.10.10 --force errored with exit status: 101
  ╰─▶ subprocess cargo install cargo-binstall --version 1.10.10 --force
      errored with exit status: 101

Error: Process completed with exit code 70.

Is this gh CI using different macos-latest setups..? :eyes: .. or is it just networking issues?

NobodyXu commented 2 weeks ago

I assume it's due to #1952 ?

fzyzcjy commented 2 weeks ago

+1 seeing same thing on https://github.com/fzyzcjy/flutter_rust_bridge


Run cargo-bins/cargo-binstall@main
Run curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
++ mktemp -d
+ cd /var/folders/nj/wh528zms06j9t8y7bmlvpmjm0000gn/T/tmp.6BRCyL5O
+ base_url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-
++ uname -s
+ os=Darwin
+ '[' Darwin == Darwin ']'
+ url=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ curl -LO --proto =https --tlsv1.2 -sSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip
+ unzip cargo-binstall-universal-apple-darwin.zip
Archive:  cargo-binstall-universal-apple-darwin.zip
  inflating: cargo-binstall          
+ ./cargo-binstall -y --force cargo-binstall
 INFO resolve: Resolving package: 'cargo-binstall'
 INFO has_release_artifact{release=GhRelease { repo: GhRepo { owner: "cargo-bins", repo: "cargo-binstall" }, tag: "v1.10.10" } artifact_name="cargo-binstall-x86_64-apple-darwin.zip"}:do_send_request{request=Request { method: GET, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.github.com")), port: None, path: "/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10", query: None, fragment: None }, headers: {"accept": "application/vnd.github+json", "x-github-api-version": "2022-[11](https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/11676822210/job/32513725497#step:6:12)-28"} } url=https://api.github.com/repos/cargo-bins/cargo-binstall/releases/tags/v1.10.10}: Received status code 403 Forbidden, will wait for 120s and retry
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher invalid url: deadline has elapsed
 WARN resolve: Timeout reached while checking fetcher QuickInstall: deadline has elapsed
 WARN The package cargo-binstall v1.10.10 will be installed from source (with cargo)
    Updating crates.io index
 Downloading crates ...
  Downloaded cargo-binstall v1.10.10
  Installing cargo-binstall v1.10.10
    Updating crates.io index
error: failed to compile `cargo-binstall v1.10.10`, intermediate artifacts can be found at `/var/folders/nj/wh528zms06j9t8y7bmlvpmjm0000gn/T/cargo-installa2ka59`.
ERROR Cargo errored! ExitStatus(unix_wait_status([25](https://github.com/fzyzcjy/flutter_rust_bridge/actions/runs/11676822210/job/32513725497#step:6:27)856))
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
ERROR Fatal error:

  × For crate cargo-binstall: subprocess cargo install cargo-binstall
Caused by:
  │ --version 1.10.10 --force errored with exit status: 101
  failed to select a version for the requirement `fs4 = "^0.10.0"`
  ╰─▶ subprocess cargo install cargo-binstall --version 1.10.10 --force
  candidate versions found which didn't match: 0.11.0, 0.9.1, 0.8.4, ...
      errored with exit status: 101
  location searched: crates.io index

  required by package `fs-lock v0.1.5`
      ... which satisfies dependency `fs-lock = "^0.1.5"` of package `binstalk-manifests v0.15.7`
      ... which satisfies dependency `binstalk-manifests = "^0.15.7"` of package `cargo-binstall v1.10.10`
  perhaps a crate was updated and forgotten to be re-vendored?
Error: Process completed with exit code 70.
bytemain commented 2 weeks ago

workaround:

curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
patrickelectric commented 2 weeks ago

workaround:

curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

In my case, it was necessary to add the user agent.

curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
NobodyXu commented 1 week ago

This should be fixed now, and I have improved the script, now it uses --self-install for self installation, which avoids network roundtrip and should be more efficient.

joaoantoniocardoso commented 1 week ago

Thanks, it is fixed =)