flipper: Boost library support for arm64 and i386 for iOS Simulator(Unable to build and run iOS Sample project for M1 iOS Sim)

🐛 Bug Report

I’m unable to build and run the iOS/Sample project.

To Reproduce

  1. clone the repo
  2. cd flipper/iOS/Sample
  3. pod install
  4. open Sample.xcworkspace
  5. On XCode: Run the Sample target

Environment

  • MacOSX: 11.3 (20E232) Apple M1
  • XCode: 12.5 (12E262)
  • iOS Simulator iPhone 11 Pro Max, iOS 14.5
  • cocoapods: 1.10.1
  • Flipper 0.87.0 (50.0.0) - I’ve tried both the standalone Mac installer as well as the Brew one
  • boost 1.75.0_3 installed via Brew, if relevant
Screenshot 2021-05-04 at 17 45 41

I have the feeling the issue is coming from Flipper-Boost-iOSX but I’m not familiar with the way linking works. Let me know if I can give you more info.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 22 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I’m also getting this issue on my macbook pro corei7 (not M1), I tried Flipper version 0.87.0, 0.88.0, 0.89.0, 0.90.0 and 0.90.2 but still this issue is showing up. I’m using

  • OSX 11.3.1
  • Xcode 12.5
  • RN 0.64.0

thanks,

Edit: I think the issue show’s up when Flipper-Boost-iOSX added/updated. Can anyone suggest a solution with this issue?

Edit 2: I’ve found a solution which needs other flipper tools to downgrade. use_flipper!({ 'Flipper' => '0.87.0', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1' }) This will remove the Flipper-Boost-iOSX which solve the issue when reverting back to 0.87.0 found it on this link https://github.com/facebook/flipper/issues/2248#issuecomment-830060572

Using Flipper-Boost-iOSX 1.76.0.1.11 will solve the issue. With this version we now support all architectures. Let us know if there are any issue.

@mweststrate I’m with you regarding +1 comments. I just wanted to point out this issue doesn’t seem to have much to do with facebook/react-native#31480. The issue here is regarding building flipper (without RN), regardless of the XCode version, on M1 Macs.

@priteshrnandgaonkar thank you very much for taking the time to investigate. I’ll give version 0.87 a try. I haven’t noticed 0.88 would work with real devices, will try that also.

I tried to look for the boost ios libraries. And found two candidates, which are Apple-Boost-BuildScript and boost-iosx.

Currently we are using a forked version of boost-iosx, which doesn’t have arm64 and i386 support for simulators. I tried changing the script and tried to build it for arm64 and i386 for sims, but I was facing issues creating a fat library.

I tried Apple-Boost-BuildScript with the patch, as it enables the support of arm64 and i386 for sims. But it doesn’t build boost_context for iOS, which is actually used by us.

We would appreciate the community support in this.

Thank you for having a look @passy . I noticed GH actions uses XCode 12.4 by default. I’ve tried building the project on that but no luck.

I’ve also tried manually adding boost_context.xcframework to Link Binary With Libraries .

Screenshot 2021-05-05 at 16 46 18

The original error is gone but I’m now getting another error:

Undefined symbols for architecture arm64:
  "_jump_fcontext", referenced from:
      folly::fibers::FiberImpl::deactivate() in libFlipper-Folly.a(Fiber.o)
  "_make_fcontext", referenced from:
      folly::fibers::FiberImpl::FiberImpl(folly::Function<void ()>, unsigned char*, unsigned long) in libFlipper-Folly.a(Fiber.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Screenshot 2021-05-05 at 16 50 18

I believe the issue comes from the fact I’m on Apple M1 chip while GH virtual environments use x86 architecture.

@shahchirag2110 I am confused why Flipper-Folly 2.6.7 is used. if Flipper-Folly is (~> 2.5). Can you pin 2.5.3 and try again ?

@priteshrnandgaonkar you save my day. thank you so much

@shahchirag2110 I am confused why Flipper-Folly 2.6.7 is used. if Flipper-Folly is (~> 2.5). Can you pin 2.5.3 and try again ?

@drewbombard, as mentioned here. i386 arch is missing for boost, thats why it won’t work for intel machines too. Please fall back to 0.87

To summarize with regards to iOS setup:

0.87: will support both M1 and non-M1 Mac machines. Please use that for the time being as it works in all the cases for both Mac machine types.

0.88: This version updates all our internal deps like folly, boost and rsocket and it just supports non M1 and non intel mac machines for simulators. It won’t work on M1 Mac and intel based machine simulators(if rosetta is not used)). This version will work when built on actual physical device for both M1 and non M1 machines.

We are looking into making our setup more robust and so that these issues won’t happen. Please bear with us till then.