bazel icon indicating copy to clipboard operation
bazel copied to clipboard

android_library deps stripped *.so

Open YunjiangYin opened this issue 4 years ago • 2 comments

Description of the problem / feature request:

I want to use a stripped library *.so in an android_library but android_library deps can't be a stripped cc_binary

Feature requests: what underlying problem are you trying to solve with this feature?

android_library deps can be cc_binary or a genrule

YunjiangYin avatar Aug 05 '19 02:08 YunjiangYin

Have you tried using a cc_import rule on the .so file, and creating a cc_library from that cc_import target? https://docs.bazel.build/versions/master/be/c-cpp.html#cc_import

jin avatar Oct 24 '19 14:10 jin

We have a use case for this feature. Our project uses a tool to extract symbols from a so library. Later, if the app crashes on the user's device, we can use the extracted symbols to symbolize the crash log. Similar to using the dSYM to symbolize the crash log for iOS app.

When using Gradle and CMake to build the android app, the unstripped so library is stored in intermediate folders. Then the so will be stripped and put into apk.

Maybe we can do something similar with bazel. When build android_binary we can supply --strip=never flag to make android_library produce an unstripped so library. Then in the implementation of android_binary, we strip the so` library.

kkpattern avatar Aug 03 '22 09:08 kkpattern