-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8317620: Build JDK tools with ModuleMainClass attribute #16463
Conversation
👋 Welcome back mchung! A progress list of the required criteria for merging this PR into |
/label remove kulla |
@mlchung |
/label remove hotspot-jfr |
@mlchung |
@mlchung The |
Webrevs
|
make/modules/jdk.jdi/Jmod.gmk
Outdated
# questions. | ||
# | ||
|
||
JMOD_FLAGS_main_class := --main-class com.sun.tools.example.debug.tty.TTY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one. Every few years there is a suggestion to deprecate or remove jdb. It's the example debugger from the original JPDA effort in the JDK 1.2 timeframe and hasn't really developed much since then. The main reason is stays around is that it is needed by our tests, and some people say it's useful to have something in production environments where the main stream debuggers can't go. I'm not opposed to "java -m jdk.jdi", it's just that this is a legacy/example tool that isn't the main focus of the jdk.jdi module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can share the same concern. I will take this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok from a build point of view.
make/Main.gmk
Outdated
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \ | ||
$(patsubst %,-I%/modules/$1,$(PHASE_MAKEDIRS)) \ | ||
-f CreateJmods.gmk MODULE=$1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \ | |
$(patsubst %,-I%/modules/$1,$(PHASE_MAKEDIRS)) \ | |
-f CreateJmods.gmk MODULE=$1) | |
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \ | |
$(patsubst %,-I%/modules/$1,$(PHASE_MAKEDIRS)) \ | |
-f CreateJmods.gmk MODULE=$1) |
@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:
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 17 new commits pushed to the
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 |
/integrate |
Going to push as commit 008ca2a.
Your commit was automatically rebased without conflicts. |
Tool modules can be created via
jmod --main-class
option such thatModuleMainClass
attribute will be added inmodule-info.class
and the module's main class can be launched viajava -m <module-name>
without specifying the name of the main class.In addition, for modules with
ModuleMainClass
attribute, jlink will pre-resolve the module graph such that when such module is launched at runtime (without--add-modules
or--limit-modules
option), the runtime can skip the module resolution and speed up the startup time.This PR extends the build system to allow a module to specify the main class under
make/modules/$MODULE/Jmod.gmk
file. Also JDK tools with a single entry point (or a primary entry point) are candidates to addModuleMainClass
attribute inmodule-info.class
to benefit from the jlink optimization. For example,java -m jdk.jpackage
will be launched using the pre-resolved module graph.Verified manually by running
java -m $MODULE
on the modules with main class.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16463/head:pull/16463
$ git checkout pull/16463
Update a local copy of the PR:
$ git checkout pull/16463
$ git pull https://git.openjdk.org/jdk.git pull/16463/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16463
View PR using the GUI difftool:
$ git pr show -t 16463
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16463.diff
Webrev
Link to Webrev Comment