commit: abf8e2ee55c52c8ae894e0b3845ea1cebfcfd4e8 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Mar 16 01:38:45 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Mar 23 15:40:50 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abf8e2ee
toolchain.eclass: install test results as orphaned files in /var/cache/gcc This allows comparison across versions even after they get upgraded, which is useful in itself (and across series), but also for looking into when regressions started if they're reported but started a while ago. Followup to 9ac3f1cf62b522236ba9efd7e923071c37df1e6d. Bug: https://bugs.gentoo.org/214345 Bug: https://bugs.gentoo.org/253926 Signed-off-by: Sam James <sam <AT> gentoo.org> eclass/toolchain.eclass | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index c8543c617ccd..699e647c693a 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -2100,16 +2100,9 @@ toolchain_src_install() { pax-mark -r "${ED}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1plus" if use test ; then - # TODO: In future, install orphaned to allow comparison across - # more versions even after unmerged? Also would be useful for - # historical records and tracking down regressions a while - # after they first appeared, but were only just reported. - einfo "Copying test results to ${EPREFIX}/var/cache/gcc/${CHOST}/${SLOT} for future comparison" - ( - dodir /var/cache/gcc/${CHOST}/${SLOT} - cd "${WORKDIR}"/build || die - find . -name \*.sum -exec cp --parents -v {} "${ED}"/var/cache/gcc/${CHOST}/${SLOT} \; - ) + mkdir "${T}"/test-results || die + cd "${WORKDIR}"/build || die + find . -name \*.sum -exec cp --parents -v {} "${T}"/test-results \; fi } @@ -2262,6 +2255,23 @@ create_revdep_rebuild_entry() { EOF } +#---->> pkg_pre* <<---- + +toolchain_pkg_preinst() { + if use test ; then + # Install as orphaned to allow comparison across more + # versions even after unmerged. Also useful for historical records + # and tracking down regressions a while after they first appeared, + # but were only just reported. + einfo "Copying test results to ${BROOT}/var/cache/gcc/${CHOST}/${SLOT} for future comparison" + ( + mkdir -p "${BROOT}"/var/cache/gcc/${CHOST}/${SLOT} || die + cd "${T}"/test-results || die + find . -name \*.sum -exec cp --parents -v {} "${BROOT}"/var/cache/gcc/${CHOST}/${SLOT} \; + ) + fi +} + #---->> pkg_post* <<---- toolchain_pkg_postinst() { @@ -2515,4 +2525,4 @@ fi # enabled-by-default state: # econf $(usex foo '' --disable-foo) -EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm +EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm