-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Want env var specifying overriding config file #6728
Comments
This is related to #6699 "Proposal: Command-line config" |
This is almost identical to what #6699 proposes, although it uses toml syntax. Would the toml syntax be particularly difficult to use? |
@ijackson Was just randomly looking through issues and noticed #6699, which accomplishes this same thing in a different manner, was closed. Is that enough for your needs, or do you still need an environment variable solution for some reason? It'd be nice to close this out if that solution meets your needs! |
Cargo commands accept |
I'm going to close due to inactivity. |
One huge downside of One example would be
I really miss The usual file includes don't work for us, we're wrapping Cargo to support a large build matrix, similar to how Tock is doing it. Having only one configuration "active" at one time is quite limiting. |
Problem
I have a situation where I have a
.cargo/config
which is nearly always right, and which I definitely very firmly want to be the default, but I need to be able to occasionally override it.Because cargo simply searches up the directory tree there is no easy way to do this right now. I could override the config settings using env vars, but since some of the settings are tables that is no good.
Proposed solution
There should be an environment variable
CARGO_CONFIG_INCLUDE
which contains a:
-separated list of TOML files. These should be read after all the.cargo/config
files but processed before the command line, so that it overrides config files but is in turn overridden by the command line.On Windows the list should be split (only) on
;
. For the benefit of Windows, to make it possible to be compatible with both Unix and Windows, on Unix the list should be split on;
as well as:
. As a result on Unix:
and;
in filenames would be inexpressible; likewise;
in filenames on Windows. This is the traditional approach to path-like variables.The text was updated successfully, but these errors were encountered: