bazel-contrib / bazel-contrib/rules_bazel_integration_test
setting output_user_root has nonlocal consequences for rules_bazel_integration_test tests
- Dominant language
- Starlark
- Stars
- 65
- Forks
- 16
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 9
Description
This is an interesting issue; I ran into this with `rules_bazel_integration_test` but it's probably not fundamentally a bug with `rbit`:
```
Executing tests from //thirdparty/tests/contrib_pkg_exec_transition:exec_transition_test
-----------------------------------------------------------------------------
2026/04/05 03:36:49 Downloading https://$REDACTED/github.com/bazelbuild/bazel/releases/download/8.5.1/bazel-8.5.1-windows-x86_64.exe...
2026/04/05 03:36:49 Using basic authentication credentials for host $REDACTED from C:\Users\ContainerAdministrator\.netrc
$TEST_TMPDIR defined, some defaults will be overridden
WARNING: Running Bazel server needs to be killed, because the following startup options are different:
- Only in old server: -Dbazel.windows_unix_root=C:/msys64/usr/bin/bash.exe --host_jvm_args=-Dbazel.windows_unix_root=C:/msys64/usr/bin/bash.exe
- Only in new server: -Dbazel.windows_unix_root=C:\msys64\usr\bin\bash.exe --host_jvm_args=-Dbazel.windows_unix_root=C:\msys64\usr\bin\bash.exe
```
And then it hits the 300s timeout with no more messages.
The problem is very subtle here; the actual issue is:
- This is on windows, which is extremely path-length sensitive (visual studio has never been updated to support longpaths, lol)
- We set `--output_user_root=F:/b` in the parent server to shorten the fundamental paths.
- When rbit relaunches bazel, bazel inherits `--output_user_root` rather than setting it to `$TEST_TMPDIR/...` the way it would be by default
- This causes `rbit` to reuse the same bazel server the parent did
- something is normalizing the paths differently, which causes the bazel server to be killed
- the test never recovers from this.
I'm not sure what, if anything `rbit` could do about this, other than potentially causing the root to default to TEST_TMPDIR, but I just wanted to create a record of an issue that took me a bit to debug, heh.
Contributor guide
Research direction
Start by reproducing the Windows rules_bazel_integration_test case around thirdparty/tests/contrib_pkg_exec_transition:exec_transition_test with --output_user_root=F:/b. Compare the parent Bazel server environment with the relaunch using TEST_TMPDIR, and observe the path normalization and timeout. Done means the integration test no longer reuses or kills the incompatible server, or the issue documents a confirmed limitation and safe expected behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100