Skip to content

Conversation

@wangweij
Copy link
Contributor

@wangweij wangweij commented Apr 11, 2023

Enhance the Proc utility to support compilation.


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-8305846: Support compilation in Proc test utility

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13425

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 11, 2023

👋 Welcome back weijun! 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 Apr 11, 2023
@openjdk
Copy link

openjdk bot commented Apr 11, 2023

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

  • core-libs
  • hotspot-runtime

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 hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Apr 11, 2023
@mlbridge
Copy link

mlbridge bot commented Apr 11, 2023

Webrevs

return this;
}
// Compile as well
public Proc compile() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Why "throws IOException" ? I'm surprised javac doesn't say it can't be thrown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I'll remove it.

String fullcp() {
if (cp == null) {
return System.getProperty("test.class.path") + File.pathSeparator +
System.getProperty("test.src.path");
Copy link
Member

Choose a reason for hiding this comment

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

Pre-existing by why is the src path put in the classpath?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember exactly. Maybe it allows you to read a resource.

Comment on lines 336 to 338
if (!comp) {
throw new IOException("Compilation error");
}
Copy link
Member

Choose a reason for hiding this comment

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

Seems an odd use of IOException and not very helpful - will the actual compile command produce any diagnostics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the spec of CompilerUtils.compile, all warnings/errors emitted by the compiler are output to System.out/err.

For the IOException, it's because Proc::start throws IOException and I don't want to modify it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just RuntimeException()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can.

}

if (compile) {
var comp = CompilerUtils.compile(
Copy link
Member

Choose a reason for hiding this comment

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

I don't find this use of var helpful - var is useful for saying "some type I don't really care about and can't be bothered to spell out". But here we just have a boolean so it is clearer to just say boolean compiled (or success or ok or some such name that reflects what the return value actually means). Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll make it boolean.

@wangweij
Copy link
Contributor Author

/label remove hotspot-runtime core-libs

@openjdk openjdk bot removed hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Apr 12, 2023
@openjdk
Copy link

openjdk bot commented Apr 12, 2023

@wangweij
The hotspot-runtime label was successfully removed.

The core-libs label was successfully removed.

Copy link
Contributor

@mcpowers mcpowers left a comment

Choose a reason for hiding this comment

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

Only a minor nit, otherwise looks good.

return this;
}
// Adds classpath to defaults. Can be called multiple times.
// once called, addcp is always true
Copy link
Contributor

Choose a reason for hiding this comment

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

Capitalize and end with period, otherwise it looks odd (to me).

@openjdk
Copy link

openjdk bot commented May 5, 2023

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

8305846: Support compilation in Proc test utility

Reviewed-by: valeriep

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

  • 73ac710: 8307425: Socket input stream read burns CPU cycles with back-to-back poll(0) calls
  • e2b1013: 8306326: [BACKOUT] 8277573: VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 4386d42: 8307381: Open Source JFrame, JIF related Swing Tests
  • 27764e6: 8306583: Add JVM crash check in CDSTestUtils.executeAndLog
  • 6c71859: 6176679: Application freezes when copying an animated gif image to the system clipboard
  • 65a5488: 8306712: CDS DeterministicDump.java test fails with -XX:+UseStringDeduplication
  • d8b230c: 8307301: Update HarfBuzz to 7.2.0
  • b5a4827: 8306871: Open source more AWT Drag & Drop tests
  • 47422be: 8307375: Alignment check on layouts used as sequence element is not correct
  • 3968ab5: 8307395: Add missing STS to Shenandoah
  • ... and 362 more: https://git.openjdk.org/jdk/compare/0d45a524b3d29fd57a4d468d7b5af0f588db7409...master

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 May 5, 2023
@wangweij
Copy link
Contributor Author

wangweij commented May 5, 2023

/integrate

@openjdk
Copy link

openjdk bot commented May 5, 2023

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

  • 73ac710: 8307425: Socket input stream read burns CPU cycles with back-to-back poll(0) calls
  • e2b1013: 8306326: [BACKOUT] 8277573: VmObjectAlloc is not generated by intrinsics methods which allocate objects
  • 4386d42: 8307381: Open Source JFrame, JIF related Swing Tests
  • 27764e6: 8306583: Add JVM crash check in CDSTestUtils.executeAndLog
  • 6c71859: 6176679: Application freezes when copying an animated gif image to the system clipboard
  • 65a5488: 8306712: CDS DeterministicDump.java test fails with -XX:+UseStringDeduplication
  • d8b230c: 8307301: Update HarfBuzz to 7.2.0
  • b5a4827: 8306871: Open source more AWT Drag & Drop tests
  • 47422be: 8307375: Alignment check on layouts used as sequence element is not correct
  • 3968ab5: 8307395: Add missing STS to Shenandoah
  • ... and 362 more: https://git.openjdk.org/jdk/compare/0d45a524b3d29fd57a4d468d7b5af0f588db7409...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 5, 2023

@wangweij Pushed as commit b5922c3.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants