#27628·bazel

Label validator for target name allows space in name

Author: bogdanovmkCreated Nov 10, 2025Updated Sep 30, 2026
Labelstype: bugteam-Loading-APIundecided

Description of the bug:

Target name according to https://github.com/bazelbuild/bazel/blob/c32926f879b4378c7df8e54c93b00f1a7feef901/site/en/concepts/labels.md?plain=1#L139 can not have spaces. Yet logic in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/cmdline/LabelValidator.java#L39-L69 allows that

Which category does this issue belong to?

No response

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?

Linux, Mac OS

What is the output of bazel info release?

release 8.4.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 ?

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

No response

Have you found anything relevant by searching the web?

No response

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

No response