-
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
Give more examples of turning .cargo/config
keys into env vars
#3985
Comments
Note that it's a bug in Cargo if Cargo doesn't read |
Perhaps I misunderstand, but what would the env variables even be for something like [source.vendored-sourced] where the vendored-sources seems to be a user-defined string? |
Oh in general we just have a standard mechanism for defining config values as environment variables |
that doesn't explain at all how to set that, or at least I don't understand it. It says: "For each configuration key above of the form foo.bar the environment variable CARGO_FOO_BAR can also be used to define the value. For example the build.jobs key can also be defined by CARGO_BUILD_JOBS." This doesn't explain how to put this:
into env variables. Also, how can I unset something via env variable that's given in a configuration file? Happy to improve the documentation once I understand that :) |
Oh that would in theory be PRs are of course always welcome to improve the docs! |
.cargo/config
keys into env vars
@alexcrichton It doesn't look like setting environment variables to set source properties like that is supported, and the relevant source code is just looking up "sources" from a hash map, without checking the environment variables. I'll raise a bug for this. |
I'm using cargo in an autoconf-managed build system. I want to auto-generate a part of the .cargo/config file, because Cargo doesn't seem to expose env variables for the vendored sources config options, but where the vendored sources live should be overwritable by the user during ./configure. It seems cargo really wants to be run inside the source tree, but config.status places the generated .cargo/config into the build dir. Copying the entire rust tree of the project from the source dir into the build dir could be a workaround, but instead it'd be neat if cargo allowed to just specify a different location for its config file.
The text was updated successfully, but these errors were encountered: