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

Support for Hermes + RN68 + new architecture #4488

Closed
KartikSubramaniam opened this issue Apr 11, 2022 · 7 comments
Closed

Support for Hermes + RN68 + new architecture #4488

KartikSubramaniam opened this issue Apr 11, 2022 · 7 comments
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@KartikSubramaniam
Copy link

KartikSubramaniam commented Apr 11, 2022

Hi ,
The beta version of realm works fine with RN68 which is not running on new architecture. However if we switch to new architecture the build fails. Do we have a support for the same?

Please find below the error details

Undefined symbols for architecture arm64:
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::deferredReaders", referenced from:
void folly::SharedMutexImpl<false, void, std::*1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::*1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&) in AppDelegate.o
void folly::SharedMutexImpl<false, void, std::*1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::*1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&, unsigned int) in AppDelegate.o
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::unlock()", referenced from:
std::*1::unique_lock<folly::SharedMutexImpl<false, void, std::*1::atomic, false, false, false> >::~unique_lock() in AppDelegate.o
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::~SharedMutexImpl()", referenced from:
std::*1::*shared_ptr_emplace<facebook::react::ContextContainer const, std::*1::allocator<facebook::react::ContextContainer const> >::*on_zero_shared() in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Originally posted by @KartikSubramaniam in #4487

@tomduncalf
Copy link
Contributor

Hi @KartikSubramaniam, thanks for the report. When you refer to the new architecture, do you mean when you run pod install with RCT_NEW_ARCH_ENABLED=1 set? I just created a sample project using React Native 0.68.0 and Realm 10.20.0-beta.4 and it works for me with the new architecture enabled.

Could you please try with realm@10.20.0-beta.4 and see if this fixes the issue for you?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Apr 12, 2022
@KartikSubramaniam
Copy link
Author

@tomduncalf Thanks for the advise , will try realm@10.20.0-beta.4 and check if it works.

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 13, 2022
@tomduncalf
Copy link
Contributor

Great thanks, please let me know either way!

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Apr 13, 2022
@KartikSubramaniam
Copy link
Author

Hi @tomduncalf The build works fine with Hermes + RN68 + New Architecture but it fails to archive
I Still get the same error

I had used the following command for pod install
fabric_enabled=1 hermes_enabled=1 RCT_NEW_ARCH_ENABLED=1 pod install

Error:
Undefined symbols for architecture arm64:
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::deferredReaders", referenced from:
void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&) in AppDelegate.o
void folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::applyDeferredReaders<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever>(unsigned int&, folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::WaitForever&, unsigned int) in AppDelegate.o
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::unlock()", referenced from:
std::__1::unique_lock<folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false> >::~unique_lock() in AppDelegate.o
"folly::SharedMutexImpl<false, void, std::__1::atomic, false, false, false>::~SharedMutexImpl()", referenced from:
std::__1::__shared_ptr_emplace<facebook::react::ContextContainer const, std::__1::allocator<facebook::react::ContextContainer const> >::__on_zero_shared() in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 14, 2022
@tomduncalf
Copy link
Contributor

tomduncalf commented Apr 14, 2022

Hey @KartikSubramaniam, thanks for clarifying that the problem only occurs when archiving. I was actually able to reproduce this by archiving a new React Native project created npx react-native init and RCT_NEW_ARCH_ENABLED=1 pod install (no Realm installed), so it seems like there might be a React Native issue here! Can you also repro this?

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Apr 14, 2022
@Arkkeeper
Copy link

Arkkeeper commented May 2, 2022

Yes, it's a RN issue. As a temporary dirty fix you can add something like:

folly

in the post_install do |installer| section of your Podfile

@tomduncalf
Copy link
Contributor

Thank you for sharing that workaround @Arkkeeper! Closing this as it is not a Realm-specific issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

3 participants