bazelbuild/bazel

bootstrap: bootstrap bazel doesn't set correct bazel_version for bazel_features by default

Open

#27401 opened on Oct 23, 2025

View on GitHub
 (5 comments) (1 reaction) (0 assignees)Java (25,384 stars) (4,465 forks)batch import
P2help wantedteam-OSStype: bug

Description

Description of the bug:

As discovered in https://github.com/bazelbuild/bazel/issues/27349 bootstrap ./compile.sh from scratch process doesn't correctly set native.bazel_version in first stage bazel.

Instead bazel_features see version as '' and treat as "dev" 999999 version. Which isn't correct for support branches. Bazel 7.x branch may not have some features of Bazel 8, assuming 999999 then can break the 7.x bootstrap build (even if 8.x feature isn't in use in bazel code, it may still fail to compile due to missing globals)

EMBED_LABEL=/--embed_label isn't setting native.bazel_version BAZEL_DEV_VERSION_OVERRIDE= will set it but it isn't mentioned in the docs https://bazel.build/install/compile-source

Not sure if BAZEL_DEV_VERSION_OVERRIDE is supposed to be the correct way (just docs issue) or there's a bug in how bootstrap bazel own version is being set up.

Note: on bazel_features side https://github.com/bazel-contrib/bazel_features/issues/117 version='' still has a use-case for last_green builds

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?

No response

What is the output of bazel info release?

No response

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

Contributor guide