Skip to content

Commit

Permalink
Fix build-mdbook CI failure (#5574)
Browse files Browse the repository at this point in the history
## Description

`build-mdbook` was failing on multiple PRs with 

```
Run cargo install --locked --debug --path ./forc
error: binary `forc` already exists in destination
Add --force to overwrite
```


https://github.com/FuelLabs/sway/actions/runs/7819113568/attempts/1?pr=5569

https://github.com/FuelLabs/sway/actions/runs/7816891674/job/21336246772?pr=5565

`cargo install` keeps track of which binaries it has installed in
~/.cargo/crates.toml and ~/.cargo.crates2.json. By using the entire
cached `cargo` directory, cargo is able to tell that it has previously
installed the binaries and install correctly.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
  • Loading branch information
sdankel authored Feb 7, 2024
1 parent 1123118 commit adfc551
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ jobs:
- uses: buildjet/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Forc
Expand Down Expand Up @@ -376,10 +373,7 @@ jobs:
- uses: buildjet/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build All Tests
Expand Down

0 comments on commit adfc551

Please sign in to comment.