Skip to content

Windows: backslashes are not supported in other "rc" files #29001

@Fantasime

Description

@Fantasime

Description of the bug:

Steps to reproduce the problem

Create a new workspace with the following structure:

workspace
├ main
| ├ BUILD
| └ hello_world.cc
├ .bazelrc
├ MODULE.bazel
└ user.bazelrc

In .bazelrc:

try-import user.bazelrc

In user.bazelrc:

startup --output_user_root="D:\Users\username\_bazel_username"

Then run:

bazel build

Problem description

OS: Windows

Bazel Version: 9.0.1

Error message:

[INFO 02:24:53.779 src/main/cpp/rc_file.cc:94] Parsing the RcFile ******/.bazelrc
[INFO 02:24:53.779 src/main/cpp/rc_file.cc:94] Parsing the RcFile user.bazelrc
[FATAL 02:24:53.780 src/main/cpp/util/path_windows.cc:85] MakeAbsolute(D:Usersusername_bazel_username): AsAbsoluteWindowsPath failed: working-directory relative paths are unsupported

Temporary solution

Modify user.bazelrc:

startup --output_user_root="D:/Users/username/_bazel_username"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions