Run xtask in the invoking Cargo worktree #3591
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3591
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3591"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Yoshi-233 on GitHub · 2026-11-30 01:24 UTC · original
Yoshi-233:fix/xtask-worktree-root→main· +8 −0 · 1 files · 1 commits · openWhat it changes
Use the manifest directory Cargo supplies at invocation to choose the checkout for
cargo xtask. When multiple worktrees share a target directory, Cargo can reuse the same executable. Its compile-time manifest directory then points at the checkout where it was built. The old code could report the staged-file count from a different worktree.The runtime path is used when its parent has the repository marker. Direct execution without Cargo's manifest environment keeps the existing fallback.
How it was tested
CARGO_TARGET_DIRfor both and rancargo xtask policy --stagedin A and then B. Main reported 1 and 1. The patched tool reported 1 and 2. No rule or list of accepted files was changed.--manifest-pathpointing at B: it reported 2. All-targets Cargo check and strict Clippy passed on Linux.crates/victory-loader/src/heap_sites/frame_users.rs. The staged-file policy check passed for this PR.Windows CI stopped in the first Clippy step on the unchanged
crash.rs:804unused-function diagnostic forunwind_copy. The test step did not run. PR check · Same main commitChecked for overlap
@babuakhil on GitHub · 2026-11-30 17:20 UTC · original
Checked on Windows 11 with Cargo 1.98.1 (pinned), on
main(84bd61e2); cherry-picks cleanly. This matters more than a wrong count: onmain, the pre-commit check can let a refused file through.Two git worktrees of the same commit share one
CARGO_TARGET_DIR. In the second worktree only, a file namedzz-probe.png(plain text, a probe) is staged. Thencargo xtask policy --stagedruns in each, in the order shown:main, clean worktree first0 files ok.pngstaged:0 files ok, exit 0main,.pngworktree first.png: refused.png0 files ok.png: refused, exit 1.pngworktree first.png: refused0 files okSo on
main, whichever worktree builds xtask first is the one every later run checks, which is the same reuse #3799 fixes invictory-shader's build script. With this PR, each run checks its own worktree. Clippy onxtaskis clean with-D warnings.cargo test -p xtask: 6 passed, 1 failed,repository_passes_policy, the same onmain. On84bd61e2the file it flags is no longerframe_users.rsbutcrates/victory-shader/src/native.rs:1720, a 560-character hex string inloose_metadata_reads_version_0x403(added in698ab79e).@Yoshi-233 on GitHub · 2026-12-01 01:58 UTC · original
Thanks for testing both worktree orders on Windows. The clean-first case shows the impact especially clearly: the old check let the staged
.pngthrough. It’s good to have independent confirmation that the fix checks the right worktree in both orders.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.