jhugman / uniffi-bindgen-react-native

A uniffi bindings generator for calling Rust from react-native
https://jhugman.github.io/uniffi-bindgen-react-native/
Other
50 stars 5 forks source link

Update for react-native 0.76 #147

Closed jhugman closed 2 weeks ago

jhugman commented 3 weeks ago

This PR tests the React Native update to 0.76 and fixes breakages introduced.

Breaking changes:

zzorba commented 2 weeks ago

So building on RN 75.4, this is working great on iOS.

On android, I'm getting a build error of some kind. We've made some recent changes to logging, butI don't see this happening on our older version of UBRN.

Going to try to dig in some more this afternoon.


* What went wrong:
Execution failed for task ':rn-diode:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/daniel/filament/node_modules/rn-diode/android/.cxx/Debug/272f5443/arm64-v8a'
  [1/6] Building CXX object CMakeFiles/rn-diode.dir/cpp-adapter.cpp.o
  [2/6] Building CXX object CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/rn-diode.cpp.o
  [3/6] Building CXX object CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/matrix_sdk_ui.cpp.o
  [4/6] Building CXX object CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/diode.cpp.o
  [5/6] Building CXX object CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/matrix_sdk_ffi.cpp.o
  [6/6] Linking CXX shared library ../../../../build/intermediates/cxx/Debug/272f5443/obj/arm64-v8a/librn-diode.so
  FAILED: ../../../../build/intermediates/cxx/Debug/272f5443/obj/arm64-v8a/librn-diode.so 
  : && /Users/daniel/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/daniel/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -O2 -fexceptions -frtti -fstack-protector-all -Wall -Werror -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--no-undefined-version -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,librn-diode.so -o ../../../../build/intermediates/cxx/Debug/272f5443/obj/arm64-v8a/librn-diode.so CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/rn-diode.cpp.o CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/diode.cpp.o CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/matrix_sdk_ffi.cpp.o CMakeFiles/rn-diode.dir/Users/daniel/filament/node_modules/rn-diode/cpp/generated/matrix_sdk_ui.cpp.o CMakeFiles/rn-diode.dir/cpp-adapter.cpp.o  /Users/daniel/.gradle/caches/8.8/transforms/c8b09efce9b75b1f4d221340b280d90e/transformed/jetified-react-android-0.75.4-debug/prefab/modules/turbomodulejsijni/libs/android.arm64-v8a/libturbomodulejsijni.so  /Users/daniel/.gradle/caches/8.8/transforms/c8b09efce9b75b1f4d221340b280d90e/transformed/jetified-react-android-0.75.4-debug/prefab/modules/react_nativemodule_core/libs/android.arm64-v8a/libreact_nativemodule_core.so  /Users/daniel/.gradle/caches/8.8/transforms/b416c89e79d85ece96ee7ead7f6d5bb5/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/libs/android.arm64-v8a/libfbjni.so  /Users/daniel/.gradle/caches/8.8/transforms/c8b09efce9b75b1f4d221340b280d90e/transformed/jetified-react-android-0.75.4-debug/prefab/modules/jsi/libs/android.arm64-v8a/libjsi.so  ../../../../src/main/jniLibs/arm64-v8a/libdiode.a  -latomic -lm && :
  ld.lld: error: undefined symbol: __android_log_buf_write
  >>> referenced by paranoid_android.e20bba25803d166b-cgu.2
  >>>               paranoid_android-efabf5b6f12f4dbb.paranoid_android.e20bba25803d166b-cgu.2.rcgu.o:(_$LT$paranoid_android..writer..AndroidLogWriter$u20$as$u20$std..io..Write$GT$::flush::h744c8a31621d62fe) in archive ../../../../src/main/jniLibs/arm64-v8a/libdiode.a
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.

  C++ build system [build] failed while executing:
      /Users/daniel/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/daniel/filament/node_modules/rn-diode/android/.cxx/Debug/272f5443/arm64-v8a \
        rn-diode
    from /Users/daniel/filament/node_modules/rn-diode/android

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
zzorba commented 2 weeks ago

Okay, its not related to our recent logging change, still exploring other remedies

Johennes commented 2 weeks ago

Can confirm this works with RN 0.76.0 on Android with the fix from https://github.com/jhugman/uniffi-bindgen-react-native/commit/5314616d5c6f60c1c8f8b5aa279782d91a9cb843.