Skip to content

Removing warning for forbidden apis not supporting java 14 #55359

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

Merged
merged 2 commits into from
Apr 17, 2020

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 16, 2020

While the current version of forbidden apis still does not support java
14, the warning message has become very noisy as we now require java 14
for the elasticsearch build. This commit replaces the warn log message
with a comment in the code.

While the current version of forbidden apis still does not support java
14, the warning message has become very noisy as we now require java 14
for the elasticsearch build. This commit replaces the warn log message
with a comment in the code.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

@rjernst rjernst requested a review from mark-vieira April 16, 2020 23:08
"Forbidden APIs does not support Java versions past 13. Will use the signatures from 13 for {}.",
BuildParams.runtimeJavaVersion
)
// forbidden apis does not yet support java 14 (it will in version 3.0), so we must use java 13 target
Copy link
Contributor

@mark-vieira mark-vieira Apr 16, 2020

Choose a reason for hiding this comment

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

Now that I look at this, why are we basing this on runtime java version? This should simply be hard-coded to be minimumRuntimeVersion since that's what we pass to java -release so it's effectively impossible to use APIs from a newer JDK anyhow as it'd fail at compile time. The fact that we might be configuring the build with a later runtime JVM is irrelevant. That only affects runtime behavior (i.e. tests) nothing about how our code is compiled and which JDK APIs are available to it.

We'll need to of course deal with the fallout of forbiddenapi compatibility when we bump the minimum runtime version but I don't see that happening anytime soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's certainly something we should look at, but will likely require more investigation (I recall we tried something like this before and ran into issues, likely with multi release jars). I'm happy to do that as a followup, but this PR still will reduce unnecessary noise that is plaguing all local builds now that we require JDK 14 to run the build.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the difficulty was exactly multi-release JARs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool. I'm good with deferring that for now.

@rjernst rjernst merged commit cb297e3 into elastic:master Apr 17, 2020
@rjernst rjernst deleted the forbidden_java14 branch April 17, 2020 17:27
rjernst added a commit that referenced this pull request Apr 17, 2020
While the current version of forbidden apis still does not support java
14, the warning message has become very noisy as we now require java 14
for the elasticsearch build. This commit replaces the warn log message
with a comment in the code.
rjernst added a commit that referenced this pull request Apr 17, 2020
While the current version of forbidden apis still does not support java
14, the warning message has become very noisy as we now require java 14
for the elasticsearch build. This commit replaces the warn log message
with a comment in the code.
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.7.1 v7.8.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants