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

Fix CI "Build Tests: Android Instrumentation Tests" errors #31352

Closed
wants to merge 1 commit into from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Apr 14, 2021

Summary

To fix the CI error
There are two errors:
error: undefined reference to '__android_log_write' which solved by adding -llog linker flag.

ld: error: cannot find -lc++ which workaround by static linking.
For the root cause, I am thinking that is after NDK r19,
the -target should specificy api level.
However, buck does not add this accordingly, e.g. -target armv7-none-linux-androideabi
Given wrong target will make NDK to have cannot find -lc++ error.
The workaround is to use static linking.
Since it was an oss_cxx_library, the change should not have impact to Facebook internal testing.

Changelog

[Internal] [Fixed] - Fix CI "Build Tests: Android Instrumentation Tests" errors

Test Plan

Make CI green

Summary:
  There are two errors:
  `error: undefined reference to '__android_log_write'` which solved by adding `-llog` linker flag.

  `ld: error: cannot find -lc++` which workaround by static linking.
  For the root cause, I am thinking that is after
  [NDK r19](https://developer.android.com/ndk/guides/other_build_systems),
  the `-target` should specificy api level.
  However, buck does not add this accordingly, e.g.
  `-target armv7-none-linux-androideabi`
  Given wrong target will make NDK to have `cannot find -lc++` error.
  The workaround is to use static linking.
  Since it was an oss_cxx_library, the change should not have impact to Facebook internal testing.
@facebook-github-bot facebook-github-bot added Contributor A React Native contributor. CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Apr 14, 2021
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a15a46c

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,820,923 -131,484
android hermes armeabi-v7a 8,355,072 -86,306
android hermes x86 9,277,840 -168,156
android hermes x86_64 9,215,923 -172,389
android jsc arm64-v8a 10,552,008 -132,465
android jsc armeabi-v7a 10,069,252 -87,303
android jsc x86 10,570,425 -169,140
android jsc x86_64 11,148,766 -173,375

Base commit: a15a46c

@Kudo
Copy link
Contributor Author

Kudo commented Apr 14, 2021

BTW there was a PR for buck to add api level to target: facebook/buck#2595

@facebook-github-bot
Copy link
Contributor

@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@fkgozali merged this pull request in e57de5f.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants