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

8277106: Cannot compile certain sources with --release #6417

Closed
wants to merge 3 commits into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Nov 16, 2021

While working on JDK-8277105[1], it turned out the historical data in ct.sym are not quite right in two directions:
a) some API classes extend classes from non-exported packages (often from the java.base module). Examples include jdk.jfr.Event which extends jdk.internal.event.Event. As the current ct.sym data do not keep classes from non-exported packages, compilation against these classes fails.
b) permitted subtypes may include classes from non-exported packages, and these are needed to properly determine validity of casts and pattern matching switches. But these classes are not kept in the ct.sym, and hence the behavior of the casts may be incorrect. (Although I am no aware of any cases where an actual problem would arise with the current APIs.)

The proposed solution is to keep a certain amount of classes from non-exported packages in the historical record, specifically classes that are either extended by a class in an exported package. This solves the problem a). Solution for problem b) will be separate.

The first occurrence of a) I was able to find was in JDK 11, so this patch also fixes the historical record till JDK 11.

[1] https://bugs.openjdk.java.net/browse/JDK-8277105


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed
  • Change requires a CSR request to be approved

Issues

  • JDK-8277106: Cannot compile certain sources with --release
  • JDK-8278378: Cannot compile certain sources with --release (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6417/head:pull/6417
$ git checkout pull/6417

Update a local copy of the PR:
$ git checkout pull/6417
$ git pull https://git.openjdk.java.net/jdk pull/6417/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6417

View PR using the GUI difftool:
$ git pr show -t 6417

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6417.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 16, 2021

👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Nov 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 16, 2021

@lahodaj The following labels will be automatically applied to this pull request:

  • build
  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build compiler labels Nov 16, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 16, 2021

Webrevs

@magicus
Copy link
Member

@magicus magicus commented Nov 17, 2021

/label remove build

@openjdk openjdk bot removed the build label Nov 17, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 17, 2021

@magicus
The build label was successfully removed.

jddarcy
jddarcy approved these changes Dec 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 7, 2021

@lahodaj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8277106: Cannot compile certain sources with --release

Reviewed-by: darcy, mcimadamore

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 52 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Dec 7, 2021
@lahodaj
Copy link
Contributor Author

@lahodaj lahodaj commented Dec 8, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 8, 2021

Going to push as commit 42d9b1b.
Since your change was applied there have been 65 commits pushed to the master branch:

  • ba86dd4: 8278445: ProblemList tools/jpackage/share/IconTest.java on macosx-x64
  • 92aa75b: 8274903: Zero: Support AsyncGetCallTrace
  • 8345453: 8272392: Lanai: SwingSet2. Black background on expanding tree node
  • 9b74749: 8276660: Scalability bottleneck in java.security.Provider.getService()
  • 2478158: 8277361: java/nio/channels/Channels/ReadXBytes.java fails with OOM error
  • 8af3b27: 8277850: C2: optimize mask checks in counted loops
  • 3e93e0b: 8276769: -Xshare:auto should tolerate problems in the CDS archive
  • 79165b7: 8278324: Update the --generate-cds-archive jlink plugin usage message
  • 40d726b: 8278310: Improve logging in CDS DynamicLoaderConstraintsTest.java
  • e4852c6: 8277998: runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc failed "assert(ZAddress::is_marked(addr)) failed: Should be marked"
  • ... and 55 more: https://git.openjdk.java.net/jdk/compare/194cdf4e28225133dcdf29cf1bf4e580f3fd9208...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 8, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 8, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 8, 2021

@lahodaj Pushed as commit 42d9b1b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@hisener
Copy link

@hisener hisener commented Apr 28, 2022

@lahodaj - this may not be the right place to ask this question, but will this fix be backported to 17? I am getting the same class file for jdk.internal.event.Event not found error with JDK 17.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler integrated
5 participants