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

Could not build arm64 contains xcframework for iOS simulator by Carthage. #7151

Closed
r-plus opened this issue Feb 26, 2021 · 8 comments
Closed
Assignees

Comments

@r-plus
Copy link

r-plus commented Feb 26, 2021

Carthage built xcframework for realm will not contains arm64 slice for ios simulator, thus I could not build my project for ios simulator on M1 mac.

Goals

carthage bootstrap --platform iOS --use-xcframeworks --no-use-binaries realm-cocoa
command will compile arm64, i386 and x86_64 contains xcframework for ios simulator.

Expected Results

built xcframework contains ios-arm64_i386_x86_64-simulator directory.

Actual Results

contains ios-i386_x86_64-simulator

Steps for others to Reproduce

$ carthage version
0.37.0

$ echo 'github "realm/realm-cocoa"' > Cartfile

$ carthage bootstrap --platform iOS --use-xcframeworks --no-use-binaries realm-cocoa
*** No Cartfile.resolved found, updating dependencies
*** Fetching realm-cocoa
*** Checking out realm-cocoa at "v10.7.0"
*** xcodebuild output can be found in /var/folders/st/df0gjt9x5tl0cv7fw0xg5s9m0000gn/T/carthage-xcodebuild.LjYtzX.log
*** Building scheme "RealmSwift" in Realm.xcworkspace
*** Building scheme "Realm iOS static" in Realm.xcworkspace
*** Building scheme "Realm" in Realm.xcworkspace

$ ls -1 Carthage/Build/Realm.xcframework
Info.plist
ios-arm64_armv7
ios-i386_x86_64-simulator

$ ls -1 Carthage/Build/RealmSwift.xcframework
Info.plist
ios-arm64_armv7
ios-i386_x86_64-simulator

Code Sample

n/a

Version of Realm and Tooling

Realm framework version: v10.7.0

Realm Object Server version: n/a

Xcode version: 12.4

iOS/OSX version: n/a, using mac is M1 mac 11.2.0

Dependency manager + version: Carthage 0.37.0

@pavel-ship-it
Copy link
Contributor

Hi @r-plus,
There is an issue with Carthage and Xcode 12+ - in two words - it can't build arm64 for iOS and M1 (or Simulator in this case) at same time. Please refer to the workaround described in Carthage docs - https://github.com/Carthage/Carthage#building-platform-specific-framework-bundles-default-for-xcode-11-and-below

@r-plus
Copy link
Author

r-plus commented Mar 1, 2021

@pavel-ship-it That issue is already resolved by xcframeworks. Latest carthage already supported to building xcframeworks.
This issue talk about it.

@pavel-ship-it
Copy link
Contributor

@r-plus, you right. My bad. I'll take a deeper look in to this problem.

@edfanhouse
Copy link

edfanhouse commented Mar 2, 2021

Hello,

I found a workaround with commenting arm64 exclusion on "Base.xcconfig" when building with Carthage :

Capture d’écran 2021-03-02 à 11 24 41

Capture d’écran 2021-03-02 à 11 28 57

@r-plus
Copy link
Author

r-plus commented Mar 2, 2021

@edfanhouse nice! that it!

Remaining issue but maybe this is not blocking

  • workflow to create pre-build binary for carthage that uploaded to github releases like RxSwift
    AFAIK, carthage archive command is not yet support xcframework.
    NOTE: carthage 0.37 is not yet support download pre-build xcframework.

Users can workaround issue about simulator arm64 slice conflict by this https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md#workaround-script workaround script, therefore, adding a workaround on the framework side is not suitable now that carthage supports the xcframework.

@pavel-ship-it
Copy link
Contributor

@r-plus , @edfanhouse thanks for help. I'll create a pull request to enable arm64 builds

@r-plus
Copy link
Author

r-plus commented Mar 31, 2021

for link: #7158

@pavel-ship-it
Copy link
Contributor

Fixed in #7158
Available on master. Will be released in the upcoming version.

chatdep-rtf added a commit to chatdep-rtf/realm-swift that referenced this issue Apr 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants