Repository navigation
fix(mip): dump --stacks; remove the dead HostPath build dep variant - #842
Merged
norrietaylor merged 2 commits intoJul 20, 2026
Merged
Conversation
`mip dump --stacks` and any package with a `HostPath` build dep both reached `todo!()` macros in `cmd_dump` and panicked at runtime, even though the flag parses and the dependency is valid. Implement the `--stacks` output branch: collect stacks from the graph, filter them by the shared `--name`/`--exact` query, and sort by name so the JSON dump is stable across runs (stacks live in a `HashMap`). The `DumpKind` clap group is `required = true, multiple = false`, so the remaining match arm is genuinely unreachable. Map `BuildDep::HostPath` to a new `PkgRef::HostPath` variant in `pkg_ref_from_input`, making the match exhaustive over every `BuildDep` variant so a future addition fails to compile rather than panic.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…iant The `HostPath` build-dep was `#[allow(dead_code)]` throughout, was never materialized into a build sandbox, and only ever reached a `todo!()` when a package carrying one was dumped. Rather than handle that panic (as the previous commit did for `mip dump`), remove the variant outright: - Drop the `HostPath` type and its `BuildDep` contract arm from the Nickel stdlib (and `'Path` from `Tys`). - Remove `ObjTy::Path` and `from_term_hostpath` from decode. - Remove the `BuildDep::HostPath` variant and every match arm across graph (loader, spec_hasher, transitives, planner, graph, wire). - Remove `NodeData::HostPath` and the `--hostpath-deps` flag from `mip dep`, and revert the `PkgRef::HostPath` mapping in `mip dump` (the match over `BuildDep` is now exhaustive without it). The two golden-hash tests in `graph::spec_hasher` that used a HostPath dep as filler now build their spec in Rust, so the hash is deterministic across architectures and no longer needs the `arch_hash!` macro. BREAKING CHANGE: the `HostPath` build-dep type is removed from the Nickel stdlib; a config using `| HostPath` no longer parses. It was non-functional (never built; dumping it panicked), so no working configuration is affected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
twitchyliquid64
approved these changes
Jul 20, 2026
norrietaylor
marked this pull request as ready for review
July 20, 2026 21:39
norrietaylor
deleted the
inbox-patch/dump-stacks-hostpath-17ee74b735356ff1
branch
July 20, 2026 21:39
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.
Fixes #838
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABJPmOPg
Problem
crates/mip/src/cmd_dump.rshad two reachabletodo!()macros that panicked at runtime on advertised flag combinations:cmd_dump()only handledDumpKind { packages: true, stacks: false };mip dump --stacks(the required-group alternative to-p/--packages) fell through totodo!("output not implemented: {:?}", args.kind).pkg_ref_from_input()matched onlyBuild,Local,Subset, andSource, so aBuildDep::HostPath— the one remainingBuildDepvariant — hit_ => todo!("bsi variant {:?}", i). Any package with a host-path build dep panicked the dump.Fix
This PR is two commits:
1.
fix(mip): dump --stacks and HostPath deps instead of panickingAdds a
--stacksoutput branch that collects stacks viagraph.iter_stacks(), applies the same--name/--exactfilter the packages path uses, and sorts by name (stacks live in aHashMap, so deterministic ordering matters). The filtering/sorting is factored into a small pureselect_stackshelper — mirroring how #146 extractedresolve_targetsocmd_dumpinternals stay unit-testable without aContext.2.
refactor(decode,graph,mip)!: remove the unused HostPath build dep variantRather than handle the
HostPathpanic, this removes the variant entirely.BuildDep::HostPathwas#[allow(dead_code)]throughout, was never materialized into a build sandbox, and only ever reached atodo!()when dumped — aspirational, never-functional surface. Removing it:HostPathtype and itsBuildDepcontract arm from the Nickel stdlib (and'PathfromTys).ObjTy::Pathandfrom_term_hostpathfrom decode.BuildDep::HostPathvariant and every match arm across graph (loader, spec_hasher, transitives, planner, graph, wire). The matches overBuildDepare now exhaustive without a wildcard, so a future variant fails to compile instead of reintroducing a runtime panic.NodeData::HostPathand the--hostpath-depsflag frommip dep, and reverts thePkgRef::HostPathmapping added in commit 1.The two golden-hash tests in
graph::spec_hasherthat used a HostPath build dep as filler now construct their spec in Rust instead of via Nickel, so the hash is deterministic across architectures and no longer needs thearch_hash!macro.BREAKING CHANGE: the
HostPathbuild-dep type is removed from the Nickel stdlib; a.nclusing| HostPathno longer parses. It was non-functional (never built; dumping it panicked), so no working configuration is affected.Verification
All commands run from the workspace root:
cargo fmt --all— clean, no drift.cargo clippy --workspace --all-targets -- -D warnings— exit 0, no warnings.cargo test --workspace— exit 0; every test binary passed. The rewrittenattrs_hash/subset_hashgolden-hash tests pass with single architecture-independent hashes.