question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android][Linux] Building master RNTester on Linux fails while building Folly

See original GitHub issue

Description:

I’m on the latest git commit, and RNTester fails to build on Linux:

/tmp$ git clone https://github.com/facebook/react-native &&
   cd react-native &&
   npm install && 
   ./gradlew :RNTester:android:app:installJSCDebug
[...]
[armeabi-v7a] Compile++ thumb: folly_json <= FileUtil.cpp
make: Leaving directory '/tmp/react-native/ReactAndroid/src/main/jni/react/jni'
/tmp/react-native/ReactAndroid/build/third-party-ndk/folly/folly/FileUtil.cpp:37:14: error: no matching function for call to 'wrapNoInt'
  return int(wrapNoInt(open, name, flags, mode));
             ^~~~~~~~~
/tmp/react-native/ReactAndroid/build/third-party-ndk/folly/folly/detail/FileUtilDetail.h:34:9: note: candidate template ignored: couldn't infer template argument 'F'
ssize_t wrapNoInt(F f, Args... args) {
        ^
1 error generated.
make: *** [/tmp/fetchleak/sdk/ndk-bundle/build/core/build-binary.mk:478: /tmp/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/folly_json/folly/FileUtil.o] Error 1
make: *** Waiting for unfinished jobs....
[...]
make: Leaving directory '/tmp/react-native/ReactAndroid/src/main/jni/react/jni'

> Task :ReactAndroid:buildReactNdkLib FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '/tmp/fetchleak/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2

React Native version:

Git master, commit 5ebca708132be8720c28a565e03b04e1087326cf from Mar 12 (Android SDK downloaded today, commandlinetools-linux-6200805_latest.zip)

Steps To Reproduce

  1. Be on Linux. The problem does not appear on macOS.
  2. git clone https://github.com/facebook/react-native
  3. cd react-native
  4. npm install
  5. ./gradlew :RNTester:android:app:installJSCDebug

Expected Results

I expected RNTester to run

Snack, code example, screenshot, or link to a repository:

https://github.com/facebook/react-native/

The first commit that fails is 6e2131b8fa85da8b3fb0391803e7fbecba890ffb, “Upgrade Folly to v2020.01.13.00 (#27811)”. The preceding commit, a3cb377645f2ccb7632ded73c230a41025d38f6f, builds successfully.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
willholencommented, Mar 13, 2020

I kludged around this by overwriting ReactAndroid/build/third-party-ndk/folly/folly/FileUtil.cpp with a version that defines openNoInt by copying the logic from wrapNoInt rather than calling it. I can then build successfully:

int openNoInt(const char* name, int flags, mode_t mode) {
  ssize_t r;
  do {
    r = open(name, flags, mode);
  } while (r == -1 && errno == EINTR);
  return r;
}
3reactions
Kudocommented, May 30, 2021

created a pr for folly to address this: https://github.com/facebook/folly/pull/1593 this may not have much difference to the workaround but should explain why this broken after ndk r21.

Read more comments on GitHub >

github_iconTop Results From Across the Web

folly-ios on CocoaPods.org
Folly (acronymed loosely after Facebook Open Source Library) is a library of C++11 components designed with practicality and efficiency in mind.
Read more >
react-native-reanimated:configureCMakeDebug[arm64-v8a]
FAILURE: Build completed with 2 failures. 1: Task failed with an exception. What went wrong: Execution failed for task ':react-native-reanimated ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found