Skip to content

Commit

Permalink
feat: Expand locations and make variables in extra_args
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
fmeum committed Apr 30, 2024
1 parent 629ebb1 commit 0e98ad9
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 0e98ad9

Please sign in to comment.