Windows-only support for `--output_user_root`
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
As described in [the Bazel docs](https://bazel.build/configure/windows), it's often necessary on Windows to set the option [--output_user_root](https://bazel.build/reference/command-line-reference#flag--output_user_root), e.g. `--output_user_root=C:/tmp`.
This becomes a pain when a Bazel project needs to support both Windows and non-Windows hosts. `C:/tmp` is of course no good as a Linux path, and `startup:windows --output_user_root=C:/tmp` isn't supported. This means developers either need to set the option manually in only their Windows repositories, or else add scripting to do the same.
It would be helpful if Bazel provided a way to set the output user root for Windows hosts only.
One way to achieve this would be a new option `--windows_output_user_root`, which overrides `--output_user_root` on Windows hosts, and does nothing on non-Windows hosts. This would be similar to the existing [--windows_enable_symlinks](https://bazel.build/reference/command-line-reference#flag--windows_enable_symlinks), so hopefully not too strange a feature.
### Which category does this issue belong to?
Configurability
### What underlying problem are you trying to solve with this feature?
Removing the need for a clumsy wrapper script when supporting both Windows and non-Windows hosts in the same project.
### Which operating system are you running Bazel on?
Windows & Linux
### What is the output of `bazel info release`?
release 6.3.2
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
N/A
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
```text
N/A
```
### Have you found anything relevant by searching the web?
There's this larger feature request, which would solve the issue: https://github.com/bazelbuild/bazel/issues/18683
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start by reviewing the existing --windows_enable_symlinks option and the linked command-line documentation, then compare the broader approach described in issue #18683. Done means Bazel can set a Windows-only output user root while leaving non-Windows hosts unaffected, without requiring a wrapper script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100