Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Job failing on trying to cargo install already existing crate #219

@mr-pascal

Description

@mr-pascal

Do the checklist before filing an issue:

Description

On my GitHub Actions CI pipeline the actin-rs/cargo@v1 errors using the install command when, due to caching, the target crate is already installed.

Workflow code

My Workflow file:
https://github.com/mr-pascal/changelog-generator/actions/runs/3451578950/workflow
See the test_coverage job workflow.

# Install "grcov"
- uses: actions-rs/cargo@v1
  with:
    command: install
    args: grcov

Action output

Run actions-rs/cargo@v1
  with:
    command: install
    args: grcov
    use-cross: false
  env:
    RUSTFLAGS: -Cinstrument-coverage
    LLVM_PROFILE_FILE: coverage-%p-%m.profraw
/home/runner/.cargo/bin/cargo install grcov
    Updating crates.io index
error: binary `grcov` already exists in destination
Error: Add --force to overwrite
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

Expected behavior

Instead of throwing an error and failing the job I would expect a plain "Ignored" notice, that the package already exists and the job just continues.

image

Additional context

I use caching in the workflow to speed it up significantly, as such also the previous installed grcov is kept in cache and available.

- uses: actions/cache@v3
  with:
    path: |
      ~/.cargo/bin/
      ~/.cargo/registry/index/
      ~/.cargo/registry/cache/
      ~/.cargo/git/db/
      target/
    key: ${{ runner.os }}-cargo-2-${{ hashFiles('**/Cargo.lock') }}

Using --force and just re-installing the crate is no option, since this would introduce also a re-compilation of the crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions