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

Yoga symbols collision #345

Closed
alextoudic opened this issue Oct 16, 2024 · 7 comments
Closed

Yoga symbols collision #345

alextoudic opened this issue Oct 16, 2024 · 7 comments

Comments

@alextoudic
Copy link

alextoudic commented Oct 16, 2024

Description

I'm experiencing an EXC_BAD_ACCESS error with YGNodeStyleSetMinWidth when using use_frameworks! :linkage => :static in a project that uses Yoga for layout (specifically with React Native)

Provide a Repro

You can find the reproduction setup here: https://github.com/alextoudic/rive-yoga-collision-repro/tree/main/ios

Expected behavior

Both the Rive runtime and React Native should function correctly, using their respective Yoga symbols as intended

Screenshots

image

Stack trace:

* thread #8, queue = 'com.facebook.react.ShadowQueue', stop reason = EXC_BAD_ACCESS (code=1, address=0x104100)
    frame #0: 0x0000000000104100
    frame #1: 0x000000010620578c RiveRuntime`YGNode::markDirtyAndPropagate() + 36
  * frame #2: 0x00000001094d3140 YogaCollision.debug.dylib`-[RCTShadowView layoutWithMinimumSize:maximumSize:layoutDirection:layoutContext:](self=0x000000010661c590, _cmd="layoutWithMinimumSize:maximumSize:layoutDirection:layoutContext:", minimumSize=(width = 0, height = 0), maximumSize=(width = 402, height = 874), layoutDirection=UIUserInterfaceLayoutDirectionLeftToRight, layoutContext=RCTLayoutContext @ 0x000000016b97df70) at RCTShadowView.m:268:5
    frame #3: 0x00000001094c1330 YogaCollision.debug.dylib`-[RCTRootShadowView layoutWithAffectedShadowViews:](self=0x000000010661c590, _cmd="layoutWithAffectedShadowViews:", affectedShadowViews=0x000060000214ecb0) at RCTRootShadowView.m:35:3
    frame #4: 0x00000001094e7014 YogaCollision.debug.dylib`-[RCTUIManager uiBlockWithLayoutUpdateForRootView:](self=0x000060000291bbf0, _cmd="uiBlockWithLayoutUpdateForRootView:", rootShadowView=0x000000010661c590) at RCTUIManager.m:549:3
    frame #5: 0x00000001094ed104 YogaCollision.debug.dylib`-[RCTUIManager _layoutAndMount](self=0x000060000291bbf0, _cmd="_layoutAndMount") at RCTUIManager.m:1126:22
    frame #6: 0x00000001094ecfa8 YogaCollision.debug.dylib`-[RCTUIManager batchDidComplete](self=0x000060000291bbf0, _cmd="batchDidComplete") at RCTUIManager.m:1109:3
    frame #7: 0x000000010943b114 YogaCollision.debug.dylib`__32-[RCTCxxBridge batchDidComplete]_block_invoke(.block_descriptor=0x0000600000ce0c30) at RCTCxxBridge.mm:1514:13
    frame #8: 0x0000000104e6cec0 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #9: 0x0000000104e6e7b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame #10: 0x0000000104e76aac libdispatch.dylib`_dispatch_lane_serial_drain + 912
    frame #11: 0x0000000104e777b0 libdispatch.dylib`_dispatch_lane_invoke + 420
    frame #12: 0x0000000104e841f0 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 324
    frame #13: 0x0000000104e8375c libdispatch.dylib`_dispatch_workloop_worker_thread + 732
    frame #14: 0x0000000104f07814 libsystem_pthread.dylib`_pthread_wqthread + 284

Device & Versions (please complete the following information)

  • Device: iOS Simulator
  • iOS version: 18

Additional context

The reproduction project is built using Expo with a patched version of rive-react-native to ensure the latest RiveRuntime version (the issue persists with or without this patch). This problem only arises when using use_frameworks! :linkage => :static, which is necessary in my case to integrate @react-native-firebase

I previously commented on this issue but believe this problem may be more related to the loading of Rive's Yoga symbols in a project with overlapping Yoga dependencies when libraries are not dynamically linked. Any insights from iOS developers would be greatly appreciated

@Maniae
Copy link

Maniae commented Nov 4, 2024

I'm wondering if a static framework version as suggested in #336 would fix the issue ?
Currently, it makes Rive unusable on ios with React Native if React-Native-Firebsae (a very common library) or other static framework is used

@luigi-rosso
Copy link
Contributor

We have a renames header that we use to help avoid collisions like this.

We might need to add some symbols to it @dskuza.

Or, are we somehow disabling this on iOS? https://github.com/rive-app/rive-runtime/blob/main/dependencies/premake5_yoga_v2.lua

https://github.com/rive-app/rive-runtime/blob/main/dependencies/rive_yoga_renames.h

@luigi-rosso
Copy link
Contributor

Looks like we are in fact missing YGNodeStyleSetMinWidth, and potentially more.

@Maniae
Copy link

Maniae commented Nov 6, 2024

I see the symbol on this line: https://github.com/rive-app/rive-runtime/blob/6f82f888172a8bb0ce16c1ff5b818156b326fad6/dependencies/rive_yoga_renames.h#L229

I'm not sure how the runtime is compiled, but I noticed the premake5_yoga_v2 script is called with the option --no-yoga-renames https://github.com/rive-app/rive-runtime/blob/6f82f888172a8bb0ce16c1ff5b818156b326fad6/dependencies/gen_yoga_renames/gen_renames.sh#L41

(It is then called again "just to examine the exported symbols...")

@maximilianhagerf
Copy link

Any update on this or a fix?
Ran into the same issue with Expo SDK 51 with firebase and rive-react-native 6.0.4...

@Maniae
Copy link

Maniae commented Nov 13, 2024

Is this commit related ? rive-app/rive-runtime@d3e4bcf 👀

rive-engineering pushed a commit to rive-app/rive-runtime that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)

Co-authored-by: David Skuza <[email protected]>
rive-engineering pushed a commit that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
rive-engineering pushed a commit to rive-app/rive-rs that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
rive-engineering pushed a commit to rive-app/rive-android that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
rive-engineering pushed a commit to rive-app/rive-wasm that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
rive-engineering pushed a commit to rive-app/rive-sharp that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
rive-engineering pushed a commit to rive-app/rive-unreal that referenced this issue Dec 5, 2024
This pull request addresses the following GitHub issues and more:
- [rive-ios #345](rive-app/rive-ios#345)
- [rive-react-native #268](rive-app/rive-react-native#268)

Thanks to some help from @luigi-rosso, we discovered that the iOS runtime build scripts were _not_ including the Yoga renames, causing a collision when some frameworks were statically linked in React Native environments.

This has been tested locally, and works, but the real test will be the public.

Diffs=
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
@alextoudic
Copy link
Author

I can confirm it's been fixed in 6.4.2 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants