bash rlocation on windows returns unnormalized path #22803
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Description of the bug:
On windows, with --enable_runfiles, a bash script calling rlocation will receive a path containing both backslashes and forward slashes. Whether this path can be used appears down to peculiarities of the bash interpreter being used. Msys2 allows it to be read, but not used in eval.
Desired behaviour would be for rlocation to convert any backslashes in the path to forward slashes before return (unix style).
This seems to work:
path1="${path1//\\//}"
Which category does this issue belong to?
External Dependency
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
create a sh_test calling:
BUILD.bazel:
D:\workdir\windows-runfiles-bug>bazel run //test2:test --enable_runfiles
Line 22 is the call to eval
Which operating system are you running Bazel on?
windows
What is the output of
bazel info release
?7.2.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: