bazel-contrib / bazel_features

Support Bazel "feature detection" from starlark
https://docs.google.com/document/d/1HJf3gMYIrzmTRqbD4nWXH2eJRHXjLrOU0mmIeZplUzY/edit#heading=h.5mcn15i0e1ch
Apache License 2.0
17 stars 13 forks source link

Make version repository optional #32

Closed thesayyn closed 8 months ago

thesayyn commented 9 months ago

Currently, there's an external repository with bazel version stamped inside .bzl file to allow access to bazel version from non-repository contexts.

This is unnecessary if bazel_features is being called from a repository context where bazel-version is accessible therefore making the external version repository unnecessary.

thesayyn commented 9 months ago

I guess bazel can make this easy on us and already expose bazel_version to BUILD context...

Wyverald commented 8 months ago

The problem is that we can't load conditionally based on whether something is being accessed from a repo rule context or a build rule context (or something else, for that matter). So the extra repo will always be loaded from anyway.

Even if we made Bazel itself play nice, it's unlikely we could ever use the new feature and get rid of the extra repo since the whole spirit of bazel_features is to support multiple versions of Bazel.

I'll go ahead and close this, but as always we can reopen if necessary.