Skip to content

cargo install does not respect .cargo/config.toml #11660

@thoren-d

Description

@thoren-d

Problem

When I run cargo install ripgrep in a directory with a .cargo/config.toml overriding the install root (like below), it installs to $HOME/.cargo/bin instead.

The interesting thing is that cargo uninstall reads the configured root correctly, so if I immediately run cargo uninstall ripgrep in the same directory, it complains that package ID specification ripgrep did not match any packages.

Contents of .cargo/config.toml:

[install]
root = "./apps"

Steps

  1. Create a config file like the one above.
  2. Make an apps directory
  3. Run cargo install ripgrep (or anything)

Possible Solution(s)

No response

Notes

Also tried nightly just now with the same result.

Obviously I can just cargo install --root apps ..., but I was trying to experiment with patching dependencies and building with different compile options and it seems cargo install is completely ignoring the configuration file.

Version

cargo 1.67.0 (8ecd4f20a 2023-01-10)
release: 1.67.0
commit-hash: 8ecd4f20a9efb626975ac18a016d480dc7183d9b
commit-date: 2023-01-10
host: x86_64-pc-windows-msvc
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.86.0-DEV (sys:0.4.59+curl-7.86.0 vendored ssl:Schannel)
os: Windows 10.0.22621 (Windows 10 Pro) [64-bit]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions