Keep symlinks in legal subdirectories in linux/macos packages. Remove root legal files that already exist in legal/java.base#141
Merged
kirill-shirokov merged 4 commits intocorretto:developfrom Jan 13, 2026
Conversation
… root legal files that already exist in legal/java.base
…fault logging level
mrserb
approved these changes
Jan 9, 2026
…dd 'BuildRequires bsdtar' into AL2 SRPM spec.
github-actions bot
pushed a commit
that referenced
this pull request
Jan 14, 2026
… root legal files that already exist in legal/java.base (#141)
kirill-shirokov
added a commit
to kirill-shirokov/corretto-21
that referenced
this pull request
Jan 16, 2026
…n alternative to corretto#141, commit corretto@7db9bc7
elifaslan1
added a commit
to elifaslan1/corretto-21
that referenced
this pull request
Jan 19, 2026
…. Remove root legal files that already exist in legal/java.base (corretto#141)" This reverts commit 6b2ce52.
kirill-shirokov
added a commit
to kirill-shirokov/corretto-21
that referenced
this pull request
Jan 22, 2026
… root legal files that already exist in legal/java.base (corretto#141)
kirill-shirokov
added a commit
that referenced
this pull request
Feb 15, 2026
… root legal files that already exist in legal/java.base (#141)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Symlinks in OpenJDK legal/ subtree are not respected by gradle build files and were replaced by files themselves, which accounted to around extra 2Mb in unarchived distribution. Also, duplicate legal files exist in the root of the package (
LICENSE,ASSEMBLY_EXCEPTION,ADDITIONAL_LICENSE_INFO).For all Linux and MacOS targets, the Gradle build files were modified to allow keeping symlinks already created by OpenJDK jlink during the build process.
By default, symlinks are dereferenced as they used to be. However, when Gradle is invoked with
-Pcorretto.keepSymlinks=trueflag, the symlinks are kept as symlinks in the produced *.tar.gz, *.deb, *.rpm, *.pkg distribution files.Note that due to a bug/misfeature with -h option in GNU tar, I had to use bsdtar for creating archives either with or without symlinks, so the Docker images now require bsdtar to be installed. Its package can be named 'bsdtar' or 'libarchive-tools' in different OS
Motivation and context
Trying to reduce unpacked bundle size
How has this been tested?
By building the following targets:
... and verifying that previously regular licence files are replaced with symlinks as in OpenJDK in the each type of packaging
Platform information
Works on OS: Linux (universal), Alpine Linux, MacOS
Applies to version: 21, 25, tip