Skip to content

Add stdarch-gen-common: shared check/bless harness for generators#2157

Open
xonx4l wants to merge 1 commit into
rust-lang:mainfrom
xonx4l:stdarch-gen-common
Open

Add stdarch-gen-common: shared check/bless harness for generators#2157
xonx4l wants to merge 1 commit into
rust-lang:mainfrom
xonx4l:stdarch-gen-common

Conversation

@xonx4l

@xonx4l xonx4l commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds a library crate stdarch-gen-common that gives every generator three modes -:

  1. Write - Generator writes files straight into the committed location.
  2. Check - Generator write into a temporary directory . The crate diffs it against committed and fails on any mismatch without touching the working copy .
  3. Bless - Generator writes into a temp directory the crate then mirrors temp over committed. Adding, overwriting, and deleting files as needed.

Mode is picked via the STDARCH_GEN_MODE env var. The harness only touches files the generator explicitly lists as its own so hand-written files in the same directory are safe.

This PR also hooks stdarch-gen-hexagon to use it as the first example.

r? @folkertdev

@Kobzol

Kobzol commented Jun 9, 2026

Copy link
Copy Markdown
Member

For a bit more context, this is done for the stdarch GSoC project, where we try to integrate stdarch's tests in rust-lang/rust's CI. We want to move the blessing logic out of the CI YAML files and into Rust, to make it easier to reuse, and also share code amongst the various generators.

I'll take a look, but also CC @folkertdev , in case you have in mind who owns this code amongst the stdarch maintainers and who could also chime in.

@rustbot rustbot assigned folkertdev and unassigned Kobzol Jun 9, 2026
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.

3 participants