Skip to content

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

Closed

Description

@laszlocsomor

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

Activity

  1. self-assigned this
    on Apr 18, 2019
  2. added
    area-Windows
    P2
    on Apr 18, 2019
  3. added
    team-OSS
    on Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2area-Windowsteam-OSStype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions