Skip to content

Guard cxxreact MethodCall tests under legacy-arch macro#56902

Closed
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D105737807
Closed

Guard cxxreact MethodCall tests under legacy-arch macro#56902
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D105737807

Conversation

@christophpurrer
Copy link
Copy Markdown
Contributor

Summary:
parseMethodCalls (used by packages/react-native/ReactCommon/cxxreact/tests/methodcall.cpp) is only declared in <cxxreact/MethodCall.h> when legacy architecture support is compiled in. Wrap the test body in #ifndef RCT_REMOVE_LEGACY_ARCH so the translation unit compiles to a no-op when legacy arch is removed, instead of failing with use of undeclared identifier 'parseMethodCalls'.

Also configure the tests target so its Apple builds run under a target platform that carries the react-fit-enabled constraint. A new per-package apple_target_platforms() declares tests-apple-platform, and the rn_xplat_cxx_test rule wires it in via fbobjc_ios_config_backed_target_platform / fbobjc_macosx_config_backed_target_platform. Under that configuration RCT_REMOVE_LEGACY_ARCH is defined and the guarded test body is elided, matching the behavior of the rest of the post-legacy-arch test suite.

Changelog: [Internal]

Differential Revision: D105737807

Summary:
`parseMethodCalls` (used by `packages/react-native/ReactCommon/cxxreact/tests/methodcall.cpp`) is only declared in `<cxxreact/MethodCall.h>` when legacy architecture support is compiled in. Wrap the test body in `#ifndef RCT_REMOVE_LEGACY_ARCH` so the translation unit compiles to a no-op when legacy arch is removed, instead of failing with `use of undeclared identifier 'parseMethodCalls'`.

Also configure the `tests` target so its Apple builds run under a target platform that carries the `react-fit-enabled` constraint. A new per-package `apple_target_platforms()` declares `tests-apple-platform`, and the `rn_xplat_cxx_test` rule wires it in via `fbobjc_ios_config_backed_target_platform` / `fbobjc_macosx_config_backed_target_platform`. Under that configuration `RCT_REMOVE_LEGACY_ARCH` is defined and the guarded test body is elided, matching the behavior of the rest of the post-legacy-arch test suite.

Changelog: [Internal]

Differential Revision: D105737807
@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 May 19, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 19, 2026

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105737807.

@meta-codesync meta-codesync Bot closed this in 3cfe3e3 May 19, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 19, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 19, 2026

This pull request has been merged in 3cfe3e3.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @christophpurrer in 3cfe3e3

When will my fix make it into a release? | How to file a pick request?

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants