Windows TCC VTOOLS_NO_CACHE ownership check leaves .v-toolcache-stage directory after compiler exits

Open
#32,698 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active

Research direction

Start with test_ownership_compilations_honour_vtools_no_cache in cmd/v/tests/tool_no_cache_test.v, around line 144, where the .v-toolcache-stage- leftover is asserted. Reproduce on native Windows with a dedicated VTMP, then trace which subprocess creates the stage and when it is removed. Done means the test passes on Windows TCC and GCC with no stage folder left behind, and the invariant is kept rather than bypassed.

Written by the indexing model from the issue text.

Description

Actually executed master CI failure (not parent workflow status): run 44894651647 / job 136822970810, SHA 5e0c913e6..., Windows TCC tools (default shard 1), completed 2026-11-21 13:17 UTC. Tool tests: 46 passed, 5 skipped, 1 real failure (cmd/v/tests/tool_no_cache_test.v). No job timeout or intentionally failing fixture.

In test_ownership_compilations_honour_vtools_no_cache at line 144, the two original nested @VEXE -ownership -check invocations under a private VTMP and VTOOLS_NO_CACHE=1 reach the cleanup assertion, but os.ls(vtmp).filter(it.starts_with('.v-toolcache-stage-')) is not empty:

Left: ['.v-toolcache-stage-0-984-1795266743060000000-0']
Expected: []
temporary ownership compiler left in:
D:\vbb6a87\tmp\tsession_1594_01M7Z3P9AE5Y1JSW8979WXR6Q8\v_ownership_no_cache_3404\shared\vtmp

First/last confirmed: 2026-11-21 13:12–13:17 UTC, SHA 5e0; this is a distinct cleanup/ownership-tools regression, not the earlier #30677 diagnostic about unwritable cache and not the VSH cached-executable timestamp mismatch. Source cmd/v/tests/tool_no_cache_test.v from failing ref to current master 42389d1 is unchanged (blob from Nov18 85e48d7). The test asserts both positive/negative ownership diagnostics and that no stage folder or shared tool cache remains. Do not bypass that invariant.

Next action: On native Windows TCC and GCC repeat the original test with a dedicated VTMP; trace which subprocess creates the stage, whether the stage contains a built executable or partial artifact, exactly when the temporary staged path is removed, and Win32 deletion errors, file handles or delayed child exits. Distinguish a failed rename, open handle, path conversion and racing cleanup; check other current cmd/v compiler changes and overlapping open PRs before a minimal process-lifetime-safe cleanup fix. Then ./v self, ./v fmt, focused test, and original Windows tools integration on the patched revision. No local V/Windows toolchain or corrected-run validation here; unresolved.

[!NOTE]
You can use the 👍 reaction to increase this issue's priority.
[!NOTE]
You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Dominant language
V
Stars
38.1k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
682

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vlang/v

All issues in vlang/v

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.