bazel: Rules_go tests are failing on Windows with Bazel 1.0

https://buildkite.com/bazel/rules-go-golang/builds/1491

Executing tests from //tests/legacy/examples/stamped_bin:stamped_test
-----------------------------------------------------------------------------
--- FAIL: TestBuild (1.83s)
    stamped_test.go:101: Starting local Bazel server and connecting to it...
        Server crashed during startup. Now printing c:\users\b\_bazel_b\ibnjdh6i\server\jvm.out
        I/O Error: C:/users/b/_bazel_b/ibnjdh6i/server/server_info.rawproto.tmp -> C:/users/b/_bazel_b/ibnjdh6i/server/server_info.rawproto (Permission denied)
        exit status 37
--- FAIL: TestBuildWithoutStamp (1.83s)
    stamped_test.go:111: expected tests to have failed (instead got exit code 37)
FAIL
cleanup error: remove D:\b\jylqiqkr\bazel_testing\bazel_go_test\main: The process cannot access the file because it is being used by another process

Bazel 1.0 crashes inside the test due to some permission denied error.

We didn’t catch this in downstream test because the rules_go tests invoke bazel from PATH. On CI, it would actually be Bazelisk, but Bazelisk always points to the latest stable version instead of using Bazel@HEAD.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (18 by maintainers)

Commits related to this issue

Most upvoted comments

I too can run bazel, you have to run an actual command, like build or clean.

Edit: clean seems to work though…

Edit 2: Hmm… after running clean, it seems like it is working again. I will keep investigating if it has something todo with first running 0.29.1, then 1.1.0

So currently, we set USE_BAZEL_VERSION=D:\temp\tmpzmgcwe5d\bazel-bin\src\bazel.exe for downstream pipeline. If you just invoke Bazel from path, Bazelisk will correctly invoke the bazel binary being tested. You don’t have to do anything now. 😃

I have a stable reproduce locally and found a fix for this. Sending a CL now.