Skip to content

Commit

Permalink
fix is_exec_configuration() check (bazelbuild#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
krasimirgg authored and cfredric committed Feb 16, 2022
1 parent b90d504 commit 1d2971c
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 @@ -681,7 +681,7 @@ def construct_arguments(
env["RULES_RUST_THIRD_PARTY_DIR"] = str(toolchain._third_party_dir).lower()

# 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 @@ -368,7 +368,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 1d2971c

Please sign in to comment.