Control: severity -1 minor
On Sun, 22 Aug 2021 at 18:17:45 +0100, Simon McVittie wrote:
> Unfortunately, the default CFLAGS from dpkg-buildflags include the build
> path, which means this prevents the build from being reproducible (a
> Policy ยง4.15 "should").
Lowering severity to minor because varying the build path is specifically
called out in Policy as something that is a lower priority for
reproducibility.
> After fixing #992702, this seems like it might be the only source of
> non-reproducibility in the package, so if you're willing to apply a
> (probably Debian-specific) patch to avoid it, the package is likely to
> become fully reproducible. Please see attached for a possible implementation.
Sorry, patch really attached now.
smcv
>From 57e42179c18fbb1a5cc7d8bd45e076a052fe104e Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Mon, 23 Aug 2021 09:40:33 +0100
Subject: [PATCH] cc plugin: Filter out -ffile-prefix-map etc. from CFLAGS
The default CFLAGS from dpkg-buildflags include this compiler flag to
rewrite nbdkit's own source directory in __FILE__, debug symbols and
similar constructs so that the source directory used by the developer
or the transient source directory used by an autobuilder is not
written into the executable, which would make it non-reproducible
between different build directories. Older versions used
-fdebug-prefix-map for a similar (although more limited) purpose.
However, these particular flags are not useful when compiling a new
plugin at a later time, and because they include the package's source
directory, including them in the binary makes it non-reproducible
between different build directories.
Signed-off-by: Simon McVittie <[email protected]>
Bug-Debian: https://bugs.debian.org/992722
---
plugins/cc/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/cc/Makefile.am b/plugins/cc/Makefile.am
index ffee90c..9f6c297 100644
--- a/plugins/cc/Makefile.am
+++ b/plugins/cc/Makefile.am
@@ -46,7 +46,7 @@ nbdkit_cc_plugin_la_SOURCES = \
nbdkit_cc_plugin_la_CPPFLAGS = \
-DCC="\"$(CC)\"" \
- -DCFLAGS="\"$(CFLAGS) -fPIC -shared\"" \
+ -DCFLAGS="\"$(filter-out -ffile-prefix-map=% -fdebug-prefix-map=%,$(CFLAGS)) -fPIC -shared\"" \
-I$(top_srcdir)/common/utils \
-I$(top_srcdir)/include \
-I. \
--
2.33.0