-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
OpenJDK binaries depend on system zlib #1951
Comments
Since most other distributors of OpenJDK ship with the same external zlib dependency (I've checked zulu and liberica 11 and OP has checked our upstreams) I'd be somewhat reluctant to change it, but it's certainly worth floating the idea around ... FYI @AdoptOpenJDK/tsc |
I like to hear more about the rationale. I only see arguments against it: With bundled libraries, I've to wait for the next quarterly release to get security updates. Further, I do not understand why not having zlib in chroots/containers is a problem. There are other libraries that OpenJDK needs that aren't bundled either. |
Security is a classic argument against linking dependencies statically, but its relevance depends on the goals of a particular distributor. Linux distributions usually do care about this and try to ensure that software packages use libraries provided by the distro, and OpenJDK is not an exception here. But standalone OpenJDK distributions that I know of have never been in this camp. In particular, AdoptOpenJDK doesn't set any Moreover, the docs explaining that the system zlib may be used on Linux despite what
I referred to the headless use case specifically in my report. For that, the only OpenJDK dependencies in the default configuration are the C library and zlib. All other dependencies are listed in https://github.com/openjdk/jdk14u/blob/7a3bf58b8ad2c/doc/building.md#external-library-requirements and are irrelevant for this use case. At my organization we bundle OpenJDK with our software which runs in environments that we can't control or impose requirements on, and even users often can't change those environments (think chroots used to build OS distros). So zlib dependency is a problem, and in case of AdoptOpenJDK the current workaround is to put a copy of |
I was thinking about this recently and I'm increasingly leaning towards using the bundled
|
Noting that this has been implemented for JDK21 at #3399 |
Thank you for the fix! |
Related adoptium#1951 adoptium#3399 adoptium#3459 Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
Platform and architecture: Linux/all
Java version: 9 and above
Variant e.g. HotSpot or OpenJ9: Tested on HotSpot
Have you tested it with other vendors' java: Upstream (RedHat) binaries distributed by AdoptOpenJDK have this problem too
The dependency on system zlib can be easily verified on glibc-based systems:
This dependency reduces the otherwise good OpenJDK portability for headless use cases, in particular, in chroots and containers, where zlib might not be present.
I suspect that this issue may be caused by confusing/buggy help text of the upstream configure: it claims that the bundled zlib is used by default, but in fact it uses the system one on Linux if it's present: https://hg.openjdk.java.net/jdk-updates/jdk14u/file/452c05ce40d2/make/autoconf/lib-bundled.m4#l173
Could you explicitly set
--with-zlib=bundled
when configuring OpenJDK?The text was updated successfully, but these errors were encountered: