From 089aff2c3a175f0a10ecb51de9e4cb05814d2dbc Mon Sep 17 00:00:00 2001 From: Walter Lee Date: Thu, 20 Jul 2023 18:50:46 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 549805566 --- apple/internal/ios_rules.bzl | 4 ++++ apple/internal/macos_rules.bzl | 5 +++++ apple/internal/tvos_rules.bzl | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/apple/internal/ios_rules.bzl b/apple/internal/ios_rules.bzl index 3cadc828cf..ffa90c3e6a 100644 --- a/apple/internal/ios_rules.bzl +++ b/apple/internal/ios_rules.bzl @@ -208,10 +208,13 @@ def _ios_application_impl(ctx): ) extra_linkopts = [] + extra_requested_features = [] if ctx.attr.sdk_frameworks: extra_linkopts.extend( collections.before_each("-framework", ctx.attr.sdk_frameworks), ) + if ctx.attr.testonly: + extra_requested_features.append("exported_symbols") link_result = linking_support.register_binary_linking_action( ctx, @@ -219,6 +222,7 @@ def _ios_application_impl(ctx): entitlements = entitlements, exported_symbols_lists = ctx.files.exported_symbols_lists, extra_linkopts = extra_linkopts, + extra_requested_features = extra_requested_features, platform_prerequisites = platform_prerequisites, rule_descriptor = rule_descriptor, stamp = ctx.attr.stamp, diff --git a/apple/internal/macos_rules.bzl b/apple/internal/macos_rules.bzl index c63b6d2a29..faeebc42bb 100644 --- a/apple/internal/macos_rules.bzl +++ b/apple/internal/macos_rules.bzl @@ -195,10 +195,15 @@ def _macos_application_impl(ctx): validation_mode = ctx.attr.entitlements_validation, ) + extra_requested_features = [] + if ctx.attr.testonly: + extra_requested_features.append("exported_symbols") + link_result = linking_support.register_binary_linking_action( ctx, entitlements = entitlements, exported_symbols_lists = ctx.files.exported_symbols_lists, + extra_requested_features = extra_requested_features, platform_prerequisites = platform_prerequisites, rule_descriptor = rule_descriptor, stamp = ctx.attr.stamp, diff --git a/apple/internal/tvos_rules.bzl b/apple/internal/tvos_rules.bzl index 4a4893aa08..6faaef25be 100644 --- a/apple/internal/tvos_rules.bzl +++ b/apple/internal/tvos_rules.bzl @@ -199,11 +199,16 @@ def _tvos_application_impl(ctx): validation_mode = ctx.attr.entitlements_validation, ) + extra_requested_features = [] + if ctx.attr.testonly: + extra_requested_features.append("exported_symbols") + link_result = linking_support.register_binary_linking_action( ctx, avoid_deps = ctx.attr.frameworks, entitlements = entitlements, exported_symbols_lists = ctx.files.exported_symbols_lists, + extra_requested_features = extra_requested_features, platform_prerequisites = platform_prerequisites, rule_descriptor = rule_descriptor, stamp = ctx.attr.stamp,