Skip to content

Tracking Issue for -Zlockfile-pathΒ #14421

Closed

Description

@weihanglo

Summary

Original issue: #5707
Implementation: #14326
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#lockfile-path

The -Zlockfile-path flag enables the resolver.lockfile-path configuration option,
which allows you to specify the path of the lockfile Cargo.lock.

Unresolved Issues

  • Inconsistency in resolver table being applied to cargo install
  • How this should work if the lockfile or a parent directory is not present
    • In #14326, missing parent directories will be created when Cargo is about to write the lockfile. This minimizes the chance of creating dangling directories.
  • cargo install --lockfile-path=<path> implies --locked, and requires the alternative lockfile to exist.
    • This behavior diverges from other commands, which allow the absence of lockfile at the alternative path.
  • Allow to set lockfile-path via an environment variableΒ #15510

Future Extensions

No response

Tasks

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Activity

  1. added
    A-lockfileArea: Cargo.lock issues
    S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review
    S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.
    on Aug 18, 2024
  2. ifropc commented on Aug 18, 2024

    @ifropc
    Contributor

    @rustbot claim

  3. added 2 commits that reference this issue on Aug 18, 2024
  4. ifropc commented on Sep 27, 2024

    @ifropc
    Contributor

    As far as shell completions go, I don't think we need to do anything in the scope of this task. In fact, it's alreadyready working on the latest nightly (as part of #14520)
    Image

  5. epage commented on Sep 27, 2024

    @epage
    Contributor

    @ifropc thats the new, unstable completion system.

    The task is referring to our handwritten, stable completions

  6. epage commented on Sep 27, 2024

    @epage
    Contributor

    That said, you could add a custom completer to the new completion system that restricts completions to files named Cargo.lock using PathCompleter::file().filter(...), see https://docs.rs/clap_complete/latest/clap_complete/engine/struct.PathCompleter.html

  7. added a commit that references this issue on Sep 27, 2024
  8. ifropc commented on Sep 27, 2024

    @ifropc
    Contributor

    Got it, I will add the support into the stable system + will do the lock filter in the new system. Thought the unstable stuff is automatically grouped into the unstable autocomplete system as well, but guess it's a separate matter.
    Thanks Ed!

  9. changed the title [-]Tracking Issue for `--lockfile-path`[/-] [+]Tracking Issue for `-Zlockfile-path`[/+] on Jan 15, 2026
  10. epage commented on Jan 15, 2026

    @epage
    Contributor

    #16510 changed this from a CLI flag to a config field. See also #15510

  11. removed
    S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review
    on Jan 22, 2026
  12. added a commit that references this issue on Feb 10, 2026
  13. added a commit that references this issue on Apr 17, 2026
    da06c61
  14. ifropc commented on Apr 17, 2026

    @ifropc
    Contributor

    Great job team!!

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

Metadata

Metadata

Assignees

Labels

A-lockfileArea: Cargo.lock issuesC-tracking-issueCategory: A tracking issue for something unstable.S-waiting-on-feedbackStatus: An implemented feature is waiting on community feedback for bugs or design concerns.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions