Skip to content

[crater] suppress git SHA in name table version / clear cache when otl-normalizer changes - #2138

Merged
anthrotype merged 2 commits into
mainfrom
crater-stable-fontc-version
Sep 10, 2026
Merged

anthrotype merged 2 commits into
mainfrom
crater-stable-fontc-version

Conversation

@cmyr

@cmyr cmyr commented Sep 9, 2026

Copy link
Copy Markdown
Member

Two commits.

I added logic in #2114 to check when a font generated by fontc was identical to a previous build, so we could skip comparison in that case; however this wasn't working in CI, because fontc stamps its version in the name table, and includes the current git sha. By definition, this sha is different between two crater runs, so the generated fonts were never identical.

This is fixed by suppressing the git bit of the version when building for crater.

@anthrotype an interesting bit of this is that it didn't reproduce locally, since build.rs does not rebuild just because HEAD moves. In CI, we're always cloning the repo from scratch and doing a clean build, so we always run build.rs, but locally it's possible for the sha in the version to be stale. Do we care? I think not, but wanted to at least bring it up.

(The second commit is boring, it just ensures we clear the cache if otl-normalizer has changes)

cmyr added 2 commits September 9, 2026 22:28
fontc stamps its `git describe` version into name ID 5 of every font it
builds. crater only runs when fontc's rev has changed, so that string
differed on every run, which meant that the strategy of skipping the
comparison when fontc's output was unchanged didn't work, since the output
was never unchanged. (It worked locally, because build.rs is not rerun
when HEAD moves.)

vergen uses VERGEN_GIT_DESCRIBE as an override when it is set, and
version_string already maps the VERGEN_IDEMPOTENT_OUTPUT sentinel back
to the crate version -- the tested git-less path that `cargo install`
takes. Setting it when crater builds fontc stamps a stable `;fontc
1.0.0`.

This also adds a new field to the run summary that counts the number of
targets for which fontc's output was identical, which will be useful for
future debuging.
We were clearing when ttx-diff changes, but we want to also clear when
otl-normalizer changes, sicne the cache stores the markkern output.
@anthrotype

Copy link
Copy Markdown
Member

Thanks for the heads up

do we care

Yes I do #2139

@anthrotype
anthrotype added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit 82e9301 Sep 10, 2026
18 checks passed
@anthrotype
anthrotype deleted the crater-stable-fontc-version branch September 10, 2026 06:58
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