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

Add a unstable --ignore-local-config flag #8652

Closed
wants to merge 1 commit into from

Conversation

phil-opp
Copy link
Contributor

This adds a new unstable --ignore-local-config flag to all subcommands that makes cargo ignore all .cargo/config files except for the config file in the user's home directory (similar to the behavior of cargo install). This is useful because some config values cannot be reset through command line parameters, e.g. the build.target flag. See #8643 for more motivation.

This is the first time that I'm adding new command line parameters to cargo, so please let me know if I'm doing something wrong.

Fixes #8643

@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2020
@phil-opp
Copy link
Contributor Author

The cache_messages::rustdoc error seems unrelated to this PR, maybe it is caused by the new beta released yesterday?

@ehuss
Copy link
Contributor

ehuss commented Aug 26, 2020

The cache_messages::rustdoc error seems unrelated to this PR, maybe it is caused by the new beta released yesterday?

Thanks, posted #8653 with a fix.

@phil-opp
Copy link
Contributor Author

Thanks! Rebased to rerun CI with your fix.

@ehuss
Copy link
Contributor

ehuss commented Sep 1, 2020

The Cargo team discussed this at our meeting, and we think that something of this nature should probably go through the RFC process. There are a number of issues with how Cargo discovers the config files to load, and we don't want to incrementally add small changes that would accumulate to something complex and difficult to work with. The comment at #7894 (comment) contains links to related issues, which would be a good place to start collecting all the different use cases and problems (and the following comments have more detail).

Perhaps you and @jsgf could maybe collaborate on that?

@phil-opp
Copy link
Contributor Author

phil-opp commented Sep 2, 2020

Thanks for your comment!

I took a look at the linked issues/proposals and tried to categorize and summarize them: https://internals.rust-lang.org/t/problems-of-cargo-config-files-and-possible-solutions/12987

@phil-opp
Copy link
Contributor Author

Closing this in favor of #9030 and the proposal in https://internals.rust-lang.org/t/proposal-move-some-cargo-config-settings-to-cargo-toml/13336. An --ignore-config or --ignore-local-config flag might be still useful when compiling crates that you have no control over (e.g. when running a service like docs.rs), but for most people the new package-specific Cargo.toml keys should be the better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a --ignore-local-config flag for ignoring local .cargo/config.toml files
4 participants