-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
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.