Updating dpkg-buildflags to enable reproducible=+fixfilepath by default

Guillem Jover guillem at debian.org
Tue Jan 19 04:02:29 GMT 2021


Hi!

On Mon, 2021-01-11 at 00:48:42 +1100, Stuart Prescott wrote:
> Sune Stolborg Vuorela wrote:
> > Can you provide some kind of hook in the environment so we at least can work
> > around it in the users, so that the internal functions (where the output of
> > __FILE__ is forwarded to) can glue e.g. the content of an environment
> > variable in front of the usage of the __FILE__ content to try to
> > reconstruct it at runtime, so that all packages doesn't need to do export
> > SOURCE_BASE_DIR=`pwd`; make test, but it will just work if we patch Qt and
> > similar libraries ?

Sure, that sounds doable, but as always given that we have not yet
decided to obsolete supporting debian/rules as a build entry point,
any such support would either need to be conditional from the upstream
or packaging side, or something like debhelper would also need to
guarantee it is set up. :/

> SOURCE_BASE_DIR has a delightful symmetry to SOURCE_DATE_EPOCH and the 
> algorithm for use is similar: if it is in the environment then use it, if not, 
> fall back to the previous behaviour.

Yes! And as this was triggered by reproducible builds, and as you
mention due to the similarities, it would nice to publish a “spec”
once we reach some agreement, given that would end up being part of
a neutral project, with more chances for upstream adoption.

> At its crudest level, a package's debian/rules could include SOURCE_BASE_DIR=
> $(shell pwd); however, putting this into the build environment saves source 
> changes in multiple packages, sets us up for future use across the entire 
> ecosystem, signals to upstreams that this is a broad standard and not a mere 
> hack in d/rules, and also saves maintainers from thinking about nasty corner 
> cases to do with current directories with makefile invocation.
> 
> Looking to the future, tests using SOURCE_BASE_DIR to locate test data would 
> allow build-time tests to be repurposed as autopkgtest tests too, as the 
> autopkgtest could tell the tests where the test input data is to be found. 
> This would be a substantial improvement on the current situation where the 
> tests can only be run at build time and not on ci.debian.net.
> 
> By dpkg making SOURCE_BASE_DIR 'real', there is a distinct prospect of Debian 
> carrying Qt5 patches to use it (thanks Sune!) and for Qt6 to include them 
> upstream.

I agree with all of this, barring my initial comment above. I guess I
need to go back to the thread proposing to obsolete debian/rules as a
supported build entry point. :)

I think Simon's remark might be worth having a thought about too. But
as a starting point I prepared the attached patch, which sets the
variable from dpkg-buildpackage and pkg-info.mk. Once there's
agreement on the variable(s), I'm fine merging this, but whether to
include this for bullseye would need release-team approval at this
point I guess.

Thanks,
Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dpkg-buildpackage-Add-SOURCE_BASE_DIR-support.patch
Type: text/x-diff
Size: 4499 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20210119/ca4467c4/attachment.patch>


More information about the Reproducible-builds mailing list