Skip to content

Commit

Permalink
Expand locations and make variables in extra_args (#380)
Browse files Browse the repository at this point in the history
feat: Expand locations and make variables in `extra_args`

Signed-off-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
fmeum committed May 10, 2024
1 parent 6ef0689 commit d8f0a53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion internal/native_image/builder.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,13 @@ def assemble_native_build_options(

# append extra arguments last
for arg in ctx.attr.extra_args:
args.add(arg)
# Expand locations of targets in 'data' and make variables provided by 'toolchains'.
expanded_arg = ctx.expand_make_variables(
"extra_args",
ctx.expand_location(arg, ctx.attr.data),
{},
)

# Skip over args that become empty after expansion but weren't before.
if expanded_arg or not arg:
args.add(expanded_arg)

0 comments on commit d8f0a53

Please sign in to comment.