Introduced fastdebug build cycle and subpackages

This commit is contained in:
Jiri 2020-12-20 09:40:12 +01:00
parent cef412cef7
commit edadb626bc

View File

@ -4,18 +4,20 @@
# #
# Examples: # Examples:
# #
# Produce release *and* slowdebug builds on x86_64 (default): # Produce release, fastdebug *and* slowdebug builds on x86_64 (default):
# $ rpmbuild -ba java-1.8.0-openjdk.spec # $ rpmbuild -ba java-1.8.0-openjdk.spec
# #
# Produce only release builds (no slowdebug builds) on x86_64: # Produce only release builds (no slowdebug builds) on x86_64:
# $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug # $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug --without fastdebug
# #
# Only produce a release build on x86_64: # Only produce a release build on x86_64:
# $ fedpkg mockbuild --without slowdebug # $ fedpkg mockbuild --without slowdebug --without fastdebug
# #
# Only produce a debug build on x86_64: # Only produce a debug build on x86_64:
# $ fedpkg local --without release # $ fedpkg local --without release
# #
# Enable fastdebug builds by default on relevant arches.
%bcond_without fastdebug
# Enable slowdebug builds by default on relevant arches. # Enable slowdebug builds by default on relevant arches.
%bcond_without slowdebug %bcond_without slowdebug
# Enable release builds by default on relevant arches. # Enable release builds by default on relevant arches.
@ -35,13 +37,16 @@
# See https://github.com/rpm-software-management/rpm/issues/127 to comments at "pmatilai commented on Aug 18, 2017" # See https://github.com/rpm-software-management/rpm/issues/127 to comments at "pmatilai commented on Aug 18, 2017"
# (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192) # (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
%global debug_suffix_unquoted -slowdebug %global debug_suffix_unquoted -slowdebug
%global fastdebug_suffix_unquoted -fastdebug
# quoted one for shell operations # quoted one for shell operations
%global debug_suffix "%{debug_suffix_unquoted}" %global debug_suffix "%{debug_suffix_unquoted}"
%global fastdebug_suffix "%{fastdebug_suffix_unquoted}"
%global normal_suffix "" %global normal_suffix ""
# if you want only debug build but providing java build only normal build but set normalbuild_parameter %global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
%global debug_warning This package has full debug on. Install only in need and remove asap.
%global debug_on with full debug on %global debug_on with full debug on
%global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
%global for_fastdebug_on with minimal debug on
%global for_debug for packages with debug on %global for_debug for packages with debug on
%if %{with release} %if %{with release}
@ -51,9 +56,9 @@
%endif %endif
%if %{include_normal_build} %if %{include_normal_build}
%global build_loop1 %{normal_suffix} %global normal_build %{normal_suffix}
%else %else
%global build_loop1 %{nil} %global normal_build %{nil}
%endif %endif
# We have hardcoded list of files, which is appearing in alternatives, and in files # We have hardcoded list of files, which is appearing in alternatives, and in files
@ -91,6 +96,7 @@
%global systemtap_arches %{jit_arches} %global systemtap_arches %{jit_arches}
# Set of architectures with a Ahead-Of-Time (AOT) compiler # Set of architectures with a Ahead-Of-Time (AOT) compiler
%global aot_arches x86_64 %{aarch64} %global aot_arches x86_64 %{aarch64}
%global fastdebug_arches x86_64 ppc64le aarch64
# Set of architectures which support the serviceability agent # Set of architectures which support the serviceability agent
%global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm} %global sa_arches %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm}
# Set of architectures which support class data sharing # Set of architectures which support class data sharing
@ -133,17 +139,34 @@
%global zgc_feature -zgc %global zgc_feature -zgc
%endif %endif
%if %{include_debug_build} # By default, we build a fastdebug build during main build only on fastdebug architectures
%global build_loop2 %{debug_suffix} %if %{with fastdebug}
%ifarch %{fastdebug_arches}
%global include_fastdebug_build 1
%else %else
%global build_loop2 %{nil} %global include_fastdebug_build 0
%endif
%else
%global include_fastdebug_build 0
%endif %endif
# if you disable both builds, then the build fails %if %{include_debug_build}
%global build_loop %{build_loop1} %{build_loop2} %global slowdebug_build %{debug_suffix}
# note: that order: normal_suffix debug_suffix, in case of both enabled %else
# is expected in one single case at the end of the build %global slowdebug_build %{nil}
%global rev_build_loop %{build_loop2} %{build_loop1} %endif
%if %{include_fastdebug_build}
%global fastdebug_build %{fastdebug_suffix}
%else
%global fastdebug_build %{nil}
%endif
# If you disable both builds, then the build fails
# Note that the debug build requires the normal build for docs
%global build_loop %{normal_build} %{fastdebug_build} %{slowdebug_build}
# Test slowdebug first as it provides the best diagnostics
%global rev_build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build}
%ifarch %{bootstrap_arches} %ifarch %{bootstrap_arches}
%global bootstrap_build 1 %global bootstrap_build 1
@ -261,9 +284,9 @@
%global top_level_dir_name %{origin} %global top_level_dir_name %{origin}
%global minorver 0 %global minorver 0
%global buildver 11 %global buildver 11
%global rpmrelease 6 %global rpmrelease 7
#%%global tagsuffix "" #%%global tagsuffix ""
# priority must be 8 digits in total; untill openjdk 1.8 we were using 18..... so when moving to 11 we had to add another digit # priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
%if %is_system_jdk %if %is_system_jdk
%global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} ) %global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} )
%else %else
@ -533,7 +556,7 @@ alternatives \\
--slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\ --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\
%{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1$ext \\ %{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1$ext \\
--slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\ --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext \\ %{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext
for X in %{origin} %{javaver} ; do for X in %{origin} %{javaver} ; do
alternatives \\ alternatives \\
@ -717,7 +740,7 @@ exit 0
%config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties %config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg %config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access
# this is conifg template, thus not config-noreplace # these are config templates, thus not config-noreplace
%config %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template %config %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties %config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties
@ -1210,6 +1233,17 @@ The %{origin_nice} runtime environment.
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package fastdebug
Summary: %{origin_nice} Runtime Environment %{majorver} %{fastdebug_on}
Group: Development/Languages
%{java_rpo -- %{fastdebug_suffix_unquoted}}
%description fastdebug
The %{origin_nice} runtime environment.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package headless %package headless
Summary: %{origin_nice} Headless Runtime Environment %{majorver} Summary: %{origin_nice} Headless Runtime Environment %{majorver}
@ -1231,6 +1265,18 @@ The %{origin_nice} runtime environment %{majorver} without audio and video suppo
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package headless-fastdebug
Summary: %{origin_nice} Runtime Environment %{fastdebug_on}
Group: Development/Languages
%{java_headless_rpo -- %{fastdebug_suffix_unquoted}}
%description headless-fastdebug
The %{origin_nice} runtime environment %{majorver} without audio and video support.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package devel %package devel
Summary: %{origin_nice} Development Environment %{majorver} Summary: %{origin_nice} Development Environment %{majorver}
@ -1252,6 +1298,18 @@ The %{origin_nice} development tools %{majorver}.
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package devel-fastdebug
Summary: %{origin_nice} Development Environment %{majorver} %{fastdebug_on}
Group: Development/Tools
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
%description devel-fastdebug
The %{origin_nice} development tools %{majorver}.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package static-libs %package static-libs
Summary: %{origin_nice} libraries for static linking %{majorver} Summary: %{origin_nice} libraries for static linking %{majorver}
@ -1273,6 +1331,17 @@ The %{origin_nice} libraries for static linking %{majorver}.
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package static-libs-fastdebug
Summary: %{origin_nice} libraries for static linking %{majorver} %{fastdebug_on}
%{java_static_libs_rpo -- %{fastdebug_suffix_unquoted}}
%description static-libs-fastdebug
The %{origin_nice} libraries for static linking %{majorver}.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package jmods %package jmods
Summary: JMods for %{origin_nice} %{majorver} Summary: JMods for %{origin_nice} %{majorver}
@ -1294,6 +1363,19 @@ The JMods for %{origin_nice} %{majorver}.
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package jmods-fastdebug
Summary: JMods for %{origin_nice} %{majorver} %{fastdebug_on}
Group: Development/Tools
%{java_jmods_rpo -- %{fastdebug_suffix_unquoted}}
%description jmods-fastdebug
The JMods for %{origin_nice} %{majorver}.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package demo %package demo
Summary: %{origin_nice} Demos %{majorver} Summary: %{origin_nice} Demos %{majorver}
@ -1315,6 +1397,18 @@ The %{origin_nice} demos %{majorver}.
%{debug_warning} %{debug_warning}
%endif %endif
%if %{include_fastdebug_build}
%package demo-fastdebug
Summary: %{origin_nice} Demos %{majorver} %{fastdebug_on}
Group: Development/Languages
%{java_demo_rpo -- %{fastdebug_suffix_unquoted}}
%description demo-fastdebug
The %{origin_nice} demos %{majorver}.
%{fastdebug_warning}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package src %package src
Summary: %{origin_nice} Source Bundle %{majorver} Summary: %{origin_nice} Source Bundle %{majorver}
@ -1337,6 +1431,19 @@ The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice
class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}.
%endif %endif
%if %{include_fastdebug_build}
%package src-fastdebug
Summary: %{origin_nice} Source Bundle %{majorver} %{for_fastdebug}
Group: Development/Languages
%{java_src_rpo -- %{fastdebug_suffix_unquoted}}
%description src-fastdebug
The java-%{origin}-src-fastdebug sub-package contains the complete %{origin_nice} %{majorver}
class library source code for use by IDE indexers and debuggers. Debugging %{for_fastdebug}.
%endif
%if %{include_normal_build} %if %{include_normal_build}
%package javadoc %package javadoc
Summary: %{origin_nice} %{majorver} API documentation Summary: %{origin_nice} %{majorver} API documentation
@ -1365,19 +1472,29 @@ The %{origin_nice} %{majorver} API documentation compressed in a single archive.
if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then
echo "include_normal_build is %{include_normal_build}" echo "include_normal_build is %{include_normal_build}"
else else
echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no" echo "include_normal_build is %{include_normal_build}, that is invalid. Use 1 for yes or 0 for no"
exit 11 exit 11
fi fi
if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then
echo "include_debug_build is %{include_debug_build}" echo "include_debug_build is %{include_debug_build}"
else else
echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no" echo "include_debug_build is %{include_debug_build}, that is invalid. Use 1 for yes or 0 for no"
exit 12 exit 12
fi fi
if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then if [ %{include_fastdebug_build} -eq 0 -o %{include_fastdebug_build} -eq 1 ] ; then
echo "You have disabled both include_debug_build and include_normal_build. That is a no go." echo "include_fastdebug_build is %{include_fastdebug_build}"
else
echo "include_fastdebug_build is %{include_fastdebug_build}, that is invalid. Use 1 for yes or 0 for no"
exit 13 exit 13
fi fi
if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 -a %{include_fastdebug_build} -eq 0 ] ; then
echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go."
exit 14
fi
if [ %{include_normal_build} -eq 0 ] ; then
echo "You have disabled the normal build, but this is required to provide docs for the debug build."
exit 15
fi
%setup -q -c -n %{uniquesuffix ""} -T -a 0 %setup -q -c -n %{uniquesuffix ""} -T -a 0
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084 # https://bugzilla.redhat.com/show_bug.cgi?id=1189084
prioritylength=`expr length %{priority}` prioritylength=`expr length %{priority}`
@ -1410,6 +1527,9 @@ tar --strip-components=1 -x -I xz -f %{SOURCE8}
%if %{include_debug_build} %if %{include_debug_build}
cp -r tapset tapset%{debug_suffix} cp -r tapset tapset%{debug_suffix}
%endif %endif
%if %{include_fastdebug_build}
cp -r tapset tapset%{fastdebug_suffix}
%endif
for suffix in %{build_loop} ; do for suffix in %{build_loop} ; do
@ -1502,7 +1622,7 @@ bash ../configure \
%ifarch %{ppc64le} %ifarch %{ppc64le}
--with-jobs=1 \ --with-jobs=1 \
%endif %endif
--with-version-build=1 \ --with-version-build=%{buildver} \
--with-version-pre="%{ea_designator}" \ --with-version-pre="%{ea_designator}" \
--with-version-opt=%{lts_designator} \ --with-version-opt=%{lts_designator} \
--with-version-patch=1 \ --with-version-patch=1 \
@ -1676,6 +1796,7 @@ quit
end end
run -version run -version
EOF EOF
# This fails on s390x for some reason. Disable for now. See: # This fails on s390x for some reason. Disable for now. See:
# https://koji.fedoraproject.org/koji/taskinfo?taskID=41499227 # https://koji.fedoraproject.org/koji/taskinfo?taskID=41499227
%ifnarch s390x %ifnarch s390x
@ -1756,13 +1877,12 @@ mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archi
cp -a %{buildoutputdir -- $suffix}/images/%{static_libs_image}/lib/*.a \ cp -a %{buildoutputdir -- $suffix}/images/%{static_libs_image}/lib/*.a \
$RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc
if ! echo $suffix | grep -q "debug" ; then if ! echo $suffix | grep -q "debug" ; then
# Install Javadoc documentation # Install Javadoc documentation
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix} cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
#cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{newjavaver}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip #cp -a %{buildoutputdir -- $suffix}/bundles/jdk-%{newjavaver}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip || ls -l %{buildoutputdir -- $suffix}/bundles/
cp -a %{buildoutputdir -- $suffix}/bundles/jdk-11.0.9.1+1%{lts_designator_zip}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip cp -a %{buildoutputdir -- $suffix}/bundles/jdk-11.0.9.1+11-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip || ls -l %{buildoutputdir -- $suffix}/bundles/
fi fi
# Install release notes # Install release notes
@ -1919,6 +2039,33 @@ require "copy_jdk_configs.lua"
%{posttrans_devel -- %{debug_suffix_unquoted}} %{posttrans_devel -- %{debug_suffix_unquoted}}
%endif %endif
%if %{include_fastdebug_build}
%post fastdebug
%{post_script -- %{fastdebug_suffix_unquoted}}
%post headless-fastdebug
%{post_headless -- %{fastdebug_suffix_unquoted}}
%postun fastdebug
%{postun_script -- %{fastdebug_suffix_unquoted}}
%postun headless-fastdebug
%{postun_headless -- %{fastdebug_suffix_unquoted}}
%posttrans fastdebug
%{posttrans_script -- %{fastdebug_suffix_unquoted}}
%post devel-fastdebug
%{post_devel -- %{fastdebug_suffix_unquoted}}
%postun devel-fastdebug
%{postun_devel -- %{fastdebug_suffix_unquoted}}
%posttrans devel-fastdebug
%{posttrans_devel -- %{fastdebug_suffix_unquoted}}
%endif
%if %{include_normal_build} %if %{include_normal_build}
%files %files
# main package builds always # main package builds always
@ -1953,9 +2100,8 @@ require "copy_jdk_configs.lua"
%files javadoc %files javadoc
%{files_javadoc %{nil}} %{files_javadoc %{nil}}
# this puts huge file to /usr/share # This puts a huge documentation file in /usr/share
# unluckily ti is really a documentation file # It is now architecture-dependent, as eg. AOT and Graal are now x86_64 only
# and unluckily it really is architecture-dependent, as eg. aot and grail are now x86_64 only
# same for debug variant # same for debug variant
%files javadoc-zip %files javadoc-zip
%{files_javadoc_zip %{nil}} %{files_javadoc_zip %{nil}}
@ -1984,8 +2130,34 @@ require "copy_jdk_configs.lua"
%{files_src -- %{debug_suffix_unquoted}} %{files_src -- %{debug_suffix_unquoted}}
%endif %endif
%if %{include_fastdebug_build}
%files fastdebug
%{files_jre -- %{fastdebug_suffix_unquoted}}
%files headless-fastdebug
%{files_jre_headless -- %{fastdebug_suffix_unquoted}}
%files devel-fastdebug
%{files_devel -- %{fastdebug_suffix_unquoted}}
%files static-libs-fastdebug
%{files_static_libs -- %{fastdebug_suffix_unquoted}}
%files jmods-fastdebug
%{files_jmods -- %{fastdebug_suffix_unquoted}}
%files demo-fastdebug
%{files_demo -- %{fastdebug_suffix_unquoted}}
%files src-fastdebug
%{files_src -- %{fastdebug_suffix_unquoted}}
%endif
%changelog %changelog
* Sat Dec 19 2020 Jiri Vanek <jvanek@redhat.com> - 1:11.0.9.11-7
- introduced fastdebug build cycle and subpackages
* Thu Dec 17 2020 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.9.11-6 * Thu Dec 17 2020 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.9.11-6
- introduced nm based check to verify alt-java on x86_64 is patched, and no other alt-java or java is patched - introduced nm based check to verify alt-java on x86_64 is patched, and no other alt-java or java is patched
- patch600 rh1750419-redhat_alt_java.patch amended to die, if it is used wrongly - patch600 rh1750419-redhat_alt_java.patch amended to die, if it is used wrongly