Repository navigation
Fix Hermes configuration after the source directory changes - #59514
Open
shamilovtim wants to merge 1 commit into
Open
shamilovtim wants to merge 1 commit into
shamilovtim wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Author's note
Hello maintainers, I have to run this patch on
react-native@0.88.0, otherwise Android source builds won't compile. Please consider a patch release addressing this issue so other users can benefit.Summary
Fixes #59513
Building Hermes from source fails when its CMake build directory contains a cache from a previous source location. CMake rejects the old path before compilation starts.
Clear
CMakeCache.txtandCMakeFilesbefore either Hermes configure task executes. Gradle still skips the task when nothing changes. Use file cleanup so theCMAKE_VERSION=3.22.1override continues to work. That CMake version does not support--fresh.The reported failure came from a pnpm 12.3.4 monorepo with ccache 4.14.2 enabled for native compilation. The source-only reproducer runs in an upstream checkout.
Changelog
[ANDROID] [FIXED] - Fix Hermes source builds failing after the source directory changes.
Test plan
UP-TO-DATE../gradlew -p packages/gradle-plugin build -PenableWarningsAsErrors=true. All 285 tests passed. SetJAVA_TOOL_OPTIONS=-Djava.io.tmpdir=/private/tmp/react-native-hermes-gradle-teststo avoid an existing macOS/varversus/private/varpath assertion failure.yarn format-check-kotlinandgit diff --check.configureBuildForHermesandconfigureBuildForHermesWithDebuggerwithCMAKE_VERSION=3.22.1andCMAKE_VERSION=3.30.5. Both variants passed, and repeated calls stayedUP-TO-DATE.:packages:react-native:ReactAndroid:hermes-engine:buildHermesCand compiled a JavaScript file to bytecode with the resulting compiler.:packages:react-native:ReactAndroid:hermes-engine:assembleReleasefor arm64. The release AAR built successfully. Repeated host configuration and compiler tasks stayedUP-TO-DATE.buildHermesC. All 239 existing Hermes object files kept their modification times.Native commands used
-Preact.internal.useHermesNightly=false -PreactNativeArchitectures=arm64-v8a. Validation ran on macOS arm64 with JDK 17.0.20. Windows and Linux builds were not run.