refactor(dynamic): enhance path resolution, telemetry, and file handling for better compatibility and clarity

This commit is contained in:
elipeter 2026-05-14 02:37:01 -05:00
parent 8abb023dd0
commit 8211d4fd47
12 changed files with 217 additions and 39 deletions

View file

@ -102,6 +102,12 @@ fn stage_harness(
/// - `None` → `workdir/{filename}` (Python default: import by module name).
/// - `Some("src/entry.rs")` → `workdir/src/entry.rs` (Rust: `mod entry;`).
///
/// Always overwrites the destination so the per-language build hash
/// (`compute_*_source_hash`) reflects the current on-disk source. Leaving a
/// stale destination in place would let the build cache return class files
/// built from a previous fixture revision even after the source on disk has
/// changed.
///
/// Best-effort: silently skips if the file cannot be found or copied.
fn copy_entry_file(spec: &HarnessSpec, workdir: &PathBuf, entry_subpath: Option<&str>) {
let candidates = [
@ -123,9 +129,7 @@ fn copy_entry_file(spec: &HarnessSpec, workdir: &PathBuf, entry_subpath: Option<
};
workdir.join(fname)
};
if !dst.exists() {
let _ = fs::copy(src, &dst);
}
let _ = fs::copy(src, &dst);
return;
}
}