Repository navigation
feat: make typst fonts more hermetic - #13
Merged
Merged
Conversation
GitHub only exposes asset digests for recent releases, so every run re-downloaded 1.5 GB of archives to hash releases that were already recorded. Read the integrity values back out of versions.bzl first and fall back to downloading only for assets that have neither. Sort the generated mapping so a new release shows up as an addition rather than reordering the whole file.
write_source_file runs plain diff when its test fails, which dumps xref offsets and compressed font streams into the log; a ten page document produces several hundred lines of noise. Pass --brief so the failure reports the file and the command that regenerates it.
Typst searches the host font directories, so a document that renders with a system font embeds whichever build of that font the machine happens to have. Two machines with the same Typst version and the same sources then produce different PDFs, which shows up as an unexplained diff test failure against a checked-in copy. Those directories are not declared inputs, so the action was neither reproducible nor correctly invalidated, and a remote cache hit could carry one machine's fonts to another. Pass --ignore-system-fonts so only the fonts embedded in the pinned compiler are available. The checked-in example PDF is regenerated: its monospace text was picking up a host copy of DejaVu Sans Mono.
A `@preview` import resolves against a system-dependent package directory and download cache, so a document could compile against whatever a developer happened to have in ~/.cache/typst and fail elsewhere. Same failure mode as host fonts. Point --package-path and --package-cache-path at a directory created for the action, alongside the runfiles tree and outside the document root.
The wrapper printed the compiler's stdout and discarded its stderr unless the compile failed. Typst reports an unknown font family as a warning and falls back to a default, so a document could render with the wrong font and leave a clean build log.
Typst defaults to a thread per CPU, which oversubscribes the machine when Bazel schedules several document actions at once. Bazel budgets one CPU per action, so let it own the parallelism. Output is unaffected.
Adds the 0.15.0 and 0.15.1 releases to the version matrix and moves the default to 0.15.1. Existing entries are unchanged. The checked-in example PDF is regenerated: a compiler change moves the output bytes.
Host fonts are no longer searched, so documents that relied on a system font now render with an embedded fallback and every checked-in PDF needs regenerating.
matte1
force-pushed
the
matte1/hermetic-fonts
branch
from
September 1, 2026 20:49
5a70bd8 to
8aeea91
Compare
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.
No description provided.