Skip to content

Always run cmake --build for Fantom's tester - #59725

Merged
javache merged 1 commit into
react:mainfrom
lazerg:fix/issue-59723-fantom-tester-rebuild
Nov 2, 2026
Merged

javache merged 1 commit into
react:mainfrom
lazerg:fix/issue-59723-fantom-tester-rebuild

Conversation

@lazerg

@lazerg lazerg commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Summary:

yarn workspace @react-native/fantom build doesn't rebuild the tester after a change to ReactCommon, ReactCxxPlatform or a third-party dependency, so yarn fantom keeps running the old binary. buildFantomTester only declares the CMake build tree's generated files (*.cmake, Makefile, link.txt, ...) as inputs, and none of those change when a source outside tester/ does, so Gradle marks the task up to date and never calls CMake.

This marks buildFantomTester with outputs.upToDateWhen { false }, so cmake --build always runs and CMake, which already tracks every source and header, decides what to rebuild. When nothing changed it's a no-op.

Fixes #59723

Changelog:

[INTERNAL] [FIXED] - Rebuild Fantom's tester when sources outside the tester folder change

Test Plan:

I don't have the Android SDK and Hermes build Fantom needs on this machine, so I copied the configureFantomTester / buildFantomTester wiring (same inputs, outputs and CustomExecTask log outputs) into a small Gradle 9.4.1 project that builds a CMake executable from a source file outside the tester folder. Before the change, editing that file and running buildFantomTester again reports UP-TO-DATE and the binary keeps printing the old value. With outputs.upToDateWhen { false }, the task runs, the binary is rebuilt with the new value, and a second run with no changes just prints Built target fantom_tester.

@meta-cla meta-cla 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 Oct 31, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 31, 2026

@Manishram-ai Manishram-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a small Gradle project with a task set up like buildFantomTester. Its only inputs were generated .cmake files and its only output was a log file, like the log files CustomExecTask declares. After I changed a source file outside the inputs, Gradle still marked the task UP-TO-DATE and skipped it. With outputs.upToDateWhen { false } it ran every time and picked up the change. Letting CMake decide what to rebuild makes sense to me.

@meta-codesync

meta-codesync Bot commented Nov 2, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D129046660.

@javache
javache enabled auto-merge (squash) November 2, 2026 10:40
@javache
javache merged commit c29a37c into react:main Nov 2, 2026
99 of 100 checks passed
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fantom's tester is not rebuilt after a change to ReactCommon: Gradle calls buildFantomTester up to date and yarn fantom runs the old tester

3 participants