awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)
Apache License 2.0
104 stars 19 forks source link

Fix mls-rs-crypto-cryptokit not building for iOS #206

Open CaioSym opened 2 weeks ago

CaioSym commented 2 weeks ago

Issues:

TODO

Description of changes:

Fixes mls-rs-crypto-cryptokit to take the target aarch into account when building. Currently it always assumes macos as the target.

Explicitly added support for iphone and iphonesimulator. A more complete fix might want to consider watchOS and TVOS but I currently can't test on those.

Call-outs:

The @available annotations SHOULD be redundant and not needed by the swift compiler since we are specifying the min target OS to be 17. However, i still get errors unless I add them. More investigation is needed on this but parking it for now since the iOS17 reqs are a hard blocker for my project to adopt crypto kit.

Testing:

Tested that building works for the provided archs by running the following. (Assumes you've already installed the toolchains for these archs) on an M1 Mac.

cargo build -vv -p mls-rs-crypto-cryptokit --target aarch64-apple-ios
cargo build -vv -p mls-rs-crypto-cryptokit --target x86_64-apple-ios
cargo build -vv -p mls-rs-crypto-cryptokit --target aarch64-apple-ios-sim
cargo build -vv -p mls-rs-crypto-cryptokit --target aarch64-apple-darwin
cargo build -vv -p mls-rs-crypto-cryptokit --target x86_64-apple-darwin

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

tomleavy commented 2 weeks ago

@CaioSym looks like you just need to run the fmt tool and we are good