SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix auto-download of CMake (#43511)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43511

Changelog: [Internal]

This is an attempt to fix [#39783](https://github.com/facebook/react-native/issues/39783).

It seems that when `configureBuildForHermes` runs (as part of `yarn android` in `rn-tester`) cmake may not be available and is not installed automatically:
* for 3p, even after installing the latest Android Studio, cmake 3.22.1 is not available by default but needs to be installed manually
* for Meta employees, same story when looking at the `ANDROID_HOME` set by the `setup_fb4a.sh` in the `.zshrc` file:
```
# added by setup_fb4a.sh
export ANDROID_SDK=/opt/android_sdk
export ANDROID_NDK_REPOSITORY=/opt/android_ndk
export ANDROID_HOME=${ANDROID_SDK}
export PATH=${PATH}:${ANDROID_SDK}/emulator:${ANDROID_SDK}/tools:${ANDROID_SDK}/tools/bin:${ANDROID_SDK}/platform-tools
```

This diff introduces an explicit task to install cmake.

### ALTERNATIVE 1

See D54897379.

### ALTERNATIVE 2

Suggested by cortinico:

> Create a mini module called :packages:react-native:ReactAndroid:hermes-engine:cmake-downloader which just triggers an empty cmake build via Android SDK

Reviewed By: cortinico

Differential Revision: D54859484

fbshipit-source-id: f9ecdf78ff408947b1e85e7da4f112c89d3a8c89
F
Fabrizio Cucci committed
f2c335ac962c54dad08484f121b5bdc073b497cc
Parent: fb42a55
Committed by Facebook GitHub Bot <[email protected]> on 3/15/2024, 5:16:29 PM