Add has_parallel_download feature to detect if rctx.download supports parallel downloads (#29)

Coming in 7.1.0,
[repository_ctx#download](https://bazel.build/rules/lib/builtins/repository_ctx#download)
has a new argument, block:

> If set to false, the call returns immediately and instead of the
regular return value, it returns a token with one single method, wait(),
which blocks until the download is finished and returns the usual return
value or throws as usual.

It would be useful to be able to update repository rules to use this
feature when available.
1 file changed
tree: 42be66d7e3ae47b227c00be970debdff1c78a25e
  1. .bcr/
  2. .github/
  3. private/
  4. test/
  5. .bazelrc
  6. .bazelversion
  7. .gitignore
  8. .pre-commit-config.yaml
  9. BUILD.bazel
  10. CONTRIBUTING.md
  11. deps.bzl
  12. features.bzl
  13. LICENSE
  14. MODULE.bazel
  15. README.md
  16. renovate.json
  17. WORKSPACE.bazel
  18. WORKSPACE.bzlmod
README.md

Bazel Features

Use this to determine the availability of a Bazel feature in your ruleset. It works under the hood by comparing the Bazel version against a known range in which the feature is available. Example usage:

load("@bazel_features//:features.bzl", "bazel_features")
if bazel_features.toolchains.has_optional_toolchains:
    # Do something

The features.bzl file contains the list of features.

Accessing globals

References to global Starlark symbols that do not exist cause load time errors, which means that their availability in Bazel cannot be tested via a regular feature. Instead, use bazel_features.globals.<symbol>, which is <symbol> if the symbol is available and None else.

See globals.bzl for the list of symbols that can be checked for in this way.