Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jul 22, 2024
1 parent 8227a38 commit 9823b17
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/args_location_expansion/rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ string_setting(
name = "with_cfg_setting",
build_setting_default = "unset",
visibility = ["//visibility:public"],
)
)
2 changes: 1 addition & 1 deletion examples/args_location_expansion/test_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ if [ "$#" -ne 11 ]; then
fi
for arg in "$@"; do
check_runfile "$arg"
done
done
4 changes: 3 additions & 1 deletion with_cfg/private/args.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ complexities handled by the functions in this file:
We use a non-recursing aspect on the original rule to collect the files
corresponding to labels mentioned in location expansion in "args" and provide
them to the frontend rule via output groups named after the user-provided
label strings.
label strings. As a consequence, we also have to set the "args" attribute on
the underlying target so that the aspect can see it - aspect attributes are
limited to integers and string enums.
2. "args" can only be set at load time via the magic attribute and the only way
to get analysis time information into it is via the hard-coded location
expansion applied to it in
Expand Down
4 changes: 2 additions & 2 deletions with_cfg/private/wrapper.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def _wrapper(

frontend_attrs = {}
if "args" in kwargs:
# Leave the args attribute in place on the original rule in case it processes it in a
# non-standard way.
# Leave the args attribute in place on the original rule so that they can be read by the
# args_aspect attached to the exports attribute of the transitioning_alias.
frontend_attrs["args"], frontend_attrs["data"] = rewrite_args(
alias_name,
kwargs["args"],
Expand Down

0 comments on commit 9823b17

Please sign in to comment.