Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: cannot run tests from external repo with --legacy_external_runfiles #8088

Closed
laszlocsomor opened this issue Apr 18, 2019 · 1 comment
Assignees
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

Comments

@laszlocsomor
Copy link
Contributor

Description of the problem / feature request:

Bazel on Windows cannot run tests from external repos with --nolegacy_external_runfiles.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Directories a and b are siblings.

a\WORKSPACE:

local_repository(
    name = "b",
    path = "../b",
)

a\BUILD:

cc_test(
    name = "x",
    srcs = ["x.cc"],
)

a\x.cc:

int main() { return 0; }

b\WORKSPACE:
empty

b\BUILD:
same as a\BUILD

b\x.cc:
same as a\x.cc

Demo:

Default test wrapper (test-setup.sh), default external runfiles:

C:\src\tmp2\a>c:\src\bazel-releases\0.25.0\rc3\bazel.exe test -t- --test_output=errors @b//:x
(...)
@b//:x                                                                   PASSED in 1.6s

Native test wrapper, default external runfiles:

C:\src\tmp2\a>c:\src\bazel-releases\0.25.0\rc3\bazel.exe test --incompatible_windows_native_test_wrapper -t- --test_output=errors @b//:x
(...)
@b//:x                                                                   PASSED in 0.1s

Default test wrapper (test-setup.sh), no external runfiles:

C:\src\tmp2\a>c:\src\bazel-releases\0.25.0\rc3\bazel.exe test --nolegacy_external_runfiles -t- --test_output=errors @b//:x
(...)
==================== Test output for @b//:x:
external/bazel_tools/tools/test/test-setup.sh: line 288: : command not found
================================================================================

Native test wrapper, no external runfiles:

C:\src\tmp2\a>c:\src\bazel-releases\0.25.0\rc3\bazel.exe test --incompatible_windows_native_test_wrapper --nolegacy_external_runfiles -t- --test_output=errors @b//:x
(...)
==================== Test output for @b//:x:
ERROR(tools/test/windows/tw.cc:1250) value: 2 (0x00000002): CreateProcessW failed (bazel-out\x64_windows-fastbuild\bin\external\b\x.exe.runfiles\__main__\external\b\x.exe)
ERROR(tools/test/windows/tw.cc:1442) Failed to start test process "bazel-out\x64_windows-fastbuild\bin\external\b\x.exe.runfiles\__main__\external\b\x.exe"
================================================================================

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

release 0.25.0rc3

@laszlocsomor laszlocsomor self-assigned this Apr 18, 2019
@laszlocsomor laszlocsomor added bazel 1.0 area-Windows Windows-specific issues and feature requests type: bug P2 We'll consider working on this in future. (Assignee optional) labels Apr 18, 2019
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue Apr 18, 2019
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@philwo @laszlocsomor and others