Windows sh_test invocation and test environment different from Linux causing unexpected results #10959
Labels
area-Windows
Windows-specific issues and feature requests
P2
We'll consider working on this in future. (Assignee optional)
team-OSS
Issues for the Bazel OSS team: installation, release processBazel packaging, website
type: bug
Description of the problem / feature request:
bazel sh_test works differently on Windows than Linux (and presumably other *nix). The path to the shell script that is run is a resolved symlink within the bazel test tree. See the minimal repro below.
When we run the tests on Linux, the path of the executable shell script that is invoked is from within the runfiles directory but on Windows it is not. This causes differences in behavior in the test environment that lead to unexpected results/failures. It appears this is simply the result of symlinks being resolved on Windows and not Linux to invoke the script.
We ran across this issue first trying to get the
envoy
project tests compiling and running on Windows.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
See this repo for a minimal reproduction example: https://github.com/greenhouse-org/bazel-issue-repro/tree/c7ebe740e6cf12b58c7c7e156d9f5d2670329aad/sh_test_symlinks
Envoy example: https://github.com/envoyproxy/envoy/tree/b7a8c98cfc20e3033819228d5a9c555a6c5c6aaa/test/exe
What operating system are you running Bazel on?
Microsoft Windows [Version 10.0.17763.973]
(output ofver
)What's the output of
bazel info release
?release 2.0.0
Have you found anything relevant by searching the web?
Not at the moment
Any other information, logs, or outputs that you want to share?
See the linked repo
README.md
for logs of the expected and failed outputs.The text was updated successfully, but these errors were encountered: