Skip to main content

Module embedded_templates

Module embedded_templates 

Source
Expand description

Proof that this build’s Askama code was compiled from the templates of the checkout it runs in.

The templates are compiled into the crate, so a compiler cache (kache) or a CARGO_TARGET_DIR shared across worktrees can serve a build of another checkout whose templates differ: nv codegen abi --check then “verifies” the host files against the wrong templates. build.rs embeds the bytes of every template into the same compilation as the Askama code, so a replayed build carries the templates it was really compiled from, and verify_embedded_templates compares them with the checkout’s templates/ directory.

Structs§

TemplateDrift
The difference between the templates a build embeds and a templates/ directory on disk.

Functions§

verify_embedded_templates
Fails with CodegenError::StaleTemplates when the templates this build was compiled from differ from templates_dir (the checkout’s packages/core/codegen/templates).