Windows: cannot delete file from test's temp directory #7173
Labels
area-Windows
Windows-specific issues and feature requests
P1
I'll work on this now. (Assignee required)
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
type: bug
Description of the problem / feature request:
While repeatedly running tests, I somehow ended up with a stale file in the test's temp directory that Bazel was unable to delete.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE
file: emptyBUILD
file:sh_test(name="x", srcs=["test.sh"])
test.sh
file:#!/bin/true
devbazel.exe test :x
devbazel.exe info execution_root
, copy-paste the result to a temporary text file somewhere. For me this isC:/_bazel/iwcf5f5r/execroot/__main__
._tmp/
, under which there's only one directory with a name that looks like a hash code. Mine is5eb2acb906008def159de940fca5b1a2/
.workspace/NUL
file. I don't know how I originally ended up with this file, but this is what triggers the bug. Create it like so:mkdir -p C:/_bazel/iwcf5f5r/execroot/__main__/_tmp/5eb2acb906008def159de940fca5b1a2/workspace && touch C:/_bazel/iwcf5f5r/execroot/__main__/_tmp/5eb2acb906008def159de940fca5b1a2/workspace/NUL
-t-
:devbazel.exe test -t- :x
I found out that the culprit is that
src/main/native/windows/file.cc:DeletePath
receives a path with forward slashes and does not convert it to Windows-style-with-UNC-prefix before passing it to Windows API functions.What operating system are you running Bazel on?
Windows 10
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.see repro above
The text was updated successfully, but these errors were encountered: