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

Only enable support for tests.profile if jdk.jfr module is available in Gradle runtime #12845

Merged
merged 2 commits into from Nov 25, 2023

Conversation

uschindler
Copy link
Contributor

If you use OpenJ9 JDKs to run Gradle and Tests, the compilation of buildSrc fails, due to Java Flight recorder not being available in the Gradle runtime.

This PR fixes this by excluding the Profile code from compilation and also throwing an exception if you enable -Ptests.profile=true.

I tested this with OpenJ9 and Hotspot. On Jenkins we do not see that problem, because we always run Gradle with a Hotspot JDK and only enable OpenJ9 as runtime.

This issue also affects the OpenJ9 team when they try to reproduce bugs with OpenJ9 VM: eclipse-openj9/openj9#18400

…in Gradle runtime (otherwise buildSrc compilation fails)
if (!rootProject.hasJavaFlightRecorder) {
logger.warn('Module jdk.jfr is not available; skipping compilation of Java Flight Recorder support.')
tasks.named('compileJava').configure {
exclude('**/ProfileResults.java')
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

@uschindler uschindler merged commit 17bb733 into apache:main Nov 25, 2023
4 checks passed
@uschindler uschindler deleted the build/checkJFRavailability branch November 25, 2023 19:16
asfgit pushed a commit that referenced this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants