Windows replace / by \ in absolute path for remote build
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
I have a buildfarm Worker running on Linux. For a licensed C++ compiler that is installed at the `/usr` folder. The bug appear with any absolute path, so I will put `/usr/bin/gcc` examples bellow, which does the same thing. I have to use absolute path here cause I can't really move the compiler around since it is licenced.
We can interact with this worker from linux and it works fine: The worker receive the correct cmd line with the right `/usr/bin/gcc`
The issue is that most of the teams is on windows, so we need to interact with that worker from Windows. The cmd line used is the same. And all config file are the same too. But in that case, the worker receive backslash in the command line for the tool path (other cmd args doesn't seems to be affected). The worker get `\usr\bin\gcc` which make linux mad and I receive the error: No such file or directory from the execvp of the worker.
After speaking with the buildfarm teams on slack, they told me to try to set a `--host_platform` to a linux one (on the Windows cmd line), I have tried this:
```
platform(
name = "remote",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
```
And it didn't change anything, the worker still receive backslash for the tool path.
Just as a precision, I do not have any backslash in the config file for my compiler repository rule, all of them are /.
My config is almost the same as the `ubuntu_cc_toolchain_config` from the buidbuddy toolchain: http://github.com/buildbuddy-io/buildbuddy-toolchain
Thanks for your help
### Which category does this issue belong to?
Remote Execution
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
_No response_
### Which operating system are you running Bazel on?
MSYS_NT-10.0-26100 -- Windows 11
### What is the output of `bazel info release`?
I am not using bazel but bazelisk is currently set to `USE_BAZEL_VERSION=8.0.0`, without this line I get: `release 8.1.1`
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
```text
Sorry this is a private project on a local network
```
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
This is not a regression.
### Have you found anything relevant by searching the web?
No, I have contacted the buildfarm teams on slack. And they have redirected me to setup an issue, cause that doesn't seems to be an issue form buildfarm
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
No source file or test is named. Start by reproducing the Windows-to-Linux remote build with the shown platform configuration and `/usr/bin/gcc`, then trace where the tool path changes before reaching the worker; done means an absolute POSIX path remains usable by the Linux worker and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- build-system, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100