Skip to content

document external cargo subcommand PATH precedence #13194

Closed
@eval-exec

Description

@eval-exec

Problem

I have encountered an issue with the cargo nextest subcommand where it does not select the expected subcommand's version.

Steps

Here are the details of the problem:

  1. I have cargo-nextest in my PATH, located at /nix/store/3yl7vgm2qkp7skr5gskbfd457f6g43cg-cargo-nextest-0.9.66/bin/cargo-nextest, and its version is 0.9.66.
bash-5.2$ which cargo-nextest
/nix/store/3yl7vgm2qkp7skr5gskbfd457f6g43cg-cargo-nextest-0.9.66/bin/cargo-nextest
  1. Additionally, I have cargo-nextest installed in ~/.cargo/bin, and its version is 0.9.59.
bash-5.2$ ~/.cargo/bin/cargo-nextest --version
cargo-nextest 0.9.59
  1. Running ~/.cargo/bin/cargo-nextest --version confirms that the version installed in ~/.cargo/bin is indeed 0.9.59.

  2. However, when I execute cargo nextest --version, it incorrectly selects version 0.9.59 from ~/.cargo/bin, instead of the desired version 0.9.66 from /nix/store/3yl7vgm2qkp7skr5gskbfd457f6g43cg-cargo-nextest-0.9.66/bin/cargo-nextest.

bash-5.2$ cargo nextest --version
cargo-nextest-nextest 0.9.59

This behavior seems inconsistent and unexpected. It would be helpful if the cargo command could prioritize the version in the path /nix/store/3yl7vgm2qkp7skr5gskbfd457f6g43cg-cargo-nextest-0.9.66/bin when invoking the cargo nextest subcommand.

Thank you for your attention to this issue, and please let me know if you need any further information to reproduce or investigate the problem.

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.72.1 (103a7ff2e 2023-08-15)
release: 1.72.1
commit-hash: 103a7ff2ee7678d34f34d778614c5eb2525ae9de
commit-date: 2023-08-15
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 8.1.2-DEV (sys:0.4.63+curl-8.1.2 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: NixOS 24.5.0 [64-bit]

Metadata

Metadata

Assignees

Labels

A-custom-subcommandsArea: custom 3rd party subcommand pluginsA-documenting-cargo-itselfArea: Cargo's documentationS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions