Skip to content

Commit

Permalink
feat: expose a flag name for allow_unresolved_symlinks (#15)
Browse files Browse the repository at this point in the history
* feat: expose a flag name for allow_unresolved_symlinks

Allows a principled solution for rules like rules_js that need to have starlark logic conditional on the value, without a breaking change in Bazel 7 as the flag has been renamed.

Unblocks aspect-build/rules_js#1102
Alternative to #14

* code review comments

* fix: be precise about which 7.0 release changes the flag name
  • Loading branch information
alexeagle authored Jul 27, 2023
1 parent 4df92da commit 9da382d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ _external_deps = struct(
is_bzlmod_enabled = str(Label("//:invalid")).startswith("@@"),
)

_flags = struct(
# This flag was renamed in https://github.com/bazelbuild/bazel/pull/18313
allow_unresolved_symlinks = (
"allow_unresolved_symlinks"
if ge("7.0.0-pre.20230628.2")
else "experimental_allow_unresolved_symlinks"
)
)

_rules = struct(
# Whether TemplateDict#add_joined allows the map_each callback to return a list of strings (#17306)
template_dict_map_each_can_return_list = ge("6.1.0"),
Expand All @@ -30,6 +39,7 @@ _toolchains = struct(
bazel_features = struct(
cc = _cc,
external_deps = _external_deps,
flags = _flags,
globals = globals,
rules = _rules,
toolchains = _toolchains,
Expand Down

0 comments on commit 9da382d

Please sign in to comment.