Skip to content

rust: hash the workspace manifest, lockfile and cargo config above path, anchored at the root - #62

Open
ndbroadbent wants to merge 1 commit into
mainfrom
modules/rust-root-inputs
Open

ndbroadbent wants to merge 1 commit into
mainfrom
modules/rust-root-inputs

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #37, plus a false skip the coordinator found while reviewing #54.

False skip

With path: crates/core, the rust module hashed only files inside crates/core. But cargo reads the workspace's root Cargo.toml (profiles, [workspace.dependencies]) and Cargo.lock, plus every .cargo/config.toml from the crate up to the root. rustup reads the nearest toolchain file. A profile or config change above the crate therefore skipped green.

The module now adds Cargo.toml, Cargo.lock, rust-toolchain, rust-toolchain.toml, .cargo/config.toml and .cargo/config in path and in every directory above it (src/modules/paths.rs: dirs_up, anchored, in_dirs_up). It still adds **/Cargo.toml under path.

#37

Files at the root are anchored there (/Cargo.lock, /rust-toolchain.toml), so with path: . a nested crate's own lockfile is no longer an input. That one was over-inclusive, not a false skip.

Tests

  • New mockci scenario a_crate_below_the_root_reruns_when_files_above_it_change. It covers the root Cargo.toml (a profile), Cargo.lock, .cargo/config.toml, crates/.cargo/config.toml and a new root rust-toolchain.toml. It failed first on main, at the root Cargo.toml.
  • Unit tests: the anchored patterns for a crate below the root, the root anchoring for rust module: anchor its root inputs to the project root #37, and the paths helpers.
  • Docs: the rust README, modules.md and STATUS.

#54's node inputs.rs has its own copy of dirs_up and anchored. Whichever of the two merges second, I'll switch node to paths.rs.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust module: anchor its root inputs to the project root

1 participant