Repository navigation
Conversation
…g built
build.rs took the crate's directory from env!("CARGO_MANIFEST_DIR"), which
is fixed when the script is compiled. Cargo reuses a compiled build script
in another checkout that shares the target directory: its dep-info records
only workspace-relative paths, so a git worktree with the same sources
gets the same script. That script then hashes (and reads) the first
checkout's files. Once that checkout is removed, every build of the other
one fails with "read shader translator source: ... cannot find the path
specified", and while both exist the translator source id is made from
the wrong tree.
The script now reads CARGO_MANIFEST_DIR when it runs, as Cargo documents
for build scripts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
bmjask
left a comment
There was a problem hiding this comment.
No code-level defect found: reading CARGO_MANIFEST_DIR at build-script runtime correctly makes a reused build-script binary resolve the active checkout. This bug fix still lacks the repository-required regression test: add a shared CARGO_TARGET_DIR/two-worktree case that fails without the change where feasible. The current Windows build/test check also failed with generic exit-code metadata, so please provide a green rerun before merge.
crates/xcl/build.rstook the crate's directory fromenv!("CARGO_MANIFEST_DIR"), which is fixed when the build script is compiled. Cargo reuses a compiled build script in another checkout that shares the target directory: the script's dep-info lists only workspace-relative paths, so a git worktree with the samebuild.rsgets the same script binary. That script then reads and hashes the first checkout's translator sources. While both checkouts exist,XCL_TRANSLATOR_SOURCE_IDis made from the wrong tree. Once the first one is removed, every build of the other that reruns the script fails:The script now reads
CARGO_MANIFEST_DIRwhen it runs, as Cargo documents for build scripts.What is in it
crates/xcl/build.rs:rootcomes fromstd::env::var_os("CARGO_MANIFEST_DIR")at run time instead ofenv!. Nothing else changes.Tested
main68a284a: worktree A builds-p xclwithCARGO_TARGET_DIRset to checkout B's target. Worktree A is moved away (git worktree move). In B,touch crates/xcl/src/gpu/dxbc.rsandcargo build -p xclfail with the panic above. The script binary intarget/debug/build/xcl/<hash>/out/contains worktree A's path.cargo test --workspace --no-fail-fast -- --test-threads=4: 1289 passed, 1 failed, 46 ignored. The failure isgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, which fails onmain68a284atoo (1219 passed, 1 failed, 26 ignored in the lib tests on both) and was fixed onmainby Tests: check divergent block barriers in a_bridged_mask_write #2420 after this run.f16_programs_on_the_gpu,f32_programs_on_the_gpu,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpuandheap_window_out_of_memory_falls_back_to_the_switch_form.STATUS_ACCESS_VIOLATIONafter that failure. It did not recur in two lib-only reruns or the full run above, and does not involve the build script.Regression run
scripts/smoke.ps1of a retail title, 60 s each,mainand this branch's head:Not tested
gnutarget).cargowith--remap-path-prefixor a vendored build.AI use
🤖 Generated with Claude Code