bazelbuild/bazel

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

Open

#27,401 创建于 2025年10月23日

在 GitHub 查看
 (5 评论) (2 反应) (0 负责人)Java (4,465 fork)batch import
P2help wantedteam-OSStype: bug

仓库指标

Star
 (25,384 star)
PR 合并指标
 (平均合并 22天 20小时) (30 天内合并 77 个 PR)

描述

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

贡献者指南