Repository navigation
refactor(context): a ConfigLoader type - #17745
Merged
Merged
Conversation
so one less thing relying on GlobalContext
Collaborator
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
Author
|
Remembered Ed didn't have a plan doing this so I went ahead. |
epage
reviewed
Nov 16, 2026
| ) -> CargoResult<Option<PathBuf>> { | ||
| let possible = dir.join(filename_without_extension); | ||
| let possible_with_extension = dir.join(format!("{}.toml", filename_without_extension)); | ||
| let path = if same_file::Handle::from_path(&possible).is_ok() { |
Contributor
There was a problem hiding this comment.
I would lean towards keeping the warning logic. We already deal with warnings inside of cargo-util-config.
Contributor
There was a problem hiding this comment.
Not liking this code nor the extension follow up.
However, the removing of the warning flag is nice.
Member
Author
There was a problem hiding this comment.
Let's defer the change for future API polish.
prepare for module extraction
A pure code move.
weihanglo
force-pushed
the
config-loader
branch
from
November 16, 2026 19:25
c20fe90 to
c4b70f1
Compare
epage
approved these changes
Nov 16, 2026
epage
enabled auto-merge
November 16, 2026 19:45
jollaitbot
pushed a commit
to sailfishos-mirror/cargo
that referenced
this pull request
Nov 17, 2026
### What does this PR try to resolve? Some tiny cleanup found during rust-lang/cargo#17745 Reasons to change are recorded in commit messages. --- 🤖 LLM involvement: prototyping in rust-lang/cargo#17745
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Nov 22, 2026
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)
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Nov 22, 2026
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
Like #17699,
this extracts config discovery logic to a
ConfigLoadertype,in order to decouple logic from Cargo
GlobalContext.Notes to reviewers
The API needs more cleanup and polish to be in
cargo-util-config,questions like where should
merge_cli_argsbe,though IMHO it is still a good abstraction
based on what has been done in
ConfigStoreandConfigReader(thanks for that!)
🤖 LLM involvement: prototyping