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

JDK-8304163: Move jdk.internal.module.ModuleInfoWriter to the test library #13085

Closed
wants to merge 2 commits into from

Conversation

mlchung
Copy link
Member

@mlchung mlchung commented Mar 17, 2023

ModuleInfoWriter is not used by the runtime. Move it to the test library as jdk.test.lib.util.ModuleInfoWriter. The tests are updated to use the test library instead. ModuleInfoWriter depends on jdk.internal.module types and the Classfile API. Hence @modules java.base/jdk.internal.classfile and other classfile subpackages are added.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8304163: Move jdk.internal.module.ModuleInfoWriter to the test library

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/13085/head:pull/13085
$ git checkout pull/13085

Update a local copy of the PR:
$ git checkout pull/13085
$ git pull https://git.openjdk.org/jdk pull/13085/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13085

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13085.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 17, 2023

👋 Welcome back mchung! 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 Pull request is ready for review label Mar 17, 2023
@openjdk
Copy link

openjdk bot commented Mar 17, 2023

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

  • core-libs
  • security
  • serviceability

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 serviceability serviceability-dev@openjdk.org security security-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Mar 17, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 17, 2023

Webrevs

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

The changes look good to me

@openjdk
Copy link

openjdk bot commented Mar 18, 2023

@mlchung 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:

8304163: Move jdk.internal.module.ModuleInfoWriter to the test library

Reviewed-by: jpai, alanb

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 7 new commits pushed to the master branch:

  • e339e18: 7016187: javac -h could generate conflict .h for inner class and class name with '_'
  • 033c0b1: 8304437: ProblemList com/sun/jdi/ThreadMemoryLeadTest.java with ZGC
  • 7503ecc: 8304138: [JVMCI] Test FailedSpeculation existence before appending.
  • f8482c2: 8297638: Memory leak in case of many started-dead threads
  • c56f011: 8298995: tools/jpackage/share/AddLauncherTest.java#id1 failed "AddLauncherTest.test; checks=53"
  • 254288a: 8014021: TreeMaker.Params behaves inconsistently when the owning method has the same number of parameters as the number of parameter types requested
  • 8f5bb53: 8015831: Add lint check for calling overridable methods from a constructor

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 Pull request is ready to be integrated label Mar 18, 2023
Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

Thanks for moving this to the test lib.

On the tag ordering, the reason some of these tests had @modules before @library was just to recommended ordering in the tag tag spec (https://openjdk.org/jtreg/tag-spec.html#ORDER).

@mlchung
Copy link
Member Author

mlchung commented Mar 18, 2023

Thanks for the pointer to the recommended ordering. Tests updated.

* java.base/jdk.internal.module
* @library /test/lib
* @build jdk.test.lib.util.ModuleInfoWriter
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to build library classes explicitly. I think @library /test/lib it enough.

Copy link
Member

Choose a reason for hiding this comment

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

Hello @lmesnik, on the contrary, these build directives are recommended (and based on some of the issues we have encountered, are in fact necessary). The jtreg documentation has this to say https://openjdk.org/jtreg/tag-spec.html:

In general, classes in library directories are not automatically compiled as part of a compilation command explicitly naming the source files containing those classes. A test that relies upon library classes should contain appropriate @build directives to ensure that the classes will be compiled. It is strongly recommended that tests do not rely on the use of implicit compilation by the Java compiler. Such an approach is generally fragile, and may lead to incomplete recompilation when a test or library code has been modified.

Copy link
Member Author

Choose a reason for hiding this comment

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

Explicit compilation is exactly the reason of adding @build

@mlchung
Copy link
Member Author

mlchung commented Mar 20, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 20, 2023

Going to push as commit 622f239.
Since your change was applied there have been 16 commits pushed to the master branch:

  • 4c8c993: 8304364: [AIX] Build erroneously determines build disk is non-local when using GNU-utils df on AIX
  • 4ed7350: 8304393: Provide method to iterate over regions of humongous object in G1
  • eb73fa8: 8301715: CDS should be disabled in exploded JDK
  • 80e9797: 8304433: cleanup sentence breaker code in DocTreeMaker
  • c396f1e: 8304443: bootcycle builds fail after JDK-8015831
  • ded6a81: 8303742: CompletableFuture.orTimeout leaks if the future completes exceptionally
  • 652bda0: 8304411: Remove unused CardTable::clear
  • 4505670: 8304174: Remove delays from httpserver tests
  • c09f83e: 8304293: RISC-V: JDK-8276799 missed atomic intrinsic support for C1
  • e339e18: 7016187: javac -h could generate conflict .h for inner class and class name with '_'
  • ... and 6 more: https://git.openjdk.org/jdk/compare/b085ab9316ed7a25b4981e05210299be50eb7ccd...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 20, 2023
@openjdk openjdk bot closed this Mar 20, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 20, 2023
@openjdk
Copy link

openjdk bot commented Mar 20, 2023

@mlchung Pushed as commit 622f239.

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

@dcubed-ojdk
Copy link
Member

Sigh... And again we have the situation where some folks are adding
@build directives and other folks are removing @build directives.

Another recent PR removed library build directives:
#13030

and that made the related tests stop failing with NoClassDefFoundErrors.

This mess is related to:
CODETOOLS-7902847
Class directory of a test case should not be used to compile a library

and these problems show up when doing parallel execution of tests
where more than one test uses the "offending" library.

We really, really need @jonathan-gibbons to chime in on review threads like these.

@mlchung mlchung deleted the JDK-8304163 branch August 2, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated security security-dev@openjdk.org serviceability serviceability-dev@openjdk.org
5 participants