MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / make_isle_source_path_relative

Function make_isle_source_path_relative

cranelift/codegen/build.rs:141–150  ·  view source on GitHub ↗

Strip the current directory from the file paths, because `islec` includes them in the generated source, and this helps us maintain deterministic builds that don't include those local file paths.

(
    cur_dir: &std::path::Path,
    filename: &std::path::Path,
)

Source from the content-addressed store, hash-verified

139/// includes them in the generated source, and this helps us maintain
140/// deterministic builds that don't include those local file paths.
141fn make_isle_source_path_relative(
142 cur_dir: &std::path::Path,
143 filename: &std::path::Path,
144) -> std::path::PathBuf {
145 if let Ok(suffix) = filename.strip_prefix(&cur_dir) {
146 suffix.to_path_buf()
147 } else {
148 filename.to_path_buf()
149 }
150}
151
152fn build_isle(
153 crate_dir: &std::path::Path,

Callers 1

build_isleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected