From d9d44a0f3a62714f305467e6f4b307c361ae9875 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Mon, 29 Aug 2022 01:49:41 +0100 Subject: [PATCH] Disable copy-jdk-configs and bootstrapping for Flatpak builds There does not appear to be any value in having copy-jdk-config in Flatpak builds (where a given Flatpak bundles one specific JDK, so no need for a "Utility script to transfer JDKs configuration files between updates or for archiving.") And at least when trying to do a LibreOffice Flatpak build from Fedora 34 RPM specs (which includes java-11-openjdk among its components), the #!/usr/bin/lua shebang in copy_jdk_configs.lua would have caused a requirement on /usr/bin/lua, but which a lua RPM bundled in the Flatpak would not provide (as it would provide /app/bin/lua instead). And the easiest way to work around that issue is to just disable the unnecessary copy-jdk-configs. ...after "Temporarily move x86 to use Zero in order to get a working build": When building the > if ${run_bootstrap} ; then branch for suffix='' and loop='-main', the second > buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} uses the JDK (`$(pwd)/${bootinstalldir}/images/%{jdkimage}`) from the installjdk on the previous line. But installjdk does > rm ${imagepath}/lib/tzdb.dat > ln -s %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/lib/tzdb.dat which made that JDK's tzdb.dat link to /app/share/javazi-1.8/tzdb.dat in a flatpak build (rather than the usual /usr/share/javazi-1.8/tzdb.dat in a non-flatpak build) which is not present at build-time (but will be present at runtime in at least the LibreOffice flatpak, which bundles tzdata-java built for the flatpak /app prefix). So using that JDK's compiler during the build kept failing due to java.io.FileNotFoundException for its lib/tzdb.dat. (This was not an issue prior to the recent change, as installjdk's modification of lib/tzdb.dat used to be done only for the "Final setup on the main image" at the very end of the build, not during the build for JDKs that are themselves used later during the build.) The easiest workaround for this issue appears to be to just not bootstrap_build in the flatpak case, avoiding the situation that a JDK whose lib/tzdb.dat has been modified through installjdk is used during the build. Resolves: rhbz#2102727 --- java-1.8.0-openjdk.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 5733069..7a2a598 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -158,11 +158,15 @@ # Build and test slowdebug first as it provides the best diagnostics %global build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build} +%if 0%{?flatpak} +%global bootstrap_build false +%else %ifarch %{bootstrap_arches} %global bootstrap_build true %else %global bootstrap_build false %endif +%endif %global bootstrap_targets images %global release_targets images docs-zip @@ -327,7 +331,7 @@ %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) # eg jdk8u60-b27 -> b27 %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) -%global rpmrelease 2 +%global rpmrelease 3 # Define milestone (EA for pre-releases, GA ("fcs") for releases) # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, @@ -1216,11 +1220,13 @@ Requires: tzdata-java >= 2022a # for support of kernel stream control # libsctp.so.1 is being `dlopen`ed on demand Requires: lksctp-tools%{?_isa} +%if ! 0%{?flatpak} # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it, # not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be # considered as regression Requires: copy-jdk-configs >= 4.0 OrderWithRequires: copy-jdk-configs +%endif # for printing support Requires: cups-libs # for system security properties @@ -2658,6 +2664,11 @@ cjc.mainProgram(args) %endif %changelog +* Mon Aug 29 2022 Stephan Bergmann - 1:1.8.0.345.b01-3 +- Disable copy-jdk-configs for Flatpak builds +- Fix flatpak builds by exempting them from bootstrap +- Resolves: rhbz#2102727 + * Wed Aug 03 2022 Andrew Hughes - 1:1.8.0.345.b01-2 - Update to shenandoah-jdk8u345-b01 (GA) - Update release notes for 8u345-b01.