Skip to main content

load_program_with_root

Function load_program_with_root 

Source
pub fn load_program_with_root(
    entry: &Path,
    root: &Path,
) -> Result<Program, LoadError>
Expand description

Load a multi-file Lex program like load_program, but derive mangling prefixes from each file’s path relative to root instead of its absolute path.

Use this whenever the same logical package can be loaded from a different directory each time — an unpacked upload, a CI checkout, a scratch clone — and the mangled names it produces must match across those loads (#826). Files that do not live under root keep the absolute-path key, as do all files if root cannot be canonicalized.