Page MenuHomePhabricator

[native] fix iOS build on x86_64
ClosedPublic

Authored by varun on Nov 14 2023, 1:47 PM.
Tags
None
Referenced Files
F3183919: D9886.id33279.diff
Fri, Nov 8, 10:02 AM
Unknown Object (File)
Thu, Oct 31, 3:46 AM
Unknown Object (File)
Sun, Oct 20, 1:37 PM
Unknown Object (File)
Tue, Oct 15, 12:52 AM
Unknown Object (File)
Tue, Oct 15, 12:52 AM
Unknown Object (File)
Tue, Oct 15, 12:52 AM
Unknown Object (File)
Tue, Oct 15, 12:52 AM
Unknown Object (File)
Sep 14 2024, 5:09 PM
Subscribers

Details

Summary

In the Library Search Paths section of our Xcode project, we list:

"$(SRCROOT)/../native_rust_library/target/aarch64-apple-ios/release",
"$(SRCROOT)/../native_rust_library/target/x86_64-apple-ios/release",

When we build for Any iOS Device (arm64), Xcode locates the arm64 static library in the first search path. Then, when we build for Simulator (x86_64), Xcode again locates the arm64 static library in the first search path, and we get an error.

If we haven't previously built for Any iOS Device (arm64), when we build for Simulator (x86_64), Xcode doesn't find anything in the first search path, locates the x86_64 static library in the second search path, and builds successfully.

The solution is to set the search paths conditionally.

Test Plan

built the app for any iOS device, then for simulator, then did an archive build (release). All succeeded. Tried them in various orders just to be sure.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/ios/Comm.xcodeproj/project.pbxproj
1252 ↗(On Diff #33224)

We have to include "$(inherited)", so that the above paths are also searched

varun requested review of this revision.Nov 14 2023, 2:07 PM
ashoat added a reviewer: atul.
ashoat added inline comments.
native/ios/Comm.xcodeproj/project.pbxproj
1255–1258 ↗(On Diff #33224)

This line seems to lock us into running Rosetta in the Simulator... is there any other discriminant you can use other than sdk=, eg. arch= or something? If not can you add a comment to ENG-3613 so we remember we'll need to address this later?

This revision is now accepted and ready to land.Nov 14 2023, 3:44 PM
native/ios/Comm.xcodeproj/project.pbxproj
1255–1258 ↗(On Diff #33224)

left a comment

This revision was automatically updated to reflect the committed changes.