-
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
A way to verify that --config KEY=VALUE
with a complex TOML key is modifying the config in the desired way
#11667
Comments
Thanks for the well-written report!
Cargo configurations (
IIRC there is an unstable command cargo +nigntly -Z unstable-options \
--config "target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))'.runner = 'my-runner'" \
config get --show-origin
It is not immediately clear what you mean. The |
@weihanglo thanks for the reply!
I think this might be the source of my problems. I want to specifically override a value from Cargo.toml in Otherwise, the unstable
With |
#6583 seems very much related to what I originally wanted. |
#9301 > tracking issue for Tested
I guess this solves the problem as described in the OP. |
It's not anything special; the whole key is just a string in TOML. Cargo parses it to give it the ability to specify stuff conditionally, similar to what |
Problem
I'm trying to use the
--config
argument with accordance to the docs ...reference/config.html#command-line-overrides. The "Example of a complex TOML key"looks like the functionality that I'm after, but when trying to adapt the example to my task, I'm not seeing the desired result.
It would be nice to have a way to sanity check if the right config value was indeed overridden. For example, by outputting the resulting config (with all the defaults and overrides) with a separate command or when
-vv
flag is set.I'm very new to Rust, so having difficulties navigating the codebase. I see that the
clap
crate is used to parse the command line arguments, but I don't see anything TOML related in its docs, so I assume it just collects String values and parsing and merging done somewhere else, can't find where. In the Cargo Contributor Guide/Architecture/Files I see:Can't find a place where the merging takes place in those files either (but I might be entirely missing it).
Summary
Basically, I'm looking for a place to shove in a
dbg!(merged_config)
and see the results of my--config KEY=VALUE
manipulations. And if this was a standard feature with-vv
or a separate flag - it would be great.Proposed Solution
-vv
flag is set or with a separate flag/command.The text was updated successfully, but these errors were encountered: