Skip to content

fix(bans): report checksums for denied build scripts - #880

Merged
Jake-Shadle merged 3 commits into
EmbarkStudios:mainfrom
ychampion:fix-build-script-deny-checksum
Jul 9, 2026
Merged

fix(bans): report checksums for denied build scripts#880
Jake-Shadle merged 3 commits into
EmbarkStudios:mainfrom
ychampion:fix-build-script-deny-checksum

Conversation

@ychampion

Copy link
Copy Markdown
Contributor

Summary

  • Find build scripts by the custom-build target kind instead of a generated target name.
  • Include the actual build script path and sha256 in build-script-not-allowed diagnostics.

Why

Non-default build scripts are named from their file stem in cargo metadata, e.g. build-script-main, so matching only build-script-build skipped the build script path. That left #765 without the hash needed for a bypass entry.

Fixes #765.

Validation

  • cargo test shows_non_default_build_script_checksum --test bans_build -- --nocapture - failed before the fix, passed after
  • cargo test --test bans_build -- --nocapture - passed
  • cargo fmt --all -- --check - passed
  • cargo clippy --all-targets -- -D warnings - passed

@ychampion
ychampion requested a review from Jake-Shadle as a code owner July 8, 2026 08:50
Copilot AI review requested due to automatic review settings July 8, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Constraint: cargo-deny diagnostics need to expose the actual custom-build target path and hash so users can write bypass entries for non-default build scripts.\nRejected: matching only the generated build-script-build target name | non-default build scripts use names like build-script-main in cargo metadata.\nConfidence: high\nScope-risk: narrow\nDirective: Keep build script target discovery based on TargetKind::CustomBuild rather than generated target names.\nTested: cargo test shows_non_default_build_script_checksum --test bans_build -- --nocapture; cargo test --test bans_build -- --nocapture; cargo fmt --all -- --check; cargo clippy --all-targets -- -D warnings\nNot-tested: full test suite
@Jake-Shadle
Jake-Shadle force-pushed the fix-build-script-deny-checksum branch from a839300 to 740309d Compare July 9, 2026 16:09
@mergify

mergify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Jake-Shadle
Jake-Shadle merged commit 0f60d90 into EmbarkStudios:main Jul 9, 2026
14 checks passed
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.

Bug: bans.build allow-build-scripts error does not show computed hash when using non-default build script path

3 participants