Merged
Conversation
This is an attempt to make our iOS build process more compatible with M1 Mac build environments, and easier to consume via Swift Packages. In our existing iOS build setup, we compile together all of the Rust code and all of the wrapping Swift code into a single module named "MozillaAppServices". This is a bit of a violation of clean package separation, because it means that we risk name conflicts in the Swift code between different components. In this new setup, we don't pre-compile any of the Swift code. Instead we build only the Rust code, package it up along with its associated headers, and tell Swift to treat this as a module named "MozillaRustComponents". Each individual Swift wrapper can then `import MozillaRustComponents` and get access to the low-level FFI functions that it needs. An additional benefit of this setup is that we can distribute it as a `.xcframework` bundle for easy consumption on different platforms, and we can build it without using Xcode.
tarikeshaq
approved these changes
Aug 20, 2021
Contributor
tarikeshaq
left a comment
There was a problem hiding this comment.
LGTM 🚀
It builds and works! (we'll follow up with a PR on the https://github.com/mozilla/rust-components-swift side to track a version of A-S with those changes - which we had to do to get this to build successfully)
Codecov Report
@@ Coverage Diff @@
## main #4396 +/- ##
=======================================
Coverage 76.00% 76.00%
=======================================
Files 46 46
Lines 4193 4193
=======================================
Hits 3187 3187
Misses 1006 1006 Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #4225 -- but this time merging into main.
This is an attempt to make our iOS build process more compatible with
M1 Mac build environments, and easier to consume via Swift Packages.
In our existing iOS build setup, we compile together all of the Rust
code and all of the wrapping Swift code into a single module named
"MozillaAppServices". This is a bit of a violation of clean package
separation, because it means that we risk name conflicts in the Swift
code between different components.
In this new setup, we don't pre-compile any of the Swift code. Instead
we build only the Rust code, package it up along with its associated headers,
and tell Swift to treat this as a module named "MozillaRustComponents".
Each individual Swift wrapper can then
import MozillaRustComponentsand get access to the low-level FFI functions that it needs.
An additional benefit of this setup is that we can distribute it as
a
.xcframeworkbundle for easy consumption on different platforms,and we can build it without using Xcode.
Pull Request checklist
[ci full]to the PR title.