Skip to content

Conversation

@weihanglo
Copy link
Member

@weihanglo weihanglo commented Oct 31, 2025

What does this PR try to resolve?

When optional=true Cargo silently skip missing config-include files.

Example config:

[[include]] path = 'optional-config.toml' optional = true

Part of #7723 (comment).

How to test and review this PR?

CI passes.

In the updated doc,
I am a bit not sure whether we should have standalone sections
like include.path and include.optional,
as we cannot really set include.path = "config.toml" directly.
Or maybe include[].path is good for heading?

Capture current behavior where optional field is not yet supported.
When `optional=true` Cargo silently skip missing config-include files. Example config: ```toml [[include]] path = 'optional-config.toml' optional = true ```
Restructure config-include documentation: - Brief intro with examples - Added the "Documentation updates" subsection I am a bit not sure whether we should have standalone sections like `include.path` and `include.optional`, as we cannot really set `include.path = "config.toml"` directly. Or maybe `include[].path` is good for heading?
@rustbot rustbot added A-configuration Area: cargo config files and env vars A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 31, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@epage epage added this pull request to the merge queue Oct 31, 2025
Merged via the queue into rust-lang:master with commit 598878b Oct 31, 2025
25 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 31, 2025
@weihanglo weihanglo deleted the config-include-optional branch October 31, 2025 02:58
bors added a commit to rust-lang/rust that referenced this pull request Nov 1, 2025
Update cargo submodule 6 commits in 6c1b6100343691341b9e76c5acc594e78220f963..6368002885a04cbeae39a82cf5118f941559a40a 2025-10-28 16:27:52 +0000 to 2025-10-31 14:31:52 +0000 - feat(build-analysis): emit timing-info log (rust-lang/cargo#16179) - Remove libc pin message (rust-lang/cargo#16182) - feat(config-include): add optional field support (rust-lang/cargo#16180) - feat(config-include): support inline and array of tables (rust-lang/cargo#16174) - test(script): Update from rustc's test suite (rust-lang/cargo#16169) - Fix links for options in man pages (rust-lang/cargo#16172) r? ghost
bors added a commit to rust-lang/rust that referenced this pull request Nov 1, 2025
Update cargo submodule 6 commits in 6c1b6100343691341b9e76c5acc594e78220f963..6368002885a04cbeae39a82cf5118f941559a40a 2025-10-28 16:27:52 +0000 to 2025-10-31 14:31:52 +0000 - feat(build-analysis): emit timing-info log (rust-lang/cargo#16179) - Remove libc pin message (rust-lang/cargo#16182) - feat(config-include): add optional field support (rust-lang/cargo#16180) - feat(config-include): support inline and array of tables (rust-lang/cargo#16174) - test(script): Update from rustc's test suite (rust-lang/cargo#16169) - Fix links for options in man pages (rust-lang/cargo#16172) r? ghost
@rustbot rustbot added this to the 1.93.0 milestone Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-configuration Area: cargo config files and env vars A-documenting-cargo-itself Area: Cargo's documentation

3 participants