Skip to content

Commit facfb55

Browse files
authored
Remove apply_implied_frameworks feature from implies action configs (#335)
Fixes #334
1 parent 288cfc0 commit facfb55

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

crosstool/cc_toolchain_config.bzl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
313313
"framework_paths",
314314
"strip_debug_symbols",
315315
"apple_env",
316-
"apply_implicit_frameworks",
317316
],
318317
tools = [
319318
tool(
@@ -336,7 +335,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
336335
"linker_param_file",
337336
"apple_env",
338337
"sysroot",
339-
"apply_implicit_frameworks",
340338
],
341339
tools = [
342340
tool(
@@ -571,7 +569,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
571569
"framework_paths",
572570
"strip_debug_symbols",
573571
"apple_env",
574-
"apply_implicit_frameworks",
575572
],
576573
tools = [
577574
tool(
@@ -593,7 +590,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
593590
"linker_param_file",
594591
"apple_env",
595592
"sysroot",
596-
"apply_implicit_frameworks",
597593
],
598594
tools = [
599595
tool(
@@ -661,7 +657,6 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
661657
"linker_param_file",
662658
"apple_env",
663659
"sysroot",
664-
"apply_implicit_frameworks",
665660
],
666661
tools = [
667662
tool(
@@ -1533,6 +1528,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
15331528
ctx.attr.cpu == "watchos_arm64"):
15341529
apply_implicit_frameworks_feature = feature(
15351530
name = "apply_implicit_frameworks",
1531+
enabled = True,
15361532
flag_sets = [
15371533
flag_set(
15381534
actions = _DYNAMIC_LINK_ACTIONS,
@@ -1549,6 +1545,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
15491545
ctx.attr.cpu == "darwin_arm64e"):
15501546
apply_implicit_frameworks_feature = feature(
15511547
name = "apply_implicit_frameworks",
1548+
enabled = True,
15521549
flag_sets = [
15531550
flag_set(
15541551
actions = _DYNAMIC_LINK_ACTIONS,
@@ -1558,7 +1555,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
15581555
],
15591556
)
15601557
else:
1561-
apply_implicit_frameworks_feature = None
1558+
apply_implicit_frameworks_feature = feature(name = "apply_implicit_frameworks")
15621559

15631560
random_seed_feature = feature(
15641561
name = "random_seed",

test/linking_tests.bzl

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ disable_objc_test = make_action_command_line_test_rule(
3030
},
3131
)
3232

33+
disable_implicit_frameworks_test = make_action_command_line_test_rule(
34+
config_settings = {
35+
"//command_line_option:features": [
36+
"-apply_implicit_frameworks",
37+
],
38+
},
39+
)
40+
3341
dsym_test = make_action_command_line_test_rule(
3442
config_settings = {
3543
"//command_line_option:apple_generate_dsym": True,
@@ -43,14 +51,16 @@ def linking_test_suite(name):
4351
name: The name to be included in test names and tags.
4452
"""
4553
default_test(
46-
name = "{}_default_apple_link_test".format(name),
54+
name = "{}_default_apple_macos_link_test".format(name),
4755
tags = [name],
4856
expected_argv = [
4957
"-Xlinker",
5058
"-objc_abi_version",
5159
"-Xlinker",
5260
"2",
5361
"-ObjC",
62+
"-framework",
63+
"Foundation",
5464
],
5565
not_expected_argv = [
5666
"-g",
@@ -60,6 +70,28 @@ def linking_test_suite(name):
6070
mnemonic = "ObjcLink",
6171
target_under_test = "//test/test_data:macos_binary",
6272
)
73+
default_test(
74+
name = "{}_default_apple_ios_link_test".format(name),
75+
tags = [name],
76+
expected_argv = [
77+
"-Xlinker",
78+
"-objc_abi_version",
79+
"-Xlinker",
80+
"2",
81+
"-ObjC",
82+
"-framework",
83+
"Foundation",
84+
"-framework",
85+
"UIKit",
86+
],
87+
not_expected_argv = [
88+
"-g",
89+
"DSYM_HINT_LINKED_BINARY",
90+
"-dead_strip",
91+
],
92+
mnemonic = "ObjcLink",
93+
target_under_test = "//test/test_data:ios_binary",
94+
)
6395

6496
opt_test(
6597
name = "{}_opt_link_test".format(name),
@@ -99,12 +131,52 @@ def linking_test_suite(name):
99131
"-objc_abi_version",
100132
"-Xlinker",
101133
"2",
134+
"-framework",
135+
"Foundation",
102136
],
103137
not_expected_argv = ["-ObjC"],
104138
mnemonic = "ObjcLink",
105139
target_under_test = "//test/test_data:macos_binary",
106140
)
107141

142+
disable_implicit_frameworks_test(
143+
name = "{}_disable_implicit_frameworks_apple_macos_link_test".format(name),
144+
tags = [name],
145+
expected_argv = [
146+
"-Xlinker",
147+
"-objc_abi_version",
148+
"-Xlinker",
149+
"2",
150+
"-ObjC",
151+
],
152+
not_expected_argv = [
153+
"-framework",
154+
"Foundation",
155+
],
156+
mnemonic = "ObjcLink",
157+
target_under_test = "//test/test_data:macos_binary",
158+
)
159+
160+
disable_implicit_frameworks_test(
161+
name = "{}_disable_implicit_frameworks_apple_ios_link_test".format(name),
162+
tags = [name],
163+
expected_argv = [
164+
"-Xlinker",
165+
"-objc_abi_version",
166+
"-Xlinker",
167+
"2",
168+
"-ObjC",
169+
],
170+
not_expected_argv = [
171+
"-framework",
172+
"Foundation",
173+
"-framework",
174+
"UIKit",
175+
],
176+
mnemonic = "ObjcLink",
177+
target_under_test = "//test/test_data:ios_binary",
178+
)
179+
108180
dsym_test(
109181
name = "{}_generate_dsym_test".format(name),
110182
tags = [name],

0 commit comments

Comments
 (0)