Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore [build] in .cargo/config for cargo install #2507

Closed
phil-opp opened this issue Mar 22, 2016 · 3 comments
Closed

Ignore [build] in .cargo/config for cargo install #2507

phil-opp opened this issue Mar 22, 2016 · 3 comments
Labels
A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install

Comments

@phil-opp
Copy link
Contributor

I tried to install cargo-edit through cargo install. But it failed with:

error: can't find crate for `std` [E0463]
error: aborting due to previous error

The reason was that the current directory contains a .cargo/config that overrides the default target. So cargo install tried to build for that target, too.

I found that a bit surprising since cargo install is close to something like apt-get install, which is independent of the current directory. Is there a reason why cargo install doesn't just ignore .cargo/config files?

@alexcrichton
Copy link
Member

I would be wary of blanket ignore the entirety of .cargo/config, but perhaps ignore some select tables (for example [build]) on a cargo install does seem reasonable

@japaric
Copy link
Member

japaric commented Apr 22, 2016

👍 to at least ignore build.target. Right now I'm working this around with:

$ mv .cargo cargo
$ cargo install $crate
$ mv cargo .cargo

@carols10cents carols10cents changed the title Ignore .cargo/config for cargo install Ignore [build] in .cargo/config for cargo install Sep 25, 2017
@carols10cents carols10cents added A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install labels Sep 25, 2017
@ehuss
Copy link
Contributor

ehuss commented Oct 5, 2018

The local .cargo/config file is now ignored in cargo install as of #6026. The global HOME directory config is still used.

@ehuss ehuss closed this as completed Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install
Projects
None yet
Development

No branches or pull requests

5 participants