Open
Description
Problem
In some cases cargo clean refuses to execute in offline mode. I can't imagine any valid reason why cargo clean would need access to the network to perform workspace cleaning activity.
Steps
- Clean up local cargo artifacts
cargo clean
rm -r ~/.cargo/git
rm -r ~/.cargo/registry
- Change into a directory with a rust project that uses a git dependency (I think this is necessary)
- Run
cargo clean --offline -p <project-name>
- This will fail with an error like:
error: failed to load source for dependency 'modular-bitfield'
- This will fail with an error like:
Possible Solution(s)
No response
Notes
No response
Version
cargo 1.75.0-nightly (b4d18d4bd 2023-10-31)
release: 1.75.0-nightly
commit-hash: b4d18d4bd3db6d872892f6c87c51a02999b80802
commit-date: 2023-10-31
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]