Skip to content

cargo clean --offline fails #12989

Open
Open
@infogulch

Description

@infogulch

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

  1. Clean up local cargo artifacts
    1. cargo clean
    2. rm -r ~/.cargo/git
    3. rm -r ~/.cargo/registry
  2. Change into a directory with a rust project that uses a git dependency (I think this is necessary)
  3. Run cargo clean --offline -p <project-name>
    1. This will fail with an error like: error: failed to load source for dependency 'modular-bitfield'

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-cleanS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions