Skip to content

Commit

Permalink
fix is_exec_configuration() check (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
krasimirgg committed Jan 28, 2022
1 parent 14468f9 commit 9c9358d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def construct_arguments(
env["SYSROOT"] = paths.dirname(toolchain.rust_std.files.to_list()[0].short_path)

# extra_rustc_flags apply to the target configuration, not the exec configuration.
if hasattr(ctx.attr, "_extra_rustc_flags") and is_exec_configuration(ctx):
if hasattr(ctx.attr, "_extra_rustc_flags") and not is_exec_configuration(ctx):
rustc_flags.add_all(ctx.attr._extra_rustc_flags[ExtraRustcFlagsInfo].extra_rustc_flags)

# Create a struct which keeps the arguments separate so each may be tuned or
Expand Down
2 changes: 1 addition & 1 deletion rust/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def is_exec_configuration(ctx):
"""

# TODO(djmarcin): Is there any better way to determine cfg=exec?
return ctx.genfiles_dir.path.find("-exec-") == -1
return ctx.genfiles_dir.path.find("-exec-") != -1

def transform_deps(deps):
"""Conditionally transform a [Target] into [DepVariantInfo].
Expand Down

0 comments on commit 9c9358d

Please sign in to comment.