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

"cargo install" doesn't read the "rustflags" setting in .cargo/config #6487

Closed
xelephas opened this issue Dec 26, 2018 · 5 comments
Closed
Labels
C-bug Category: bug

Comments

@xelephas
Copy link

Problem

Cargo install command doesn't read the rustflags setting in .cargo/config

Steps

In order to fix a linker issue on macOS (https://github.com/alexcrichton/git2-rs/issues/180), i have to use something like: RUSTFLAGS='-L /usr/lib' cargo build.

And I put this flag inside {project-folder}/.cargo/config file:

[build]
rustflags = ["-L", "/usr/lib"]

This works for cargo build, but not cargo install

It looks like cargo install ignores that setting.
I have to use RUSTFLAGS='-L /usr/lib' cargo install --path . to make it work again.

i also tried something like:

[targer.x86_64-apple-darwin]
rustflags = ["-L", "/usr/lib"]

No luck either.

Notes

Output of cargo version:

$ cargo version
cargo 1.31.0 (339d9f9c8 2018-11-16)

Operating System: macOS High Sierra, 10.13.6

I have edition = "2018" in Cargo.toml

@xelephas xelephas added the C-bug Category: bug label Dec 26, 2018
@Eh2406
Copy link
Contributor

Eh2406 commented Dec 27, 2018

This was changed in #6026. This was changed because we had a lot of reports of cargo install thing-from-crates.io cross compiling because the cwd happend to be in a embedded project.

cc @alexcrichton fall out from your PR.

@dwijnand
Copy link
Member

As suggested in #6026 (comment) cargo install --path . should read .cargo/config in my, and Mark's, opinion.

@xelephas
Copy link
Author

Thanks for the pointer @Eh2406 .

Yes, I agree with @dwijnand and @Mark-Simulacrum , that there should be a way to provide "local configuration"

Just created a feature request (#6498) to keep it tracked.

@dwijnand
Copy link
Member

Nice work. Thank you, @xaon. Are you happy to close this ticket in favour of that tracking issue?

@xelephas
Copy link
Author

Yes @dwijnand , closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants