Skip to content

Fix auto-download of CMake#43511

Closed
fabriziocucci wants to merge 1 commit into
facebook:mainfrom
fabriziocucci:export-D54859484
Closed

Fix auto-download of CMake#43511
fabriziocucci wants to merge 1 commit into
facebook:mainfrom
fabriziocucci:export-D54859484

Conversation

@fabriziocucci

Copy link
Copy Markdown
Contributor

Summary:
Changelog: [Internal]

This is an attempt to fix #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

Differential Revision: D54859484

Summary:
Changelog: [Internal]

This is an attempt to fix [facebook#39783](facebook#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

Differential Revision: D54859484
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 15, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D54859484

@analysis-bot

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,127,101 +13
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,493,824 -2
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: fb42a55
Branch: main

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in f2c335a.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 15, 2024
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. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMake autoDownload is not working as configureBuildForHermes is letting the build fail

3 participants