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

8290561: Coalesce incubator-module warnings for single-file source-code programs #9607

Closed
wants to merge 1 commit into from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Jul 22, 2022

Consider a trivial code like:

public class Main {
     public static void main(String... args) {}
}

And an execution like:

$ java --add-modules jdk.incubator.concurrent Main.java 
WARNING: Using incubator modules: jdk.incubator.concurrent
warning: using incubating module(s): jdk.incubator.concurrent
1 warning

Having two warnings (one from runtime, one from javac) seems unnecessary. The patch proposed herein tries to avoid the javac warning, keeping only the runtime one. The conditions under which an incubator module is ignored w.r.t. this warning are:

  • the boot Module layer has the module (hence, presumably, the runtime already provided the warning)
  • the javac run is (likely) from the source launcher. This is being done using a custom javac option, -XDsourceLauncher (which can possibly be used in other cases).

This is to avoid cases where we would incorrectly suppress the incubator warning, e.g. when -XDsourceLauncher would be passed on the command line.

There are other ways to attempt to detect javac invocations from the source launcher - a distinct file manager is used by the source launcher (but detection of the specific file manager does not feel in line with general javac approach); or use of the jdk.internal.javac.source system property set by the native launcher (but this is only set when --source option is used, as far as I know, and javac also typically does not check system properties).

Note that there is JDK-8290563 to improve the text of the javac warning.


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-8290561: Coalesce incubator-module warnings for single-file source-code programs

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9607

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 22, 2022

👋 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 Pull request is ready for review label Jul 22, 2022
@openjdk
Copy link

openjdk bot commented Jul 22, 2022

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

  • compiler

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

@openjdk openjdk bot added the compiler compiler-dev@openjdk.org label Jul 22, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 22, 2022

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 19, 2022

@lahodaj This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Looks good!

@openjdk
Copy link

openjdk bot commented Sep 5, 2022

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

8290561: Coalesce incubator-module warnings for single-file source-code programs

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

  • 32f4dc8: 8293295: Add type check asserts to java_lang_ref_Reference accessors
  • e945619: 8293088: Fix compilation with the new Visual Studio preprocessor
  • 730ced9: 8292660: C2: blocks made unreachable by NeverBranch-to-Goto conversion are removed incorrectly
  • 3464019: 8292899: CustomTzIDCheckDST.java testcase failed on AIX platform
  • e92b9e4: 8293325: Minor improvements to macos catch_mach_exception_raise() error handling
  • 767262e: 8292201: serviceability/sa/ClhsdbThreadContext.java fails with "'Thread "Common-Cleaner"' missing from stdout/stderr"
  • a366e82: 7113208: Incorrect javadoc on java.net.DatagramPacket.setLength()
  • ac05bc8: 8293293: Move archive heap loading code out of heapShared.cpp
  • e1e6732: 8293319: [C2 cleanup] Remove unused other_path arg in Parse::adjust_map_after_if
  • 5757e21: 8292385: assert(ctrl == kit.control()) failed: Control flow was added although the intrinsic bailed out
  • ... and 558 more: https://git.openjdk.org/jdk/compare/87340fd5408d89d9343541ff4fcabde83548a598...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 Sep 5, 2022
@lahodaj
Copy link
Contributor Author

lahodaj commented Sep 6, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Sep 6, 2022

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

  • 8e22f2b: 8293361: GHA: dump config.log in case of configure failure
  • b17758a: 8247283: Enable the new conformant preprocessor option in Visual Studio
  • 1bed23a: 8293353: [BACKOUT] G1: Remove redundant is-marking-active checks in C1 barrier
  • 4955835: 8282434: Leading combining diacritic character in string renders incorrectly
  • ef20ffe: 8293159: Use try-with-resources in X11FontManager.registerFontDir
  • 056ed48: 8293180: JQuery UI license file not updated
  • dbb2c4b: 8288897: Clean up node dump code
  • 9833c02: 8292946: GC lock/jni/jnilock001 test failed "assert(gch->gc_cause() == GCCause::_scavenge_alot || !gch->incremental_collection_failed()) failed: Twice in a row"
  • d753658: 8293107: GHA: Bump to Ubuntu 22.04
  • d4e3e69: 8293344: JDK-8242181 broke stack printing for non-attached threads
  • ... and 575 more: https://git.openjdk.org/jdk/compare/87340fd5408d89d9343541ff4fcabde83548a598...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 6, 2022

@lahodaj Pushed as commit 26f2a97.

💡 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
compiler compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants