Skip to content

Cargo should say which lock it waits on when run with --verbose #15094

Open
@WaffleLapkin

Description

@WaffleLapkin

Problem

Due to an unfortunate series of events (rust-analyzer OOM'ing after using >44GiB of RAM) I had cargo's package cache permanently locked. When I'd try to build something all I would see is this:

    Blocking waiting for file lock on package cache

(I had no cargo/r-a running at that point)

This is only semi-helpful -- it shows you what's the problem, but not how to fix it.

Proposed Solution

It would be nice if cargo would print the path to the lockfile. In this case that would be something like ~/.cargo/.package-cache and ~/.cargo/.package-cache-mutate (deleting those fixed the problem for me). It's probably better to only print those with --verbose, since usually you are actually waiting for another cargo process.

Notes

Upd: this can be even worse for other locks/in combination with other build systems.

Just not I had to figure out that the blocking/broken lock is actually .../rust-q/build/rust-analyzer/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/.cargo-lock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-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