Skip to content

Commit

Permalink
Remove apply_implied_frameworks feature from implies action confi…
Browse files Browse the repository at this point in the history
…gs (#335)

Fixes #334
  • Loading branch information
aaronsky authored Jun 10, 2024
1 parent 288cfc0 commit facfb55
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 7 deletions.
9 changes: 3 additions & 6 deletions crosstool/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
"framework_paths",
"strip_debug_symbols",
"apple_env",
"apply_implicit_frameworks",
],
tools = [
tool(
Expand All @@ -336,7 +335,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
"linker_param_file",
"apple_env",
"sysroot",
"apply_implicit_frameworks",
],
tools = [
tool(
Expand Down Expand Up @@ -571,7 +569,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
"framework_paths",
"strip_debug_symbols",
"apple_env",
"apply_implicit_frameworks",
],
tools = [
tool(
Expand All @@ -593,7 +590,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
"linker_param_file",
"apple_env",
"sysroot",
"apply_implicit_frameworks",
],
tools = [
tool(
Expand Down Expand Up @@ -661,7 +657,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
"linker_param_file",
"apple_env",
"sysroot",
"apply_implicit_frameworks",
],
tools = [
tool(
Expand Down Expand Up @@ -1533,6 +1528,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
ctx.attr.cpu == "watchos_arm64"):
apply_implicit_frameworks_feature = feature(
name = "apply_implicit_frameworks",
enabled = True,
flag_sets = [
flag_set(
actions = _DYNAMIC_LINK_ACTIONS,
Expand All @@ -1549,6 +1545,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
ctx.attr.cpu == "darwin_arm64e"):
apply_implicit_frameworks_feature = feature(
name = "apply_implicit_frameworks",
enabled = True,
flag_sets = [
flag_set(
actions = _DYNAMIC_LINK_ACTIONS,
Expand All @@ -1558,7 +1555,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
],
)
else:
apply_implicit_frameworks_feature = None
apply_implicit_frameworks_feature = feature(name = "apply_implicit_frameworks")

random_seed_feature = feature(
name = "random_seed",
Expand Down
74 changes: 73 additions & 1 deletion test/linking_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ disable_objc_test = make_action_command_line_test_rule(
},
)

disable_implicit_frameworks_test = make_action_command_line_test_rule(
config_settings = {
"//command_line_option:features": [
"-apply_implicit_frameworks",
],
},
)

dsym_test = make_action_command_line_test_rule(
config_settings = {
"//command_line_option:apple_generate_dsym": True,
Expand All @@ -43,14 +51,16 @@ def linking_test_suite(name):
name: The name to be included in test names and tags.
"""
default_test(
name = "{}_default_apple_link_test".format(name),
name = "{}_default_apple_macos_link_test".format(name),
tags = [name],
expected_argv = [
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
"-ObjC",
"-framework",
"Foundation",
],
not_expected_argv = [
"-g",
Expand All @@ -60,6 +70,28 @@ def linking_test_suite(name):
mnemonic = "ObjcLink",
target_under_test = "//test/test_data:macos_binary",
)
default_test(
name = "{}_default_apple_ios_link_test".format(name),
tags = [name],
expected_argv = [
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
"-ObjC",
"-framework",
"Foundation",
"-framework",
"UIKit",
],
not_expected_argv = [
"-g",
"DSYM_HINT_LINKED_BINARY",
"-dead_strip",
],
mnemonic = "ObjcLink",
target_under_test = "//test/test_data:ios_binary",
)

opt_test(
name = "{}_opt_link_test".format(name),
Expand Down Expand Up @@ -99,12 +131,52 @@ def linking_test_suite(name):
"-objc_abi_version",
"-Xlinker",
"2",
"-framework",
"Foundation",
],
not_expected_argv = ["-ObjC"],
mnemonic = "ObjcLink",
target_under_test = "//test/test_data:macos_binary",
)

disable_implicit_frameworks_test(
name = "{}_disable_implicit_frameworks_apple_macos_link_test".format(name),
tags = [name],
expected_argv = [
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
"-ObjC",
],
not_expected_argv = [
"-framework",
"Foundation",
],
mnemonic = "ObjcLink",
target_under_test = "//test/test_data:macos_binary",
)

disable_implicit_frameworks_test(
name = "{}_disable_implicit_frameworks_apple_ios_link_test".format(name),
tags = [name],
expected_argv = [
"-Xlinker",
"-objc_abi_version",
"-Xlinker",
"2",
"-ObjC",
],
not_expected_argv = [
"-framework",
"Foundation",
"-framework",
"UIKit",
],
mnemonic = "ObjcLink",
target_under_test = "//test/test_data:ios_binary",
)

dsym_test(
name = "{}_generate_dsym_test".format(name),
tags = [name],
Expand Down

0 comments on commit facfb55

Please sign in to comment.