bootstrap: bootstrap bazel doesn't set correct bazel_version for bazel_features by default
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
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` ?
```text
```
### 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
Research direction
Start with ./compile.sh and the bootstrap version-handling paths, then compare the behavior described in bazelbuild/bazel#27349 with the compile-from-source documentation. Determine whether BAZEL_DEV_VERSION_OVERRIDE is the intended solution or whether bootstrap must set the version another way; done means the support-branch bootstrap behavior and documentation are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100