Try to build on x86 again by creating a husk of a JDK which does not depend on itself

This commit is contained in:
Andrew Hughes 2022-07-19 01:30:25 +01:00
parent 3f2f52a2a3
commit d66bf86c49

View File

@ -368,7 +368,7 @@
%global top_level_dir_name %{origin} %global top_level_dir_name %{origin}
%global top_level_dir_name_backup %{top_level_dir_name}-backup %global top_level_dir_name_backup %{top_level_dir_name}-backup
%global buildver 2 %global buildver 2
%global rpmrelease 6 %global rpmrelease 7
# 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 # 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
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
@ -485,9 +485,6 @@
%global tapsetdir %{tapsetdirttapset}/%{stapinstall} %global tapsetdir %{tapsetdirttapset}/%{stapinstall}
%endif %endif
# x86 is no longer supported
ExcludeArch: %{ix86}
# not-duplicated scriptlets for normal/debug packages # not-duplicated scriptlets for normal/debug packages
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
@ -825,14 +822,20 @@ exit 0
exit 0 exit 0
} }
%ifarch %{ix86}
%define files_jre() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-jre.sh}
%else
%define files_jre() %{expand: %define files_jre() %{expand:
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so %{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so
} }
%endif
%ifarch %{ix86}
%define files_jre_headless() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-headless.sh}
%else
%define files_jre_headless() %{expand: %define files_jre_headless() %{expand:
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS %doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS
@ -967,7 +970,11 @@ exit 0
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/conf.rpmmoved %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/conf.rpmmoved
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/security.rpmmoved %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/security.rpmmoved
} }
%endif
%ifarch %{ix86}
%define files_devel() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-devel.sh}
%else
%define files_devel() %{expand: %define files_devel() %{expand:
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin %dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar %{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar
@ -1072,29 +1079,49 @@ exit 0
%endif %endif
%endif %endif
} }
%endif
%ifarch %{ix86}
%define files_jmods() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-jmods.sh}
%else
%define files_jmods() %{expand: %define files_jmods() %{expand:
%{_jvmdir}/%{sdkdir -- %{?1}}/jmods %{_jvmdir}/%{sdkdir -- %{?1}}/jmods
} }
%endif
%ifarch %{ix86}
%define files_demo() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-demo.sh}
%else
%define files_demo() %{expand: %define files_demo() %{expand:
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
%{_jvmdir}/%{sdkdir -- %{?1}}/demo %{_jvmdir}/%{sdkdir -- %{?1}}/demo
%{_jvmdir}/%{sdkdir -- %{?1}}/sample %{_jvmdir}/%{sdkdir -- %{?1}}/sample
} }
%endif
%ifarch %{ix86}
%define files_src() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-src.sh}
%else
%define files_src() %{expand: %define files_src() %{expand:
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip %{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip
} }
%endif
%ifarch %{ix86}
%define files_static_libs() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-static_libs.sh}
%else
%define files_static_libs() %{expand: %define files_static_libs() %{expand:
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_root} %dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_root}
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_arch_dir} %dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_arch_dir}
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_install_dir} %dir %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_install_dir}
%{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_install_dir}/lib*.a %{_jvmdir}/%{sdkdir -- %{?1}}/%{static_libs_install_dir}/lib*.a
} }
%endif
%ifarch %{ix86}
%define files_javadoc() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-javadoc.sh}
%else
%define files_javadoc() %{expand: %define files_javadoc() %{expand:
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}} %doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
@ -1107,7 +1134,11 @@ exit 0
%endif %endif
%endif %endif
} }
%endif
%ifarch %{ix86}
%define files_javadoc_zip() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/gone-javadoc_zip.sh}
%else
%define files_javadoc_zip() %{expand: %define files_javadoc_zip() %{expand:
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip %doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
@ -1120,6 +1151,7 @@ exit 0
%endif %endif
%endif %endif
} }
%endif
# not-duplicated requires/provides/obsoletes for normal/debug packages # not-duplicated requires/provides/obsoletes for normal/debug packages
%define java_rpo() %{expand: %define java_rpo() %{expand:
@ -1442,7 +1474,9 @@ BuildRequires: pkgconfig
BuildRequires: xorg-x11-proto-devel BuildRequires: xorg-x11-proto-devel
BuildRequires: zip BuildRequires: zip
BuildRequires: javapackages-filesystem BuildRequires: javapackages-filesystem
%ifnarch %{ix86}
BuildRequires: java-latest-openjdk-devel BuildRequires: java-latest-openjdk-devel
%endif
# Zero-assembler build requirement # Zero-assembler build requirement
%ifarch %{zero_arches} %ifarch %{zero_arches}
BuildRequires: libffi-devel BuildRequires: libffi-devel
@ -1884,6 +1918,11 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE17} > nss.fips.cfg
%build %build
# x86 is deprecated
%ifarch %{ix86}
exit 0
%endif
# How many CPU's do we have? # How many CPU's do we have?
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
export NUM_PROC=${NUM_PROC:-1} export NUM_PROC=${NUM_PROC:-1}
@ -2211,20 +2250,34 @@ jdk_image=${top_dir_abs_main_build_path}/images/%{jdkimage}
# Install the jdk # Install the jdk
mkdir -p $RPM_BUILD_ROOT%{_jvmdir} mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
pushd ${jdk_image}
%ifarch %{ix86} %ifarch %{ix86}
for file in $(find $(pwd) | grep -e "/bin/" -e "\.so$") ; do mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- ${suffix}}
echo "deprecating $file"
file=/tmp/gonejdk.$$
echo "OpenJDK on x86 is now deprecated"
echo '#!/bin/bash' > $file echo '#!/bin/bash' > $file
echo 'echo "We are going to remove i686 jdk. Please fix your package accordingly!"' >> $file echo 'echo "We are going to remove i686 jdk. Please fix your package accordingly!"' >> $file
echo 'echo "See https://fedoraproject.org/wiki/Changes/Drop_i686_JDKs"' >> $file echo 'echo "See https://fedoraproject.org/wiki/Changes/Drop_i686_JDKs"' >> $file
echo 'echo "See https://pagure.io/fesco/issue/2772"' >> $file echo 'echo "See https://pagure.io/fesco/issue/2772"' >> $file
echo 'echo "See https://bugzilla.redhat.com/show_bug.cgi?id=2083750"' >> $file echo 'echo "See https://bugzilla.redhat.com/show_bug.cgi?id=2083750"' >> $file
echo 'exit 1' >> $file echo 'exit 1' >> $file
done
%endif
popd
for pkgsuffix in jre headless devel demo src debugsourcefiles jmods static_libs ; do
cp -a ${file} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- ${suffix}}/gone-${pkgsuffix}.sh
done
# Docs were only in the normal build
if ! echo $suffix | grep -q "debug" ; then
for pkgsuffix in javadoc javadoc_zip ; do
cp -a ${file} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- ${suffix}}/gone-${pkgsuffix}.sh
done
fi
rm -f ${file}
%else
# Install the jdk
cp -a ${jdk_image} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix} cp -a ${jdk_image} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}
pushd ${jdk_image} pushd ${jdk_image}
@ -2325,16 +2378,24 @@ find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 7
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ; find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ;
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/legal -type f -exec chmod 644 {} \; ; find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/legal -type f -exec chmod 644 {} \; ;
%endif
# end, dual install # end, dual install
done done
%check %check
%ifarch %{ix86}
exit 0
%endif
# We test debug first as it will give better diagnostics on a crash # We test debug first as it will give better diagnostics on a crash
for suffix in %{build_loop} ; do for suffix in %{build_loop} ; do
%ifarch %{ix86}
# Fake debugsourcefiles.list here after find-debuginfo.sh has already had a go
echo "%{_jvmdir}/%{sdkdir -- ${suffix}}/gone-debugsourcefiles.sh" >> debugsourcefiles.list
cat debugsourcefiles.list
%else
# Tests in the check stage are performed on the installed image # Tests in the check stage are performed on the installed image
# rpmbuild operates as follows: build -> install -> test # rpmbuild operates as follows: build -> install -> test
export JAVA_HOME=${RPM_BUILD_ROOT}%{_jvmdir}/%{sdkdir -- $suffix} export JAVA_HOME=${RPM_BUILD_ROOT}%{_jvmdir}/%{sdkdir -- $suffix}
@ -2395,6 +2456,8 @@ $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
%endif
# build cycles check # build cycles check
done done
@ -2642,6 +2705,9 @@ cjc.mainProgram(args)
%endif %endif
%changelog %changelog
* Tue Jul 19 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.1.2-7.rolling
- Try to build on x86 again by creating a husk of a JDK which does not depend on itself
* Sun Jul 17 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.1.2-6.rolling * Sun Jul 17 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.1.2-6.rolling
- Exclude x86 from builds as the bootstrap JDK is now completely broken and unusable - Exclude x86 from builds as the bootstrap JDK is now completely broken and unusable