heads-up, debhelper now depends transitively on libsub-prototype-perl and hence on the current "perlapi"
Alex Muntada
alexm at debian.org
Thu May 23 09:35:02 BST 2024
Hi Niko,
> As seen in #931730 this is not the first time this kind of issue
> comes up. Back in 2019 File::StripNondeterminism::handlers::zip was
> changed to use Sub::Override instead of the earlier Monkey::Patch
> because the latter introduced a similar build cycle.
>
> Getting rid of monkeypatching Archive::Zip altogether as tracked in
> https://salsa.debian.org/reproducible-builds/strip-nondeterminism/-/issues/8
> would probably be the best fix.
>
> Alternatively, finding yet another way of the monkeypatching
> Archive::Zip at runtime would work around this for hopefully
> at least another few years :)
After looking at the code I think that the easiest way to avoid
monkey patching at all would be inheritance. I haven't found
enough time to work on the full implementation yet, but this is
the general idea:
* File/StripNondeterminism/handlers/zip.pm defines 2 packages:
File::StripNondeterminism::handlers::zip itself and a subclass
of Archive::Zip::Member which is local (e.g. Local::AZM).
* Also defines methods cdExtraField and localExtraField calling
to super class methods first and then normalize_extra_fields
if needed.
* Replaces `Archive::Zip->new()` with `Local::AZM->new()`.
Monkey patching without importing other packages is also doable,
but I think inheritance is cleaner here.
Cheers,
Alex
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Alex Muntada <alexm at debian.org>
⢿⡄⠘⠷⠚⠋ Debian Developer 🍥 log.alexm.org
⠈⠳⣄⠀⠀⠀⠀
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20240523/c2bd50c0/attachment.sig>
More information about the Reproducible-builds
mailing list