bazel
bazel copied to clipboard
Use backslashes in executable paths when remotely executing on Windows
.bat
scripts can only be executed on Windows when their paths use backslashes, not forward slashes. For this reason, local execution carefully replaces forward slashes with backslashes in the executable of a Spawn
when executing on Windows.
This commit adds equivalent logic for the case of remote execution on Windows from any host:
- Remote execution replaces forward slashes with backslashes in the first argument when executing on Windows.
- Most calls to
PathFragment#getCallablePathString
are replaced with the new execution platform awaregetCallablePathStringForOs
. This affects test actions, in which various wrappers execute different executables (e.g.--run_under
targets) and thus can have Bazel-controlled executable path strings in locations other than theargv[0]
.
Fixes #11636