[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: -ffile-prefix-map option and reproducibility



On 07/02/2023 20:00, Sven Joachim wrote:
On 2023-02-07 17:50 +0100, Guillem Jover wrote:

On Tue, 2023-02-07 at 16:41:47 +0100, Stéphane Glondu wrote:
When building packages, a -ffile-prefix-map option is automatically injected
into CFLAGS. Where does it come from? Since when?

This is coming from dpkg-buildflags (in this case probably indirectly
via debhelper). AFAICS it was added in dpkg 1.19.1 disabled by default,
and then switched to enabled by default in dpkg 1.20.6 (see #974087).

I suspect this was added to improve reproducibility. Ironically, it makes
packages that capture this variable non reproducible, since the build path
seems to be randomized (has it always been the case? since when?). It is the
case of OCaml (see #1030785), and seemingly of R as well (found by grepping
in my /etc). I wouldn't be surprised other packages are affected as well.

AFAIR this was considered at the time, yes. If the flag is effectively
not fixing anything for the set of packages involved, and is in fact
actually making them unreproducible when they would not then, you can
disable the fixfilepath feature in the reproducible build flags area,
via DEB_BUILD_MAINT_OPTIONS.

This does not help for packages which capture all build flags and store
them in some file in the package (as is the case here).

What is the purpose of having the build flags in a file in the .deb?

Cheers,
Emilio


Reply to: