Pin modification time for python files to SOURCE_DATE_EPOCH

Patching the pretty printer files leads to different mtimes for
different, which then leads to different results in the compiled python
bytecode since it uses mtimes for invalidation.  Use
`$SOURCE_DATE_EPOCH` as the mtime for the pretty printers so that they
end up with identical bytecode results.

This allows libstdc++.x86_64 to be installed alongside libstdc++.i686.

Related: RHEL-50290
This commit is contained in:
Siddhesh Poyarekar 2025-03-21 14:57:13 -04:00
parent 9ebe2f9de7
commit 5a818f37a4

View File

@ -1,10 +1,11 @@
%global source_date_epoch_from_changelog 1
%global DATE 20210514
%global gitrev a3253c88425835d5b339d6998a1110a66ccd8b44
%global gcc_version 8.5.0
%global gcc_major 8
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 25
%global gcc_release 26
%global nvptx_tools_gitrev c28050f60193b3b95a18866a96f03334e874e78f
%global nvptx_newlib_gitrev aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24
%global _unpackaged_files_terminate_build 0
@ -1571,9 +1572,9 @@ mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++*gdb.py* \
%{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/
pushd ../libstdc++-v3/python
for i in `find . -name \*.py`; do
touch -r $i %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/$i
touch -d @$SOURCE_DATE_EPOCH %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/$i
done
touch -r hook.in %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
touch -d @$SOURCE_DATE_EPOCH %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py
popd
for f in `find %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/ \
%{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ -name \*.py`; do
@ -3353,6 +3354,9 @@ fi
%{ANNOBIN_GCC_PLUGIN_DIR}/gcc-annobin.so.0.0.0
%changelog
* Fri Mar 21 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 8.5.0-26
- Pin modification time for python files to SOURCE_DATE_EPOCH (RHEL-50290).
* Fri Feb 28 2025 Siddhesh Poyarekar <siddhesh@redhat.com> 8.5.0-25
- Sync libstdc++ pretty printers to latest GTS (RHEL-50290).