Control: tags -1 + pending
Control: tags 1049814 + pending


Hi,

(Sending to both #1044140 and #1049814: The source-after-build and
binary-after-build failures have the same root cause, and one change
fixes both.)

This is tagged fixed-upstream. However, the upstream fix
(cyrusimap/cyrus-imapd#5757, closing cyrusimap/cyrus-imapd#4493) is part
of a much larger rewrite of the build system generally, which is
destined for the 3.13 / 3.14 branches.

We ship 3.12.x in unstable/testing, and also in trixie-backports
(3.12.3-1~bpo13+1). Trixie stable is on 3.10.x

Root cause of the issue at hand: debian/rules' override_dh_auto_clean
unconditionally rewrites perl/annotator/Makefile.PL from Makefile.PL.in
on every clean. That works the first time, but on a *second* clean/build
cycle, perl/annotator/Makefile already exists from the prior build, and
rewriting Makefile.PL bumps its mtime past Makefile's.
MakeMaker's generated Makefile then refuses to proceed ("Makefile
out-of-date with respect to Makefile.PL ... Please rerun the make
command") instead of running distclean, which is what dh_auto_clean sees
as a failure.

I confirmed this in isolation (just perl + ExtUtils::MakeMaker, no building the full package).

Fix: Only rewrite Makefile.PL when its generated content actually
differs from what's on disk, so its mtime isn't touched on a redundant
regeneration. This is done by using a .tmp file.

Prepared for 3.12.3-5; the backport picks it up on its next rebuild.

Merge request:
    https://salsa.debian.org/debian/cyrus-imapd/-/merge_requests/28

The change to debian/rules:

  @@ -243,5 +243,11 @@ override_dh_missing:
        dh_missing --fail-missing -X.la

   override_dh_auto_clean:
- perl -pe 's#\@top_srcdir\@#../..#' <perl/annotator/Makefile.PL.in >perl/annotator/Makefile.PL + # Only rewrite Makefile.PL if its content actually changes: touching its + # mtime when perl/annotator/Makefile already exists (i.e. this isn't the + # first clean) makes MakeMaker think its Makefile is stale and refuse to
  +     # run, breaking a second build/clean cycle (#1044140, #1049814).
+ perl -pe 's#\@top_srcdir\@#../..#' <perl/annotator/Makefile.PL.in >perl/annotator/Makefile.PL.tmp + cmp -s perl/annotator/Makefile.PL.tmp perl/annotator/Makefile.PL || mv perl/annotator/Makefile.PL.tmp perl/annotator/Makefile.PL
  +     rm -f perl/annotator/Makefile.PL.tmp
        dh_auto_clean

Kind regards,

    Edmund


--
Edmund Lodewijks <[email protected]>
TZ: UTC+2 / GMT+2

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to