Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Java toolchains per project #41306

Closed
wants to merge 1 commit into from
Closed

Configure Java toolchains per project #41306

wants to merge 1 commit into from

Conversation

UNIDY2002
Copy link
Contributor

@UNIDY2002 UNIDY2002 commented Nov 3, 2023

Summary:

A follow-up fix on #40560

The fix introduced by #40757 worked under the false assumption that :app gets evaluated before any other library. However, some libraries, such as @amplitude/analytics-react-native (whose project name is :amplitude_analytics-react-native), might be evaluated before :app and miss the configureJavaToolChains() process.

This PR changes configureJavaToolChains() into a per-project implementation, and invokes the function during both library and app configurations. This can ensure that all projects get their Java toolchains configured promptly.

Changelog:

[ANDROID] [FIXED] - Configure Java toolchains per project

Test Plan:

Test with @amplitude/analytics-react-native and ensure that the android app builds in new arch.

@facebook-github-bot facebook-github-bot added 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. labels Nov 3, 2023
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,657,093 -2
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,034,736 -4
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 80d816a
Branch: main

@UNIDY2002
Copy link
Contributor Author

Wait... This fix is having issue on old arch...

@UNIDY2002
Copy link
Contributor Author

Libraries on old arch does not apply the RNGP, and will not get their Java toolchains configured. Therefore, this PR is inapplicable.

Closing it for now.

@UNIDY2002 UNIDY2002 closed this Nov 3, 2023
@UNIDY2002 UNIDY2002 deleted the rn-73-jdk-setup-fix branch November 6, 2023 02:23
@cortinico
Copy link
Contributor

cortinico commented Nov 20, 2023

However, some libraries, such as @amplitude/analytics-react-native (whose project name is :amplitude_analytics-react-native), might be evaluated before :app and miss the configureJavaToolChains() process.

Projects are not evaluated alphabetically (order is arbitrary). So you should not need this fix at all in the first place

EDIT: You were right. This is a bug (see #41620). Fix is forthcoming

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.

5 participants