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

[iOS] Expo EAS Xcode version incompatible with 10.20.0.beta3 #4462

Closed
thespacemanatee opened this issue Mar 30, 2022 · 12 comments
Closed

[iOS] Expo EAS Xcode version incompatible with 10.20.0.beta3 #4462

thespacemanatee opened this issue Mar 30, 2022 · 12 comments
Assignees

Comments

@thespacemanatee
Copy link
Contributor

thespacemanatee commented Mar 30, 2022

How frequently does the bug occur?

All the time

Description

With the latest version, I am unable to build my project on Expo EAS build service.

The Expo team says that it is difficult for them to upgrade Xcode on their VMs. Would it be possible to make this library compatible with an older version of Xcode?

Thank you!

Stacktrace & log output

❌  ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1316.0.21.2.0_0' Reader: '1300.0.29.30_0')', using libLTO version 'LLVM version 13.0.0, (clang-1300.0.29.30)' for architecture arm64

Can you reproduce the bug?

Yes, always

Reproduction Steps

Build project on Expo EAS servers with [email protected].

Version

10.20.0.beta3

What SDK flavour are you using?

MongoDB Realm (i.e. Sync, auth, functions)

Are you using encryption?

No, not using encryption

Platform OS and version(s)

iOS

Build environment

No response

Cocoapods version

1.11.3

@kraenhansen
Copy link
Member

kraenhansen commented Mar 31, 2022

I'm on a fully upgraded system and unable to verify this, but we should support being built on Xcode 10 and above (just as React Native does). As such I'll close this issue. Please re-open with information on specific versions of Xcode that the build is failing for and ideally exact steps to reproduce this.

I have a colleague with a bitcode related issues after upgrading to macOS Monterey which also required an update to Xcode. It might be that the Expo builders have upgraded OS but miss the Xcode upgrade required.

@kraenhansen kraenhansen self-assigned this Mar 31, 2022
@thespacemanatee
Copy link
Contributor Author

thespacemanatee commented Mar 31, 2022

Based on my conversation with the Expo team here I would assume that they are using Xcode 13.2.1. I would also like to point out that earlier builds that I was using up to 10.20.0.beta2 works, so something must have changed in the latest release. For now, the only workaround is to disable bitcode which is not ideal.

EDIT: Based on this table seems like Expo VMs are still using Xcode 13.2.1 with [email protected] and Xcode 13.3 is using [email protected] which is the root cause of this incompatibility.

@kraenhansen
Copy link
Member

Have you tried reverting your upgrade to verify that the 10.20.0.beta2 version still works on their build nodes? I mean, it might have been a change to their infrastructure which happened between your upgrades.

@thespacemanatee
Copy link
Contributor Author

thespacemanatee commented Mar 31, 2022

Have you tried reverting your upgrade to verify that the 10.20.0.beta2 version still works on their build nodes? I mean, it might have been a change to their infrastructure which happened between your upgrades.

Yes, I have tried switching between beta2 and beta3 several times over the course of the past week and this is reproducible for me consistently. beta2 always works and beta3 does not. I have turned off bitcode for now and it works at the moment.

@kraenhansen
Copy link
Member

kraenhansen commented Mar 31, 2022

Okay - thanks for verifying that!

I believe the XCFramework shipped with 10.20.0-beta.3 was build using Xcode 13.3 (13E113), which does include a major version upgrade of LLVM.

Depending on what build tools exists on the Expo builder nodes, it might be possible to build the XCFramework from within the realm package:

cd node_modules/realm
./scripts/build-ios.sh

This would produce binaries build with the same version of Xcode that the machines run and would most likely resolve the issue for you 🤞
To speed things up, the build script does support a way to build only for certain platforms (see its sourcecode for details).

@thespacemanatee
Copy link
Contributor Author

Thanks for the explanation and also the quick replies! I will try it out and worse case we'll just have to disable bitcode until Expo updates their Xcode version which is fine since we are still in the development phase 🙂

@kraenhansen
Copy link
Member

kraenhansen commented Mar 31, 2022

I just tried this locally and realised a patch is needed to our cmake configuration to enable building from our NPM artifact: 9ad22a7 I'll work towards getting this merged and released, but in the meantime you should be able to apply that patch and build from the NPM package.

@kraenhansen
Copy link
Member

I just had a chat with my colleague on the Realm Swift team and we'll work towards building the XCFramework we release with an older version of Xcode as those binaries will be consumable by newer versions of Xcode perfectly fine. This should make it possible to consume from any Xcode version reasonably used by developers or other services such as Expo EAS. Thanks a lot for bringing this to our attention!

@thespacemanatee
Copy link
Contributor Author

@kraenhansen My pleasure and happy to contribute in a tiny way to such an awesome project!

@kraenhansen
Copy link
Member

@thespacemanatee I'm pleased to announce that we just released v10.20.0-beta.4 which was built using Xcode 12.4 - hopefully solving your original issue 🤞

Thanks again for reporting this!

@thespacemanatee
Copy link
Contributor Author

thespacemanatee commented Apr 11, 2022

@kraenhansen Just did a build on EAS with bitcode enabled and can verify that it works great, thanks again for resolving it so quickly 😊

@kraenhansen
Copy link
Member

@thespacemanatee this is great news!

@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.
Projects
None yet
Development

No branches or pull requests

2 participants