Skip to content

fix(cli): bundle report templates when installed from crates.io - #877

Merged
simoncozens merged 1 commit into
fonttools:mainfrom
jakefleming:fix/bundled-templates
Sep 4, 2026
Merged

fix(cli): bundle report templates when installed from crates.io#877
simoncozens merged 1 commit into
fonttools:mainfrom
jakefleming:fix/bundled-templates

Conversation

@jakefleming

@jakefleming jakefleming commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The build script zipped ../templates, which is outside the crate root and therefore missing from the published package; cargo install builds then embedded an empty zip, so ~/.fontspector was never populated and --html/--ghmarkdown failed with TemplateNotFound. Move the templates into the crate so they are packaged, write the zip to a growable buffer instead of a fixed 64KB array (which also embedded trailing zero padding), and fail the build if no templates are found.

Fixes #722, fixes #119

@simoncozens

Copy link
Copy Markdown
Collaborator

Thank you! Have been trying to track down this bug for ages and never quite understood it.

The build script zipped ../templates, which is outside the crate root
and therefore missing from the published package; cargo install builds
then embedded an empty zip, so ~/.fontspector was never populated and
--html/--ghmarkdown failed with TemplateNotFound. Move the templates
into the crate so they are packaged, write the zip to a growable
buffer instead of a fixed 64KB array (which also embedded trailing
zero padding), and fail the build if no templates are found.

Fixes fonttools#722, fixes fonttools#119
@simoncozens
simoncozens force-pushed the fix/bundled-templates branch from 6751782 to 8cb821d Compare September 4, 2026 09:39
@simoncozens
simoncozens added this pull request to the merge queue Sep 4, 2026
Merged via the queue into fonttools:main with commit 49980ff Sep 4, 2026
7 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.

TemplateNotFound error for HTML and markdown templates --html option doesn’t work

2 participants