Skip to content

feat(config): Stabilize resolver.lockfile-path config#16694

Open
epage wants to merge 1 commit intorust-lang:masterfrom
epage:lockfile-path
Open

feat(config): Stabilize resolver.lockfile-path config#16694
epage wants to merge 1 commit intorust-lang:masterfrom
epage:lockfile-path

Conversation

@epage
Copy link
Contributor

@epage epage commented Mar 3, 2026

What does this PR try to resolve?

Closes #14421

Overall, this seems like a low policy knob for users to tweak in config (ie out fo the way) so this seems relatively safe to stabilize.

Unresolved questions from the tracking issue:

Inconsistency in resolver table being applied to cargo install

...

How this should work if the lockfile or a parent directory is not present

cargo install --lockfile-path=<path> implies --locked, and requires the alternative lockfile to exist.

This was from when the we had --lockfile-path instead which added its own set of policy questions.
By having this be a config that just overrides the default, all other policies should remain the same.

In particular for the cargo install case, see #16617

How to test and review this PR?

@epage epage added the T-cargo Team: Cargo label Mar 3, 2026
@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation A-unstable Area: nightly unstable support A-workspaces Area: workspaces S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 3, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2026

r? @ehuss

rustbot has assigned @ehuss.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, weihanglo

@epage
Copy link
Contributor Author

epage commented Mar 3, 2026

@rfcbot fcp merge cargo

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Mar 3, 2026

Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Mar 3, 2026
@epage
Copy link
Contributor Author

epage commented Mar 3, 2026

@rfcbot fcp concern install

Inconsistency in resolver table being applied to cargo install

Should we remove install support or have this inconsistent?

Copy link
Member

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

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

Thanks! :shipit:

The changes look good.

View changes since this review

@0xPoe
Copy link
Member

0xPoe commented Mar 3, 2026

Should we remove install support or have this inconsistent?

In which cases would we need to specify the lockfile path and install binaries? This configuration is primarily for using read-only source directories. I couldn't wrap my head around coming up with a use case for it.

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@weihanglo
Copy link
Member

Should we remove install support or have this inconsistent?

Just remind that we also have an inconsistency of install not respecting [patch] #12855.

@weihanglo
Copy link
Member

Do we think the support of unsetting the lockfile path a blocker? Currently there is no way to do that. And without that, it is hard for people to unset if a global resolver.lockfile-path is applied to cargo-install.

@ehuss
Copy link
Contributor

ehuss commented Mar 6, 2026

I'm not quite clear which inconsistency we're talking about.

  • That cargo install requires --locked to honor resolver.lockfile-path?
  • That cargo install with --locked and resolver.lockfile-path doesn't honor other settings in the resolver table?
  • Something else?

Also, is there a more detailed description of this feature? Overall I'd like to see a more detailed stabilization report. For example, it seems to reserve {} substitutions, but I don't see that mentioned anywhere. There also seems to be various small details, like it seems to create intermediate directories (which is good). Is the path relative to the workspace root? The current directory? The consideration of an config value versus CLI flag was captured out in #15510 (comment). Things like that would help in understanding what is being proposed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-documenting-cargo-itself Area: Cargo's documentation A-unstable Area: nightly unstable support A-workspaces Area: workspaces disposition-merge FCP with intent to merge proposed-final-comment-period An FCP proposal has started, but not yet signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cargo Team: Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for -Zlockfile-path

6 participants