Skip to content
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

Compile for Mac Catalyst #1915

Closed
wants to merge 3 commits into from
Closed

Conversation

bmisiak
Copy link

@bmisiak bmisiak commented May 12, 2023

Hello!
Trying to port Element X to Mac Catalyst. The Rust SDK is of course a prerequisite.

Unfortunately, there is a problem with rustc, so I wrote up a pull request to fix it there first:
rust-lang/rust#111384

After it gets merged, the changes I made here to build_crypto_xcframework.sh will make it compile for Catalyst and bundle all four platforms (iOS, macOS, Catalyst and simulator) into one .xcframework.

It will use nightly rustc for catalyst, but stable for the other platforms.

@stefanceriu
Copy link
Member

stefanceriu commented May 16, 2023

This is really exciting, just one note thought: nowadays the old bash script ElementX used is gone. build_crypto_xcframework.sh is only used for the crypto part, exposing it to the old Element app.

Instead of that, Element X uses an xtask now https://github.com/matrix-org/matrix-rust-sdk/blob/main/xtask/src/swift.rs#L126

Also fwiw:
this is where I dropped the original catalyst support c10961f

and this is how we actually use the xtask when releasing the sdk https://github.com/matrix-org/matrix-rust-components-swift/blob/main/Tools/Scripts/release.py#L43

@bmisiak
Copy link
Author

bmisiak commented May 16, 2023 via email

Previous versions of log used an alpha version of
value-bag, which broke on the new nightly rustc:
rust-lang/rust#77125
@bmisiak bmisiak marked this pull request as ready for review May 31, 2023 02:49
@bmisiak bmisiak requested a review from a team as a code owner May 31, 2023 02:49
@bmisiak bmisiak requested review from jplatte and removed request for a team May 31, 2023 02:49
@bmisiak
Copy link
Author

bmisiak commented May 31, 2023

Thanks @stefanceriu, my changes to rustc were merged and matrix-rust-sdk can now create the xcframework for Catalyst. I updated the xtask.
I had to upgrade log because its previous version was pulling in an alpha version of value-bag, which broke on nightly rustc.

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this for ElementX and it works great, everything gets build properly and can be used through normal methods.

The bad news is that ElementX now uses MapBox which doesn't provide catalyst support so even if we build the SDK for it we can't use it. The only thing we'll get is longer builds times.

I think what we should do is put the catalyst targets under flag and not build them by default.

As for the Crypto script, that's only used by old Element and we probably shouldn't even bother changing it and potentially adding bugs.

@jplatte
Copy link
Collaborator

jplatte commented Jul 20, 2023

Hey, we discussed this again today. Unfortunately, we don't really have the capacity to support it "officially". We're still happy to receive catalyst-related bug fixes, or attempt to help users who use that build target, but adding it to our build scripts would imply that we actually test that it works. I hope it's not too much trouble for you to maintain your own build script separately.

@jplatte jplatte closed this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants