Skip to content

8217527: jmod hash does not work if --hash-module does not include the target module #3039

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cost0much
Copy link
Contributor

@cost0much cost0much commented May 30, 2025

I'd like to backport this fix because currently jmod hash command does not work on already created modules and this fixes that issue. This isn't intended behavior; nothing in Oracle documentation states this limitation, and moreover the command itself gives opaque response: there's no error message or non-zero exit, instead the command does nothing and no modules are changed after hashing.

The backport isn't clean because of conflicts in HashesTest.java. The conflicts are due to later commits being backported first; as all main HashesTest.java patches on jdk17 are now backport to 11, resolution meant simply copying 17's implementation over (some differences remain like upgradeableModule method is in different location but otherwise its function is exactly the same). This change was ran on internal Amazon pipelines and passes jtreg tier1-4 + tck tests on the following platforms: linux x64, aarch64, x86, aarch32; macos x64, aarch64; windows x64, x86.


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
  • JDK-8217527 needs maintainer approval

Warning

 ⚠️ Found leading lowercase letter in issue title for 8217527: jmod hash does not work if --hash-module does not include the target module

Issue

  • JDK-8217527: jmod hash does not work if --hash-module does not include the target module (Bug - P4 - Requested)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3039/head:pull/3039
$ git checkout pull/3039

Update a local copy of the PR:
$ git checkout pull/3039
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3039/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3039

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3039.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 30, 2025

👋 Welcome back cost0much! 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
Copy link

openjdk bot commented May 30, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 35554ea08557d73637bdb141935b7c081da7742b 8217527: jmod hash does not work if --hash-module does not include the target module May 30, 2025
@openjdk
Copy link

openjdk bot commented May 30, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label May 30, 2025
@cost0much cost0much marked this pull request as ready for review May 30, 2025 16:47
@openjdk openjdk bot added the rfr Pull request is ready for review label May 30, 2025
@mlbridge
Copy link

mlbridge bot commented May 30, 2025

Webrevs

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

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

testHashModulesPattern() was static as in the original patch, but tip has it virtual, so np afaic.

@openjdk
Copy link

openjdk bot commented Jun 4, 2025

⚠️ @cost0much This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@cost0much
Copy link
Contributor Author

/approval request Fixes jmod hash command not working on previously created modules; current behavior involves the command exiting without error but doing nothing to the target module. The backport is not clean because of HashesTest.java having later commits backported first. Patched in JDK16 and no bugtail. The change passes jtreg tier1-4 and tck tests on various platforms, see PR. Moreover, affected tests pass with the change and fail without. The risk is low-medium: touches key build/tooling code and changes behavior, but rare usage given lack of asks + doesn't break current usage. Risk also mitigated with thorough testing.

@openjdk
Copy link

openjdk bot commented Jun 4, 2025

@cost0much
8217527: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval backport rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants