Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Nov 17, 2025

This adds several changes to how environment variables are handled to more closely align with how configs are handled, and to fix an issue with replacing entire tables. The changes are:

  • Top-level tables like MDBOOK_BOOK now replace the contents of the book table instead of merging it. This adds consistency with how all the other environment objects work.
  • Fixed allowing top-level replacement of MDBOOK_BOOK and MDBOOK_OUTPUT. This was inadvertently recently broken.
  • Added ability to replace top-level MDBOOK_RUST. I don't recall why that wasn't included.
  • Reject invalid keys like MDBOOK_FOO.
  • Reject unknown keys, like MDBOOK_BOOK='{"xyz": 123}'
  • Reject invalid types, like MDBOOK_BOOK='{"title": 123}'

These currently aren't working as expected.
This adds several changes to how environment variables are handled to
more closely align with how configs are handled, and to fix an issue
with replacing entire tables. The changes are:

- Top-level tables like `MDBOOK_BOOK` now *replace* the contents of the
  `book` table instead of merging it. This adds consistency with how all
  the other environment objects work.
- Fixed allowing top-level replacement of `MDBOOK_BOOK` and
  `MDBOOK_OUTPUT`. This was inadvertently recently broken.
- Added ability to replace top-level `MDBOOK_RUST`. I don't recall why
  that wasn't included.
- Reject invalid keys like `MDBOOK_FOO`.
- Reject unknown keys, like `MDBOOK_BOOK='{"xyz": 123}'`
- Reject invalid types, like `MDBOOK_BOOK='{"title": 123}'`
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Nov 17, 2025
@ehuss ehuss enabled auto-merge November 17, 2025 22:42
@ehuss ehuss added this pull request to the merge queue Nov 17, 2025
Merged via the queue into rust-lang:master with commit 8e4bc4a Nov 17, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Nov 17, 2025
ehuss added a commit to ehuss/mdBook that referenced this pull request Nov 17, 2025
@ehuss ehuss added the Breaking Change This would require a SemVer breaking change label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change This would require a SemVer breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants