bazel-contrib / bazel-contrib/bazel_features
version='' doesn't trigger errors
- Dominant language
- Starlark
- Stars
- 27
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
If for any reason `versions.bzl: version = ''` `bazel_feautures` won't complain and treat it as a "dev" version `999999.999999.999999` https://github.com/bazel-contrib/bazel_features/blob/main/private/parse.bzl#L26C1-L28C35
Which can be hiding errors in version detection.
For bazel `7.6.2` bootstrap build for example version detection broke and a 8.x `macro` globals feature was enabled producing confusing build errors https://github.com/bazelbuild/bazel/issues/27349 If instead it'd complain that bazel failed to provide the version it would save some time.
Note: actually implementing the change may be blocked until bazel bootstrap process is fixed in a better way than just setting `BAZEL_DEV_VERSION_OVERRIDE` along with `EMBED_LABEL`
Contributor guide
Research direction
Start in private/parse.bzl around lines 26-28 and inspect how an empty version from versions.bzl becomes the development version. Check the Bazel bootstrap context, including BAZEL_DEV_VERSION_OVERRIDE and EMBED_LABEL, before deciding how missing versions should fail. Done means empty version detection reports an error without enabling features for a fabricated development version.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100