Skip to content

Conversation

@weihanglo
Copy link
Member

What does this PR try to resolve?

Part of #7723 (comment)

Both are now supported:

include = ['simple.toml', { path = 'other.toml' }]

and

[[include]]
path = 'first.toml'

[[include]]
path = 'second.toml'

So in the future we can extend field like optional or if
in the include table

How to test and review this PR?

On the implementation side,
To avoid misuse of GlobalContext::get<ConfigInclude>,
I chose not using serde deserialization,
and instead did manual table extraction

@rustbot rustbot added A-configuration Area: cargo config files and env vars S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 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

@weihanglo weihanglo added the Z-config-include Nightly: `include` config key label Oct 30, 2025
Both are now supported

```
include = ['simple.toml', { path = 'other.toml' }]
```

```
[[include]]
path = 'first.toml'

[[include]]
path = 'second.toml'
```

So in the future we can extend field like `optional` or `if`
in the include table

On the implementation side,
`ConfigInclude` intentionally doesn't derive serde deserialization
to avoid any misuse of `GlobalContext::get::<ConfigInclude>()`,
which might lead to wrong config loading order.
@epage epage added this pull request to the merge queue Oct 30, 2025
Merged via the queue into rust-lang:master with commit e1a37a3 Oct 30, 2025
25 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 30, 2025
@weihanglo weihanglo deleted the include-table branch October 30, 2025 18:52
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 Z-config-include Nightly: `include` config key

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants