Page MenuHomeFreeBSD

java/bootstrap-openjdk*: Mark these ports as bundling libraries.
ClosedPublic

Authored by bdrewery on Wed, Nov 12, 11:42 PM.
Tags
None
Referenced Files
F137886251: D53723.diff
Wed, Nov 26, 9:26 PM
Unknown Object (File)
Mon, Nov 24, 1:36 PM
Unknown Object (File)
Sun, Nov 23, 7:25 PM
Unknown Object (File)
Sun, Nov 23, 9:25 AM
Unknown Object (File)
Thu, Nov 20, 2:41 PM
Unknown Object (File)
Thu, Nov 20, 2:41 PM
Unknown Object (File)
Thu, Nov 20, 2:41 PM
Unknown Object (File)
Thu, Nov 20, 2:35 PM
Subscribers
None

Details

Summary

This prevents Pkg from recording the bundled libraries as
dependencies. This otherwise can confuse Pkg and Poudriere
about missing dependencies.

This eliminates a new warning I am placing in Poudriere which
checks for libraries coming from dependencies, in this case none
are found.

=>> [03] [00:00:00] Warning: bootstrap-openjdk17-17.0.1.12.1_2 will be rebuilt as it misses all of its shlibs. This likely means it needs to use BUNDLE_LIBS in the port. Report to maintainer.

These libraries are bundled:

===========================================================================
=>> Checking shared library dependencies
 0x0000000000000001 NEEDED               Shared library: [libX11.so.6]
 0x0000000000000001 NEEDED               Shared library: [libXext.so.6]
 0x0000000000000001 NEEDED               Shared library: [libXi.so.6]
 0x0000000000000001 NEEDED               Shared library: [libXrender.so.1]
 0x0000000000000001 NEEDED               Shared library: [libXtst.so.6]
 0x0000000000000001 NEEDED               Shared library: [libasound.so.2]
 0x0000000000000001 NEEDED               Shared library: [libawt.so]
 0x0000000000000001 NEEDED               Shared library: [libawt_xawt.so]
 0x0000000000000001 NEEDED               Shared library: [libc++.so.1]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x0000000000000001 NEEDED               Shared library: [libcxxrt.so.1]
 0x0000000000000001 NEEDED               Shared library: [libdl.so.1]
 0x0000000000000001 NEEDED               Shared library: [libfontconfig.so.1]
 0x0000000000000001 NEEDED               Shared library: [libfreetype.so.6]
 0x0000000000000001 NEEDED               Shared library: [libgcc_s.so.1]
 0x0000000000000001 NEEDED               Shared library: [libgif.so.7]
 0x0000000000000001 NEEDED               Shared library: [libharfbuzz.so.0]
 0x0000000000000001 NEEDED               Shared library: [libjava.so]
 0x0000000000000001 NEEDED               Shared library: [libjli.so]
 0x0000000000000001 NEEDED               Shared library: [libjpeg.so.8]
 0x0000000000000001 NEEDED               Shared library: [libjvm.so]
 0x0000000000000001 NEEDED               Shared library: [liblcms2.so.2]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libnet.so]
 0x0000000000000001 NEEDED               Shared library: [libnio.so]
 0x0000000000000001 NEEDED               Shared library: [libpng16.so.16]
 0x0000000000000001 NEEDED               Shared library: [libthr.so.3]
 0x0000000000000001 NEEDED               Shared library: [libutil.so.9]
 0x0000000000000001 NEEDED               Shared library: [libz.so.6]
Test Plan
# poudriere bulk -j 14amd64 -p commit -z test -Ct java/openjdk11 java/openjdk17 java/openjdk8 java/bootstrap-openjdk11 java/bootstrap-openjdk17 java/bootstrap-openjdk8
...
[00:02:20] [03] [00:00:19] Finished   java/bootstrap-openjdk8 | bootstrap-openjdk8-r450802_3: Success
[00:02:20] [01] [00:00:00] Building   java/openjdk8 | openjdk8-8.472.08.1
[00:02:46] [02] [00:00:45] Finished   java/bootstrap-openjdk11 | bootstrap-openjdk11-11.0.5.10.1_1: Success
[00:02:46] [02] [00:00:00] Building   java/openjdk11 | openjdk11-11.0.29+7.1
[00:02:53] [04] [00:00:52] Finished   java/bootstrap-openjdk17 | bootstrap-openjdk17-17.0.1.12.1_2: Success
[00:02:53] [03] [00:00:00] Building   java/openjdk17 | openjdk17-17.0.17+10.1
[00:07:30] [01] [00:05:10] Finished   java/openjdk8 | openjdk8-8.472.08.1: Success
[00:14:36] [03] [00:11:43] Finished   java/openjdk17 | openjdk17-17.0.17+10.1: Success
[00:39:52] [02] [00:37:06] Finished   java/openjdk11 | openjdk11-11.0.29+7.1: Success
...
[00:40:04] Built ports: java/bootstrap-openjdk8 java/bootstrap-openjdk11 java/bootstrap-openjdk17 java/openjdk8 java/openjdk17 java/openjdk11
...
Exiting with status 0

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 68585
Build 65468: arc lint + arc unit

Event Timeline

bdrewery created this revision.
This revision is now accepted and ready to land.Thu, Nov 13, 5:07 PM

@bapt I'm not sure this did what I expected.
It added the annotation but it still marked all of the libs as required.

# pkg info -F bootstrap-openjdk17-17.0.1.12.1_2.pkg
bootstrap-openjdk17-17.0.1.12.1_2
Name           : bootstrap-openjdk17
Version        : 17.0.1.12.1_2
Origin         : java/bootstrap-openjdk17
Architecture   : FreeBSD:14:amd64
Prefix         : /usr/local
Categories     : devel java
Licenses       : GPLv2
Maintainer     : java@FreeBSD.org
WWW            : https://openjdk.java.net/
Comment        : Java Development Kit 17
Shared Libs required:
        libX11.so.6
        libXext.so.6
        libXi.so.6
        libXrender.so.1
        libXtst.so.6
        libasound.so.2
        libc++.so.1
        libc.so.7
        libcxxrt.so.1
        libdl.so.1
        libfontconfig.so.1
        libfreetype.so.6
        libgcc_s.so.1
        libgif.so.7
        libharfbuzz.so.0
        libjpeg.so.8
        liblcms2.so.2
        libm.so.5
        libpng16.so.16
        libthr.so.3
        libutil.so.9
        libz.so.6
Annotations    :
        FreeBSD_version: 1400097
        build_timestamp: 2025-11-13T00:01:02+00:00
        built_by       : poudriere-git-3.3.0-2420-g3a7024568
        no_provide_shlib: yes
        port_checkout_unclean: no
        ports_top_checkout_unclean: yes
        ports_top_git_hash: a5581322a5c3da107f83705f91c9900b8c219ae3
Flat size      : 252MiB
Description    :
OpenJDK is an open-source implementation of the Java Platform, Standard Edition.

Much of the OpenJDK code is licensed under the GPL version 2 with the
Classpath exception. The Java Hotspot virtual machine source code is
licensed under the GPL version 2 only.

Ah it only prevents _providing_ shlibs. How do we prevent it _requiring_ shlibs it is itself bundling?

pkg_cleanup_shlibs_required(pkg, &internal_provided);

Seems it is supposed to just work, hm.

None of the libraries listed as required here are bundled, so it has done the right thing and the bootstrap now do not provide lib anymore so it will never be proposed instead of a regular openjdk

None of the libraries listed as required here are bundled, so it has done the right thing and the bootstrap now do not provide lib anymore so it will never be proposed instead of a regular openjdk

We might be talking about different things here. java/bootstrap-openjdk17 has no dependencies at all in the build. Yet the package it produces requires all of those libraries. Hence it bundles them, but pkg marks the package as requiring those libraries.

well it claims it has no dependency but it does have, so what you want here is to entirely prevent analysing the elf files if any. We might want to still require the one from base.

SHLIB_REQUIRE_IGNORE_GLOB=* should do what you expect

Yep I see now that the libraries aren't bundled.

SHLIB_REQUIRE_IGNORE_GLOB=* should do what you expect

Got it. What about not ignoring base packages like libc?