ci(windows): cargo test relinks the running xtask.exe (Access is denied) #32

Open
opened 2026-11-11 08:42:34 +00:00 by charles · 0 comments
Owner

Seen on runs 13-18 (task/2-proto-primitives at 281ce70 / 36d484c, task/15-status-api at 3819789); logs in releases ci-log-13..18-windows.

cargo xtask ci runs debug/xtask.exe from the shared CARGO_TARGET_DIR. Its test step runs cargo test --workspace, which builds the xtask bin for xtask/tests/ci_smoke.rs. Once a crate adds dependencies that change workspace feature unification (e.g. windows-sys via a dev-dependency), cargo relinks xtask.exe, and Windows cannot replace a running executable:

error: failed to remove file C:\fcargo\fluxer-native\debug\xtask.exe
Caused by: Access is denied. (os error 5)

Steps: on Windows, on any branch whose cargo test --workspace feature set differs from cargo run -p xtask, run cargo xtask ci.

Worked around in CI on PR #29 (commit 689e9c9): the Windows job runs xtask with --target-dir %CARGO_TARGET_DIR%-xtask. Still open: a developer running cargo xtask ci on a Windows machine hits the same error; the alias in .cargo/config.toml (or xtask itself) needs a real fix. Other open task branches need to rebase onto foundation to pick up the CI workaround.

Seen on runs 13-18 (task/2-proto-primitives at 281ce70 / 36d484c, task/15-status-api at 3819789); logs in releases ci-log-13..18-windows. `cargo xtask ci` runs `debug/xtask.exe` from the shared `CARGO_TARGET_DIR`. Its `test` step runs `cargo test --workspace`, which builds the xtask bin for `xtask/tests/ci_smoke.rs`. Once a crate adds dependencies that change workspace feature unification (e.g. windows-sys via a dev-dependency), cargo relinks `xtask.exe`, and Windows cannot replace a running executable: error: failed to remove file C:\fcargo\fluxer-native\debug\xtask.exe Caused by: Access is denied. (os error 5) Steps: on Windows, on any branch whose `cargo test --workspace` feature set differs from `cargo run -p xtask`, run `cargo xtask ci`. Worked around in CI on PR #29 (commit 689e9c9): the Windows job runs xtask with `--target-dir %CARGO_TARGET_DIR%-xtask`. Still open: a developer running `cargo xtask ci` on a Windows machine hits the same error; the alias in `.cargo/config.toml` (or xtask itself) needs a real fix. Other open task branches need to rebase onto foundation to pick up the CI workaround.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#32
No description provided.