Repository navigation
fix(config)!: Be more explicit about what ConfigRelativePaths are relative to - #17751
Conversation
…cial program behavior
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| pub fn resolve_root(flag: Option<&str>, gctx: &GlobalContext) -> CargoResult<Filesystem> { | ||
| let config_root = match gctx.get::<Option<ConfigRelativePath>>(["install", "root"])? { | ||
| let config_root = match gctx | ||
| .get::<Option<ConfigRootRelativeProgramPath>>(["install", "root"])? |
There was a problem hiding this comment.
Not blocking: It is unfortunate that this is not really a program path but still use this type.
The deprecation warning has been there since 1.93 (merged in 2025-11-06, released in 2026-01-22). Should we consider make the call and change it?
(also install.root is not in the schema yet)
There was a problem hiding this comment.
(also install.root is not in the schema yet)
Yes, I am slowly working on getting more things in the schema. This is a part of that effort as I'm evaluating each one or whether to manually bake it in or find a way to provide a more structured way of dealing with it, like all of the existing parts of the schema.
| pub struct ConfigRelativePath(Value<String>); | ||
| macro_rules! rel_path { | ||
| ($name:ident) => { | ||
| /// A path, potentially relative to the config, not current_dir |
There was a problem hiding this comment.
Not blocking: Would love to see specific doc for each type.
There was a problem hiding this comment.
Wasn't sure how I wanted to do that with the macro, so I punted.
I wish I could just put the doc on the macro invocation.
|
This is actually more nicer than I thought! |
Update cargo submodule 28 commits in f93c676e3e7ab1aee08dc95d869700f6b99a1a20..ae8f06eb41b8c4a534d0f280f1b9d287f45ead73 2026-11-15 17:27:10 +0000 to 2026-11-21 04:06:35 +0000 - feat(cargo-util-config): expose config loader (rust-lang/cargo#17781) - feat(config): Add IncludeConfig (rust-lang/cargo#17782) - fix(config): `--config` use same layers merge as config files (rust-lang/cargo#17780) - refactor(config): Move include removal up a layer, making include_paths (rust-lang/cargo#17776) - Support wasm64-unknown-emscripten (rust-lang/cargo#17620) - fix(context): merge files and `--config` as layers (rust-lang/cargo#17775) - fix(config)!: Really ensure no comments are present (rust-lang/cargo#17774) - fix(config): list unmerged config in precedence order (rust-lang/cargo#17773) - fix(config): Handle parsing dotted keys using TOML keys (rust-lang/cargo#17770) - fix(config): Improve config schema by implementing Serialize (rust-lang/cargo#17762) - fix(config): drop redundant config merge error context (rust-lang/cargo#17769) - fix(config): keep winning definition for non-mergeable list (rust-lang/cargo#17766) - test(build-analysis): update for new section timing order (rust-lang/cargo#17767) - docs(ref): Deprecate 'workspace.package.authors' (rust-lang/cargo#16951) - Fix git checkout long paths (rust-lang/cargo#17752) - fix(config): layer loads to work the same as merged load (rust-lang/cargo#17761) - refactor(config): Switch another location to `resolve` (rust-lang/cargo#17760) - refactor(config): Cleanup IncludeConfig by adding ConfigParentRelativePath (rust-lang/cargo#17759) - docs(lints): Remove nonexistent lints from cargo::default desc (rust-lang/cargo#17757) - Add period to cargo-toml-vs-cargo-lock.md for clarity. (rust-lang/cargo#17754) - fix(config)!: Be more explicit about what ConfigRelativePaths are relative to (rust-lang/cargo#17751) - Fix ‘dependencoes’ typos (rust-lang/cargo#17753) - refactor(credential)!: replace time with `[email protected]` (rust-lang/cargo#17750) - refactor(context): miscellaneous loader cleanup (rust-lang/cargo#17747) - docs(profiles): fix outdated default (rust-lang/cargo#17748) - chore(config): migrate Renovate config (rust-lang/cargo#17746) - refactor(context): a `ConfigLoader` type (rust-lang/cargo#17745) - refactor: modernize with 1.100 API (rust-lang/cargo#17728)
Update cargo submodule 28 commits in f93c676e3e7ab1aee08dc95d869700f6b99a1a20..ae8f06eb41b8c4a534d0f280f1b9d287f45ead73 2026-11-15 17:27:10 +0000 to 2026-11-21 04:06:35 +0000 - feat(cargo-util-config): expose config loader (rust-lang/cargo#17781) - feat(config): Add IncludeConfig (rust-lang/cargo#17782) - fix(config): `--config` use same layers merge as config files (rust-lang/cargo#17780) - refactor(config): Move include removal up a layer, making include_paths (rust-lang/cargo#17776) - Support wasm64-unknown-emscripten (rust-lang/cargo#17620) - fix(context): merge files and `--config` as layers (rust-lang/cargo#17775) - fix(config)!: Really ensure no comments are present (rust-lang/cargo#17774) - fix(config): list unmerged config in precedence order (rust-lang/cargo#17773) - fix(config): Handle parsing dotted keys using TOML keys (rust-lang/cargo#17770) - fix(config): Improve config schema by implementing Serialize (rust-lang/cargo#17762) - fix(config): drop redundant config merge error context (rust-lang/cargo#17769) - fix(config): keep winning definition for non-mergeable list (rust-lang/cargo#17766) - test(build-analysis): update for new section timing order (rust-lang/cargo#17767) - docs(ref): Deprecate 'workspace.package.authors' (rust-lang/cargo#16951) - Fix git checkout long paths (rust-lang/cargo#17752) - fix(config): layer loads to work the same as merged load (rust-lang/cargo#17761) - refactor(config): Switch another location to `resolve` (rust-lang/cargo#17760) - refactor(config): Cleanup IncludeConfig by adding ConfigParentRelativePath (rust-lang/cargo#17759) - docs(lints): Remove nonexistent lints from cargo::default desc (rust-lang/cargo#17757) - Add period to cargo-toml-vs-cargo-lock.md for clarity. (rust-lang/cargo#17754) - fix(config)!: Be more explicit about what ConfigRelativePaths are relative to (rust-lang/cargo#17751) - Fix ‘dependencoes’ typos (rust-lang/cargo#17753) - refactor(credential)!: replace time with `[email protected]` (rust-lang/cargo#17750) - refactor(context): miscellaneous loader cleanup (rust-lang/cargo#17747) - docs(profiles): fix outdated default (rust-lang/cargo#17748) - chore(config): migrate Renovate config (rust-lang/cargo#17746) - refactor(context): a `ConfigLoader` type (rust-lang/cargo#17745) - refactor: modernize with 1.100 API (rust-lang/cargo#17728)
What does this PR try to resolve?
What these are relative to is part of the schema and yet we loosely defined these such that it was the callers responsibility to get this right.
Benefits:
cargo-util-configThis is also prep for adding a
ConfigParentRelativePathfor use withConfigIncludewhich is part of making that part of the schema available incargo-util-config.Notes to reviewers
🤖 LLM involvement: resolving conflicts, updating of callers adding a new type/resolve