-
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
Tracking Issue for cargo config
#9301
Comments
This isn't actually a backwards-compatible change - the old |
Revert this issue when <rust-lang/cargo#9301> stabilizes.
8494: CARGO: Retrieve config information r=vlad20012 a=avrong Adds the ability to get config properties using `cargo config get` subcommand tracked in rust-lang/cargo#2362. It can be improved in the future as rust-lang/cargo#9301 features will be implemented. Currently, it retrieves the config values of a specified path and parses them into a tree. Methods like `getBuildTarget` and `getEnvParams` return specific structured data Co-authored-by: vlad20012 <[email protected]>
It looks like there currently is no way to distinguish "this config key does not exist" from other errors like non-existing manifest files and things like that. Are there plans to improve that? |
Sorry, I don't understand the question. |
This came up in rust-lang/miri#3078. We want to check whether |
I think simple |
Thanks, the link is now fixed. |
Summary
Original issue: #2362Nightly: cargo config subcommand
Implementation: #9302
Design doc: https://hackmd.io/@ehuss/rkjp32Fg_
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#cargo-config
Issues: Z-cargo-config
cargo config
is a new subcommand for displaying config values.Unresolved issues
cargo config get
also includes sensitive information liketoken
. Should there be some way to redact or remove sensitive things?Future extensions
set
anddelete
subcommands.Needs a comment-preserving toml editor.edit
subcommand which launches an editor. There are some decisions to be made on how it decides which file to edit.config get 'target."cfg(target_os=\"linux\")".runner'
Unfortunately toml doesn't expose the parsing functions to make this easy. Could dofrom_str("{} = 1", key)
, and then collect all the key components. I wouldn't want that in the normal Config.get() path, though, for performance. I think it is fine to stabilize without this, since it can be added later, and is probably not a use case that I can imagine anyone needing.toml-value
,toml-table
,sh-value
. The only one that seems useful to me issh-value
, but I'm uncertain how that could handle maps (maybe just error in that case?).--show-origin
and--merged=no
only supports TOML. I don't know how JSON could display either of those, and I don't think it is important.--includes=no
flag to disable include handling. I'm not sure if that is really necessary. The--merged=no
flag will show includes and where values are coming from.cargo config
does not fetch values fromCargo.toml
. This could be confusing for things like profiles. There could be a flag like--merge-manifest
or--manifest=Cargo.toml
to support that?build.rustflags
won't necessarily get the flags cargo actually uses. Maybeconfig get
could have special "computed" keys that take this into consideration? (see design doc)About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
The text was updated successfully, but these errors were encountered: