From ea5d2b5dbbe3c9f1089653c492ae10c1bf5252a9 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 13 Nov 2026 18:43:40 -0800 Subject: [PATCH] The dev tools find the fixtures beside the crate the test runner names devtools::fixtures_dir() returned the validation crate's fixtures/public beside the dev-tools crate as it was built (env! of CARGO_MANIFEST_DIR at compile time). A nextest archive built on one machine and run on another, as the GPU nodes now run every device leg (built on msi, carried to um790), therefore read the build machine's paths and found no fixtures. It now looks first beside the manifest directory the test runner names at run time (cargo test and cargo nextest set CARGO_MANIFEST_DIR for the test's crate; a run with --workspace-remap names it in that machine's checkout), and falls back to the build-time path where that directory has no fixtures. Test infrastructure only (metal2vulkan-devtools, unpublished); no product path reads it. Verified (devcopy, 5c30935a78): validation-lane archives built on msi ran their fixture tests on um790 (the XTX device_copy run 27511 and the 2080 run 27575 read their fixtures through it). --- crates/metal2vulkan-devtools/src/lib.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/crates/metal2vulkan-devtools/src/lib.rs b/crates/metal2vulkan-devtools/src/lib.rs index 39726ca75..42f936062 100644 --- a/crates/metal2vulkan-devtools/src/lib.rs +++ b/crates/metal2vulkan-devtools/src/lib.rs @@ -35,13 +35,21 @@ pub mod stitched; pub mod tools; pub mod xr_bicubic; -/// The validation crate's `fixtures/public` beside this crate -/// (`crates/metal2vulkan-validation/fixtures/public`, read-only). +/// The validation crate's `fixtures/public` (`crates/metal2vulkan-validation/fixtures/public`, +/// read-only): beside the manifest directory the test runner names as a test runs (`cargo test` +/// and `cargo nextest` name the test's crate; a run of a nextest archive on another machine names +/// it in that machine's checkout, `--workspace-remap`), else beside this crate as it was built. pub fn fixtures_dir() -> PathBuf { - Path::new(env!("CARGO_MANIFEST_DIR")) - .parent() - .expect("the dev-tools crate lies in the workspace's crates/") - .join("metal2vulkan-validation/fixtures/public") + let beside = |manifest: &Path| { + (manifest.parent()).map(|crates| crates.join("metal2vulkan-validation/fixtures/public")) + }; + let running = std::env::var_os("CARGO_MANIFEST_DIR") + .and_then(|manifest| beside(Path::new(&manifest))) + .filter(|fixtures| fixtures.is_dir()); + running.unwrap_or_else(|| { + beside(Path::new(env!("CARGO_MANIFEST_DIR"))) + .expect("the dev-tools crate lies in the workspace's crates/") + }) } /// [`fixtures_dir`]'s `engine` (read-only; the engine's own fixtures).