bazelbuild / bazelbuild/bazel

createSymbolicLink argument breaks existing rctx.symlink on Windows

Open
#27,779 4 comments 0 reactions 0 assignees View on GitHub
team-ExternalDeps type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

We have a repository rule that calls `rctx.symlink` that no longer works

### Which category does this issue belong to?

C++ Rules

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

A cut down version of some code that previously worked:

```
# path from external repo
files_bindir = "@@+toolchain+toolchain-x86_64-stage1-windows---x86_64-stage1-windows-msvc17-p24389358-0ff3ae63.tar.gz//:BuildTools/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64"

# create symlink
rctx.symlink(rctx.path(files_bindir), "bin")
```
Now same code throws error:
```
Error in symlink: Could not create F:/b/2zy7ismm/external/+toolchain+toolchain-msvc17--windows-x86_64--windows-x86_64/bin: Illegal char <:> at index 185: F:\b\2zy7ismm\external\+toolchain+toolchain-msvc17--windows-x86_64--windows-x86_64\@@+toolchain+toolchain-x86_64-stage1-windows---x86_64-stage1-windows-msvc17-p24389358-0ff3ae63.tar.gz\:BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64
```

### Which operating system are you running Bazel on?

windows

### What is the output of `bazel info release`?

development version

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

USE_BAZEL_VERSION=01bf2183062112e2b6a938eb1de23549fb974dfa

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text
https://github.com/bazelbuild/bazel.git
01bf2183062112e2b6a938eb1de23549fb974dfa
```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

01bf2183062112e2b6a938eb1de23549fb974dfa

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the repository rule's rctx.symlink entry point and reproduce the provided external-repository path on Windows at the referenced Bazel revision. Compare the failing path handling with the previously working call; done means the valid path creates the requested symlink without the illegal-character error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.