Repository navigation
fix(deps): declare dirs as a Windows-only dependency - #4465
Merged
Merged
Conversation
This was referenced Oct 13, 2026
Closed
max-sixty
pushed a commit
that referenced
this pull request
Oct 13, 2026
…s new worktree (#4466) `test_promote_bare_repo_with_worktrees` failed during setup in nightly [run 38353472092](https://github.com/max-sixty/worktrunk/actions/runs/38353472092). Its plain `git worktree add` against the bare fixture died with `fatal: could not open 'worktrees/worktree/locked' for writing: No such file or directory`. This is the second occurrence: #3918 recorded the same failure in August and closed it as a one-off. The cause is Git's own auto-maintenance. The test's `git push` into the bare repo makes `receive-pack` start `git maintenance run --auto --quiet --detach` in that repo, which keeps running after the push returns. Under Git 2.55, auto-maintenance includes the `worktree-prune` task, and that task deletes any `worktrees/<name>` directory without a `gitdir` file. `git worktree add` leaves exactly that state for a moment, between creating `worktrees/<name>` and writing its `locked` file. If the detached maintenance scans during that moment, it removes the directory, and the write fails with ENOENT. The test now sets `maintenance.auto=false` in the bare repo before pushing. It has to be repo config: `receive-pack` strips `GIT_CONFIG_*` from its environment for local transports, so the suite's hermetic env never reaches it. <details><summary>What was verified locally (git 2.55.0)</summary> - A GIT_TRACE2 trace of the push shows `receive-pack` spawning `git maintenance run --auto --quiet --detach`. - In a bare repo, `git maintenance run --auto` deletes a hand-made `worktrees/x` directory that has no `gitdir` file. - Passing `maintenance.auto=false` through `GIT_CONFIG_COUNT` does not stop the push's maintenance child. The same setting in the bare repo's config does: the trace then shows no maintenance child. - The timing overlap itself did not reproduce. 300 serial runs of the fixture sequence all passed, so the race needs CI-level load. The fix removes the deleting process rather than narrowing the window. - `cargo test --test integration step_promote` passes. </details> `git commit` also spawns detached auto-maintenance, but the suite's hermetic env could turn that off. Every failure seen so far came through the push path, so this PR leaves the commit path alone. The other failure in the same run, `dirs` reported unused by udeps, is fixed separately in #4465. Refs #4464 — automated triage Co-authored-by: worktrunk-bot <[email protected]>
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #4436 removed the
dirs::data_dir()fallbacks, the only remaining use ofdirsisdirs::document_dir()inside#[cfg(windows)]insrc/shell/paths.rs(powershell_profile_paths). The nightlycheck-unused-dependenciesjob runscargo udeps --all-targetson Linux, and in run 38353472092 it reportsdirsas unused. This PR movesdirsinto a[target.'cfg(windows)'.dependencies]table so Linux and macOS builds no longer pull it in.Cargo.lockis unchanged.I couldn't run
cargo udepslocally because it needs a nightly toolchain. The Windows build in this PR's CI confirms thatdirsstill resolves where it's used.The same nightly run had a second, unrelated failure, a race in
test_promote_bare_repo_with_worktrees. #4466 fixes it separately.Refs #4464 — automated triage