bazelbuild / bazelbuild/bazel-skylib
versions.check needs documentation/better error message explaining it can only be used in repository rules
- Dominant language
- Starlark
- Stars
- 444
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
For some reason, using `versions.check("0.9.0")` fails on macOS with a homebrew installed bazel.
Here's the error:
```
ERROR: /Users/jmhodges/founding/src/founding/BUILD:12:1: Traceback (most recent call last):
File "/Users/jmhodges/founding/src/founding/BUILD", line 12
versions.check("0.9.0")
File "/private/var/tmp/_bazel_jmhodges/ee957dabdee1b1a9e1f2fe90369cf80f/external/bazel_skylib/lib/versions.bzl", line 96, in versions.check
fail(("\nCurrent Bazel version is low...))
Current Bazel version is lower than 0.2.1, expected at least 0.9.0
```
but my `bazel version` reports
```
Build label: 0.9.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sun Jul 12 12:24:01 +49936 (1513677414241)
Build timestamp: 1513677414241
Build timestamp as int: 1513677414241
```
Contributor guide
Research direction
Start with external/bazel_skylib/lib/versions.bzl at the versions.check implementation and reproduce the call from the BUILD file shown in the report. Compare the failure with bazel version output, then document or clarify the repository-rules-only limitation and make the resulting error message explain it accurately.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100