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

Bad interaction with cargo binstall : binstall claims a binary is installed, when it's not available #204

Open
HadrienG2 opened this issue Sep 4, 2024 · 2 comments

Comments

@HadrienG2
Copy link

Not sure if this should be fixed on the rust-cache or the cargo-binstall side, but it seems rust-cache caches enough for cargo-binstall to think that a binary is installed, but not enough for the binary to actually be available in ~/.cargo/bin, resulting in this sort of CI failure:

$ cargo binstall -y cargo-machete && cargo machete
 INFO resolve: Resolving package: 'cargo-machete'
 INFO resolve: cargo-machete v0.6.2 is already installed, use --force to override
 INFO Done in 182.512402ms
error: no such command: `machete`

	View all installed commands with `cargo --list`
	Find a package to install `machete` with `cargo search cargo-machete`

While this is being investigated, the obvious workaround is to run cargo binstall with the -f flag in CI jobs.

@gekh
Copy link

gekh commented Sep 12, 2024

Same issue.

jobs:
  build:
    name: Deploy on test
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Run sccache-cache
        uses: mozilla-actions/[email protected]
        env:
          SCCACHE_GHA_ENABLED: "true"
          RUSTC_WRAPPER: "sccache"
      - name: Install binstall
        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 dx
        run: cargo binstall dioxus-cli -y
      - name: Build
        run: dx build --release

Fails with

Run dx build --release
/home/runner/work/_temp/4450bfb9-31d4-4702-8690-293d0399cbed.sh: line 1: dx: command not found
Error: Process completed with exit code 127.

@akesson
Copy link

akesson commented Sep 30, 2024

From what I can see, the ~/.cargo/.crates.toml gets cached, but not the binaries that are installed in the ~/.cargo/bin directory. Which also means that cargo install --list happily shows a list of installed binaries that doesn't correspond to the what is available.

caass added a commit to caass/advent-of-code that referenced this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants