sh_test/binary fails when reading files on windows with --noenable_runfiles #22796
Labels
awaiting-user-response
Awaiting a response from the author
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:
sh_test and sh_binary always fails when reading files on windows when runfiles is disabled.
It does not matter whether the runfiles bash library is used or not, the files cannot be read.
The example below shows the issue with sh_test, you can change sh_test in the example to sh_binary and see exactly the same behaviour.
I've put windows in the title, this is the only platform I have tried this on. I guess it might fail the same on other platforms too.
Which category does this issue belong to?
Local Execution
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
To reproduce:
.bazelrc
BUILD.bazel
file1.txt
test.sh
set RUNFILES_LIB_DEBUG=1
bazel run //test:test --noenable_runfiles --test_output=all
The manifest contains:
Looks like the issue is that the short path in manifest has 'main' prefix, but path returned by $(location test1.txt) in BUILD.bazel does not and the runfiles bash script doesn't resolve the discrepancy.
I've seen similar issues in rules_go's runfile resolution.
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: