Re: Reproducible builds: genbki.pl vs schemapg.h

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Christoph Berg <christoph(dot)berg(at)credativ(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reproducible builds: genbki.pl vs schemapg.h
Date: 2017-12-15 23:39:05
Message-ID: 5525.1513381145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2017-12-16 07:52:41 +0900, Michael Paquier wrote:
>> On Sat, Dec 16, 2017 at 3:13 AM, Christoph Berg
>> <christoph(dot)berg(at)credativ(dot)de> wrote:
>>> Re: Tom Lane 2017-12-15 <9616(dot)1513351766(at)sss(dot)pgh(dot)pa(dot)us>
>>>> genbki.pl is hardly our only script that prints its $0 ...

>>> As per
>>> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/postgresql-10.html,
>>> that's the only place that makes it into the resulting binary.

I'm fairly confused by this claim. Since the string in question is in a
comment, it really shouldn't affect built binaries at all. I can believe
that it would affect the non-binary contents of the finished package,
because we include schemapg.h as one of the installed headers. However,
we also include fmgroids.h, which also has an expanded version of $0
in it. So if schemapg.h is affected by build path, why isn't fmgroids.h?

In my build, neither one of these files contains any path information;
I speculate that you need to use a VPATH build to have an issue, or
maybe Debian's build environment does something even weirder. But
I feel confident in saying that if indeed fmgroids.h is invariant for
you today, that's a phase-of-the-moon behavior that will break someday
if we don't make a similar change in Gen_fmgrtab.pl. Or else we should
propagate what's preventing it back to genbki.pl.

plperl's text2macro.pl is also emitting $0, and there may be other places
I missed (I grepped for 'DO NOT EDIT', not for $0 per se). We seem not
to install the output file of that one, perlchunks.h, but that's a
decision that somebody might change too.

> It's not like $0 instead of a hardcoded name in the header actually buys
> us anything afaict.

Agreed so far as the script name goes. However, two out of three of these
scripts also print their input file names, and I'm suspicious that that
output is also gonna change in a VPATH build. I'm a little less inclined
to buy the claim that we're not losing anything if we suppress that :-(

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Finzel 2017-12-16 04:50:07 Re: Backfill bgworker Extension?
Previous Message Peter Geoghegan 2017-12-15 23:36:00 Re: Reproducible builds: genbki.pl vs schemapg.h