Repository navigation
fix(mctx): keep inline-table settings when adding deps - #2244
Merged
norrietaylor merged 3 commits intoOct 18, 2026
Merged
norrietaylor merged 3 commits into
norrietaylor merged 3 commits into
Conversation
add_deps looked up [stack], tasks.<name> and [session] with
as_table_mut, which returns None for TOML inline tables. An
inline session = { ... } was therefore replaced wholesale by a
fresh [session] holding only packages, silently dropping vars,
patches and lifecycle hooks, while inline [stack] and task
tables made the command error out with "could not find".
Use as_table_like_mut so both explicit and inline table forms
are found, and only insert a fresh [session] when the key is
absent. The upsert helper takes ?Sized TableLike for the dyn
returns. Pinned by a test that adds deps through all inline
forms and asserts sibling keys survive the write-back.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
The task and session checks matched the earlier build_packages substring, so they passed without the fix. Parse the written TOML and check each table's own key, that each table stays inline, the RuntimePackages arm, and that a missing task still errors.
Member
|
/review |
Contributor
|
Approved: no findings at Nothing to do. Clobber: none: |
Member
|
/review |
norrietaylor
approved these changes
Oct 18, 2026
Member
There was a problem hiding this comment.
Approved on ARCH PASS at 51ae830.
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Oct 18, 2026
norrietaylor
approved these changes
Oct 18, 2026
Member
There was a problem hiding this comment.
Approved on ARCH PASS at 51ae830.
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Oct 18, 2026
norrietaylor
approved these changes
Oct 18, 2026
Member
There was a problem hiding this comment.
Approved on ARCH PASS at 51ae830.
norrietaylor
deleted the
inbox-patch/fix-mctx-inline-table-add-deps-6ac71f7a116af91e
branch
October 18, 2026 07:35
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vQAA
Problem
min add --session(and the stack/task variants) resolved its targettable with
as_table_mut(), which returnsNonefor TOML inlinetables. Consequences: an inline
session = { ... }was replacedwholesale by a fresh
[session]containing onlypackages, silentlydropping
vars,patchesandlifecycle_hooks; inline[stack]andtasks.<name>tables made the command fail with "could not find".Change
Context::add_depsnow usesas_table_like_mut(), which matches bothexplicit and inline table forms, so a fresh
[session]is onlyinserted when the key is absent. The upsert helper's bound becomes
TableLike + ?Sizedto accept the trait-object returns. All fourAddDepModearms are covered.Verification
cargo test --locked -p mctx add_depsfailed on the unmodified treewith the inline-stack symptom (
could not find [stack]), passesafter the fix (behavioral red/green pin in
add_deps_inline_tables,which asserts sibling keys —
use,exec,vars.ANSWER— survivethe write-back and re-parse into the config).
cargo fmt --all --check— clean.cargo clippy --workspace --all-targets --locked -- -D warnings— clean.cargo test --locked -p mctx— 47 passed, 0 failed.Summary by CodeRabbit