nodejs-mobile / nodejs-mobile-module-compat

Repo to open issues, discuss and share workarounds about node modules compatibility with nodejs-mobile
0 stars 0 forks source link

grpc - build workaround #2

Open jaimecbernardo opened 6 years ago

jaimecbernardo commented 6 years ago

grpc

iOS

grpc builds out of the box for iOS.

Android

For building grpc for Android, you need to remove the -zdefs flag from the build process, by deleting this line: https://github.com/grpc/grpc-node/blob/153501df82936348f7544743350abda0978c0bb2/packages/grpc-native-core/binding.gyp#L878

-zdefs does not seem to be accepted by the NDK compiler.

jaimecbernardo commented 6 years ago

grpc no longer has the -zdefs flag, so the workaround isn't needed anymore: https://github.com/grpc/grpc-node/pull/255

jaimecbernardo commented 5 years ago

We've received a report that for running correctly on Android 6 devices, the targetSDK and minSDK values have to been increased.

Thank you, @neogeno, for sharing this workaround.

jaimecbernardo commented 5 years ago

Newer versions of grpc add a node-pre-gyp name that still isn't patched by the nodejs-mobile plugins (glibc), which means it won't be properly loaded in the mobile device environment: https://github.com/grpc/grpc-node/blob/073dc563858a2d74bd114e5cc50d02203123078f/packages/grpc-native-core/package.json#L54

Current workarounds while this isn't fixed:

jaimecbernardo commented 5 years ago

The {libc} error should no longer affect newer releases of the nodejs-mobile plugin, since it's patched before trying to build the native modules.

jaimecbernardo commented 5 years ago

While trying to build grpc, the following error my occur:

error: unknown warning option '-Wno-cast-function-type'; did you mean '-Wno-bad-function-cast'? [-Werror,-Wunknown-warning-option]
make: *** [Release/obj.target/grpc_node/ext/byte_buffer.o] Error 1

Deleting -Wno-cast-function-type from https://github.com/grpc/grpc-node/blob/10a0472f1e205833a86104a79405d4722ad6af35/packages/grpc-native-core/binding.gyp#L965-L969 , which should be within node_modules/grpc/binding.gyp in the installation