Skip to content

WIP: Include lock file path in verbose mode output #15486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gordon01
Copy link
Contributor

@Gordon01 Gordon01 commented May 3, 2025

What does this PR try to resolve?

Fixes #15094

When Cargo is run with --verbose, the message now includes the path to the lockfile it's waiting on. This makes it easier to debug situations where a stale or stuck lock is preventing progress, especially when no other Cargo process appears to be running.

I've personally encountered this a few times.

How should we test and review this PR?

Run cargo with --verbose and some kind of lock engaged.

Previously, the message simply stated:

Blocking waiting for file lock on package cache

Now it includes the full path:

Blocking waiting for file lock on package cache (/home/user/.cargo/.package-cache)

@rustbot
Copy link
Collaborator

rustbot commented May 3, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-filesystem Area: issues with filesystems S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2025
@Gordon01 Gordon01 force-pushed the print_lock_path branch from 4c39fd3 to aac4418 Compare May 3, 2025 21:17
if try_acquire(path, lock_try)? {
return Ok(());
}
let msg = format!("waiting for file lock on {}", msg);
let path = path.display();
let msg = if verbose {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if the discoverability of this behind --verobse. Personally I am fine with just printing the lock path unconditionally, though I think per our contribution policy maybe we want to discuss this in the original issue #15094?

@Gordon01 Gordon01 changed the title Include lock file path in verbose mode output WIP: Include lock file path in verbose mode output May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filesystem Area: issues with filesystems S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo should say which lock it waits on when run with --verbose
4 participants