Le dimanche 26 novembre 2023 à 16:34 +0100, Matthijs Kooijman a écrit :
> Hi,
> 
> I've also gotten a bunch of bug reports from this MBF. Some were easy
> to
> fix, but there is one subtype of this issue where I think the
> commonly
> given advice and policy currently contradict.
> 
> This concerns files that:
>  - are shipped in the upstream tarball
>  - are regenerated (with slightly different contents) during the
> build
> 
> These are essentially build products prebuilt by upstream.
> 
> 
> A commonly recommended approach to fix this, and also the only
> approach
> listed on the page linked by the bug report [1], is to add such files
> to
> the extend-diff-ignore dpkg-source option.
> 
> [1]: https://wiki.debian.org/qa.debian.org/FTBFS/DoubleBuild
> 
> AFAICS this causes dpkg-source to simply ignore changes in this file,
> preventing dpkg-source from raising an error due to such
> modifications.
> 
> However, the policy 4.9 says:
> 
>   clean (required)
>        This must undo any effects that the build and binary targets
> may
>        have had, except that it should leave alone any output files
>        created in the parent directory by a run of a binary target.
> 
> So this does not say "dpkg-source must still work after the build
> + clean", it says that *any* effects of the build must be undone,
> which
> is stronger.
> 
> So AFAICS the extend-diff-ignore fix does not comply with the policy
> in
> its current form. Also, it means that two subsequent builds will not
> start from an identical source tree, which *could* hurt
> reproducibility
> (though in practice these files will be regenerated, so the build
> *should* be identical anyway).
> 

The way I handled such cases in some of my packages was:
- in the build target - but before actually building - detect if
foo.orig exists, and if it doesn't, copy foo to foo.orig ;
- in the clean target, detect if foo.orig exists, and if it does, move
it to foo.

That way even if foo gets modified during the build, the clean target
puts it back like it was.

Unelegant, annoying, but it does the trick...

Cheers,

JP

Reply via email to