Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] only generate rust libraries with coverage instrumentation only when coverage is enabled #2858

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rust/private/rust.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def _rust_library_common(ctx, crate_type):
compile_data_targets = depset(ctx.attr.compile_data),
owner = ctx.label,
),
include_coverage = ctx.configuration.coverage_enabled,
)

def _rust_binary_impl(ctx):
Expand Down Expand Up @@ -254,6 +255,7 @@ def _rust_binary_impl(ctx):
compile_data_targets = depset(ctx.attr.compile_data),
owner = ctx.label,
),
include_coverage = ctx.configuration.coverage_enabled,
)

providers.append(RunEnvironmentInfo(
Expand Down Expand Up @@ -411,6 +413,7 @@ def _rust_test_impl(ctx):
crate_info_dict = crate_info_dict,
rust_flags = get_rust_test_flags(ctx.attr),
skip_expanding_rustc_env = True,
include_coverage = ctx.configuration.coverage_enabled,
)
data = getattr(ctx.attr, "data", [])

Expand Down
2 changes: 1 addition & 1 deletion rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ def rustc_compile_action(
force_all_deps_direct = False,
crate_info_dict = None,
skip_expanding_rustc_env = False,
include_coverage = True):
include_coverage = False):
"""Create and run a rustc compile action based on the current rule's attributes

Args:
Expand Down
Loading