Skip to content

Cargo should not prepend $HOME/.cargo/bin to PATH for subcommands when it's already in PATH, to avoid unnecessary recompilations #7431

@Boscop

Description

@Boscop

cargo is prepending $HOME/.cargo/bin/%HOME%\.cargo\bin to PATH, even if PATH already contains this dir.
Cargo should only prepend it if it's not already in PATH!
Currently this behavior causes unnecessarily recompilations when any dependency uses rerun-if-env-changed=PATH, such as libsqlite3-sys.
(I have to wait several minutes every time when switching between cargo check in my editor and having cargo watch -x run running in cmd.exe, because cargo passes an unnecessarily modified PATH to cargo-watch, even though my PATH already contains %HOME%\.cargo\bin.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions