-
Couldn't load subscription status.
- Fork 93
Add rules for building SDK frameworks for explicit module compilation #562
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
base: master
Are you sure you want to change the base?
Changes from all commits
c27f34e
e0f837c
567d839
183306e
399edef
59fe2f4
b02c8ac
87de123
e905fe1
9792e61
0b47395
1b7afe4
ebb38c2
90aa093
0a92978
c891e65
55c9710
e83f15d
901234d
efc8ff6
fd3db05
7d01fbe
a6d85c3
0d11ade
3eee080
865789c
de887dd
29dc203
8d06a2a
5f3bfd0
ed943d9
9dc858f
b921c35
c17cbbe
8a6de35
a076ac1
893bddb
5422ec0
e09da21
5951403
fc1b9b3
bb6bbf1
a8278b0
82b3662
6346d6d
d505eb0
723efe9
510bee3
1504731
9795596
ebf77f8
997b0f9
55f13ec
4e34aec
0e4c235
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -561,7 +561,7 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names | |
| tags_manual = tags if "manual" in tags else tags + _MANUAL | ||
| platforms = kwargs.pop("platforms", None) | ||
| private_deps = [] + kwargs.pop("private_deps", []) | ||
| lib_names = [] | ||
| lib_names = ["@xcode_sdk_frameworks"] | ||
| fetch_default_xcconfig = library_tools["fetch_default_xcconfig"](name, default_xcconfig_name, **kwargs) if default_xcconfig_name else {} | ||
| copts_by_build_setting = copts_by_build_setting_with_defaults(xcconfig, fetch_default_xcconfig, xcconfig_by_build_setting) | ||
| enable_framework_vfs = kwargs.pop("enable_framework_vfs", False) or namespace_is_module_name | ||
|
|
@@ -915,13 +915,10 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names | |
|
|
||
| if swift_sources: | ||
| additional_swift_copts.extend(("-Xcc", "-I.")) | ||
| if module_map: | ||
| # Frameworks find the modulemap file via the framework vfs overlay | ||
| if not namespace_is_module_name: | ||
| additional_swift_copts += ["-Xcc", "-fmodule-map-file=" + "$(execpath " + module_map + ")"] | ||
| additional_swift_copts.append( | ||
| "-import-underlying-module", | ||
| ) | ||
|
|
||
| # Frameworks find the modulemap file via the framework vfs overlay | ||
| if module_map and not namespace_is_module_name: | ||
| additional_swift_copts += ["-Xcc", "-fmodule-map-file=" + "$(execpath " + module_map + ")"] | ||
| swiftc_inputs = other_inputs + objc_hdrs + objc_private_hdrs | ||
| if module_map: | ||
| swiftc_inputs.append(module_map) | ||
|
|
@@ -971,11 +968,14 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names | |
| copts = copts_by_build_setting.swift_copts + swift_copts + select({ | ||
| "@build_bazel_rules_ios//:virtualize_frameworks": framework_vfs_swift_copts, | ||
| "//conditions:default": framework_vfs_swift_copts if enable_framework_vfs else [], | ||
| }) + select({ | ||
| "@build_bazel_rules_ios//:explicit_modules": [], | ||
| "//conditions:default": ["-import-underlying-module"] if module_map else [], | ||
| }) + additional_swift_copts, | ||
| deps = deps + private_deps + lib_names + select({ | ||
| "@build_bazel_rules_ios//:virtualize_frameworks": [framework_vfs_overlay_name_swift], | ||
| "//conditions:default": [framework_vfs_overlay_name_swift] if enable_framework_vfs else [], | ||
| }), | ||
| }) + (["@xcode_sdk_frameworks//:XCTest"] if testonly else []), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this need to link There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah today it's used for linking. However, the users already give us the SDK frameworks via Without such a switch it looks like the PR has to injects every SDK to the swift compile action? I imagined that wouldn't be ideal from a performance angle but will have to dig into it a bit more. |
||
| swiftc_inputs = swiftc_inputs, | ||
| features = ["swift.no_generated_module_map", "swift.use_pch_output_dir"] + select({ | ||
| "@build_bazel_rules_ios//:virtualize_frameworks": ["swift.vfsoverlay"], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to make this a feature that flips it on and any of the other
rules_swiftfeatures that it currently uses, so they can setapple.explicit_module_compilationand it adds the relevant deps