react-native-community / jsc-android-buildscripts

Script for building JavaScriptCore for Android (for React Native but not only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building out on macOS 10.14.3 -> CMake was unable to find a build program corresponding to "Ninja"

AustinHunt opened this issue · comments

Issue Description

When attempting to build the project, I run into this error. I have the ninja package installed, cmake, and all the rest installed. They all are available on my $PATH as well. Any help would be greatly appreciated.

Also, how do you choose which version of the jsc-android library to build? Where is that config? For instance, if I want to build this un-merged branch: facebookarchive/android-jsc#19

@AustinHunt any luck solving the issue. Been trying to get around it for a while but no luck 😕

The latest RN seems to have updated the Android JSC...haven’t tested or played with this build since I made the issue.

I got it to build, but took me quite long time from last commit. Here is things I did:

  1. jsc.sh needs to be changed:
    from ARCH_NAME_PLATFORM_arm="arm" to ARCH_NAME_PLATFORM_arm="armv5te"

There is no "arm" target in CMAKE Android-DeterminePlatform.cmake, so it can't really succeed.

  1. get rid of following flags in jsc.sh:
  -DCMAKE_C_COMPILER=$CROSS_COMPILE_PLATFORM-clang \
  -DCMAKE_CXX_COMPILER=$CROSS_COMPILE_PLATFORM-clang \

Setting C_COMPILER AND CXX_COMPILER flags is not recommended, there will be caching and infinite loop issues. Better is to export the variables CC and CXX. For me the current approach didn't work, as CMAKE seemed to restart itself because it changed CXX_COMPILER at some point, and had to refresh the task, losing some vairables in the process (such as PORT).

plus make sure there are no empty lines when you remove these two lines.

  1. add following exports before calling build-webkit in jsc.sh
export CC=$CROSS_COMPILE_PLATFORM-clang
export CXX=$CROSS_COMPILE_PLATFORM-clang
  1. enable SYSTEM_MALLOC in jsc.sh

For some reasons, I could not for the life of myself figure out what's wrong with that option, but read about it in the internet and see if you're happy.

  -DUSE_SYSTEM_MALLOC=ON \

I am probably not going to do pull request because I know too little how things are supposed to work, but I got it to build on OSX and they actually work when using react-native on phones.

BTW, which NDK version do you use to build?
Current supported NDK to build is r17c.

I use r17c, did everything according to instructions

Well, still have no idea for the reason of build failure.
I always to use a mac 10.14 to build and not getting problems.
Maybe cmake version ? That is 3.13.4 from my env.

Interesting, I've got:

MacOS 10.14.5
Cmake 3.7.2

XCode 10.2.1

Maybe it indeed could be CMAKE version, for now, I don't need to compile this project anymore as I finally got your jsc-android@245459-fix-clear-cache-no-dfg fix working.

I got it to build, but took me quite long time from last commit. Here is things I did:

  1. jsc.sh needs to be changed:
    from ARCH_NAME_PLATFORM_arm="arm" to ARCH_NAME_PLATFORM_arm="armv5te"

There is no "arm" target in CMAKE Android-DeterminePlatform.cmake, so it can't really succeed.

  1. get rid of following flags in jsc.sh:
  -DCMAKE_C_COMPILER=$CROSS_COMPILE_PLATFORM-clang \
  -DCMAKE_CXX_COMPILER=$CROSS_COMPILE_PLATFORM-clang \

Setting C_COMPILER AND CXX_COMPILER flags is not recommended, there will be caching and infinite loop issues. Better is to export the variables CC and CXX. For me the current approach didn't work, as CMAKE seemed to restart itself because it changed CXX_COMPILER at some point, and had to refresh the task, losing some vairables in the process (such as PORT).

plus make sure there are no empty lines when you remove these two lines.

  1. add following exports before calling build-webkit in jsc.sh
export CC=$CROSS_COMPILE_PLATFORM-clang
export CXX=$CROSS_COMPILE_PLATFORM-clang
  1. enable SYSTEM_MALLOC in jsc.sh

For some reasons, I could not for the life of myself figure out what's wrong with that option, but read about it in the internet and see if you're happy.

  -DUSE_SYSTEM_MALLOC=ON \

I am probably not going to do pull request because I know too little how things are supposed to work, but I got it to build on OSX and they actually work when using react-native on phones.

This was the only way I was able to successfully compile on Ubuntu 18.04 (cmake 3.10.2, ndk r17c).

I've been bumping my head about this whole day, so I would be very grateful if someone more experienced would review those proposed changes and comment if they are production ready.

Downgrading CMAKE to version 3.6 as described here (#87 (comment)) fixed this build issue for me on MacOS.