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

Add support of arm64 in Carthage build #7158

Merged
merged 17 commits into from
Jan 27, 2022
Merged

Conversation

pavel-ship-it
Copy link
Contributor

@pavel-ship-it pavel-ship-it commented Mar 3, 2021

arm64 was disabled as Carthage was unable to build XCFrameworks.
Now it's fixed and arm64 can be enabled for M1.

Fix for Could not build arm64 contains xcframework for iOS simulator by Carthage

@tgoyne
Copy link
Member

tgoyne commented Mar 3, 2021

This breaks the non-xcframework build, which is currently the only thing that Carthage supports for shipping prebuilt libraries. I'm not sure if there's a way to support both, but as-is this'll break our release pipeline.

Carthage/Carthage#3123 looks like it fixes that and might land soon so maybe we can wait for that?

@egorf
Copy link

egorf commented Mar 30, 2021

@tgoyne Hi!

Do you think it's time we could revisit this issue? The newest Carthage release supports xc frameworks.

Currently it does not seem possible to build Realm with carthage update --use-xcframeworks.

@tgoyne
Copy link
Member

tgoyne commented Mar 30, 2021

You have to include --no-use-binaries to have Carthage actually build the XCFramework. Carthage 0.38 will add support for prebuilt XCFrameworks.

@timothycosta
Copy link

It would be great to get this merged now that Carthage 0.38.0 is out. I've installed this branch in my cartfile and it seems to be working well.

# Cartfile
github "realm/realm-cocoa" "py/carthage_arm64"

@r-plus
Copy link

r-plus commented May 10, 2021

by the way, before release of Carthage 0.38, realm-cocoa already supported xcframework version of prebuild binary since v10.7.2.
no need additional change for release flow?

@leemaguire leemaguire removed their request for review June 3, 2021 09:33
@tovkal
Copy link

tovkal commented Jun 3, 2021

This PR seems to be a duplicate of #7095. Either way, I have tried the changes and they work. Hoping this can be merged soon 😄

@r-plus
Copy link

r-plus commented Jul 8, 2021

Hi @tgoyne

Do you have any blocking issue for this?

M1 + Carthage users still cannot use realm-cocoa as native on simulator if using incompatible version of Xcode/Swift between project and pre-build binary.

@iamszabo
Copy link

iamszabo commented Sep 6, 2021

Is there any update on this? It would be nice to use Carthage on M1

@tovkal
Copy link

tovkal commented Sep 22, 2021

Seems like like the latest release, compatible with Xcode 13, still does not work on M1s

@dianaafanador3
Copy link
Collaborator

@pavel-ship-it After rebase seems like CI is not breaking, swiftpm-debug 12.5.1 fails because of this test testEncryptedSyncedRealmWrongKey and I've seen this failing in other PRs

@cla-bot cla-bot bot added the cla: yes label Nov 4, 2021
@pavel-ship-it pavel-ship-it marked this pull request as draft November 30, 2021 16:40
@hiragram
Copy link

hiragram commented Dec 9, 2021

@pavel-ship-it Do you have any plans to work on this PR?

@gongzhang
Copy link

I upgraded to Xcode 13.2 RC yesterday, and since the Swift compiler version was updated, this resulted in Realm's prebuilt XCFramework having to be recompiled.

When I executed carthage bootstrap --use-xcframeworks, Carthage went through the source build process as expected. But the result of the build is missing arm64 arch, so it doesn't work properly.

As a workaround, I can clone the realm-cocoa repository and build the correct XCFramework with build.sh. But I think we need to at least clarify this issue in the installation section of the documentation. After all, the current Carthage support is incomplete.

@olejnjak
Copy link

Probably to solve this it would rather make sense for Realm to make binary only XCFramework distribution, that would be ABI stable...this compilation exclusion would keep old framework distribution still possible and will save a lot of trouble for XCFramework users, still I think that Realm should be distributed XCFramework-first nowadays...

And if someone needs old fat framework, he should take care of it himself using a workaround script that will take care of removing arm64 simulator like this one...

@pavel-ship-it
Copy link
Contributor Author

Hi @hiragram, @olejnjak the code available here right now is not enough to address the original problem with the Carthage builds. Even though the code here eliminates the problem for some users, it is not flexible enough to let us build all of the required configurations.
Please let me some time to work on it. I'd expect the fix in the next month. I'll keep you all posted here in case I face any delay.

@pavel-ship-it pavel-ship-it marked this pull request as ready for review January 21, 2022 13:39
Copy link
Collaborator

@dianaafanador3 dianaafanador3 left a comment

Choose a reason for hiding this comment

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

I tested this and seems to be working fine, Only a small comment and LGTM

Jenkinsfile.releasability Outdated Show resolved Hide resolved
@pavel-ship-it pavel-ship-it merged commit 24550e9 into master Jan 27, 2022
@pavel-ship-it pavel-ship-it deleted the py/carthage_arm64 branch January 27, 2022 09:24
dianaafanador3 added a commit that referenced this pull request Feb 3, 2022
@hiragram
Copy link

hiragram commented Feb 4, 2022

@pavel-ship-it Thank you for your great work. When will the version including this patch be released?

@pavel-ship-it
Copy link
Contributor Author

@hiragram Thank you. It will be released later this month.

@pitoneux
Copy link

pitoneux commented Feb 21, 2022

This issue exists also with spm. Hope this fix addresses this too ?

@tgoyne
Copy link
Member

tgoyne commented Feb 22, 2022

Any problem you're having with SPM is entirely unrelated to this, and you should create a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet