Debian Bug report logs - #719854
dpkg: Please expand all substvars in dpkg-genchanges

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Jérémy Bobbio <lunar@debian.org>

Date: Fri, 16 Aug 2013 07:48:02 UTC

Severity: wishlist

Tags: wontfix

Found in version dpkg/1.16.10

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, asheesh@asheesh.org, stefanor@debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#719854; Package dpkg. (Fri, 16 Aug 2013 07:48:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jérémy Bobbio <lunar@debian.org>:
New Bug report received and forwarded. Copy sent to asheesh@asheesh.org, stefanor@debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 16 Aug 2013 07:48:06 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Jérémy Bobbio <lunar@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg: Please expand all substvars in dpkg-genchanges
Date: Fri, 16 Aug 2013 09:44:15 +0200
[Message part 1 (text/plain, inline)]
Package: dpkg
Version: 1.16.10
Severity: wishlist
Tags: patch

Hi!

We are currently a few folks interested in enabling byte for byte
reproducible builds of Debian packages [1].

In order to achieve this, we need a way to record the environment that
was used to do the initial build. We currently think that the right
place to do so is the `.changes` file.

We can currently easily add new fields there by using the `XC-`
construct in `debian/control`. Unfortunately, `dpkg-genchanges`
does currently not expand all substvars, limiting our abilities to
experiment.

Can you consider applying the following patch that make
`dpkg-genchanges` behave just like `dpkg-gencontrol`?

diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index 0b004c7..13cedd6 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -516,4 +516,5 @@ for my $f (keys %remove) {
     delete $fields->{$f};
 }
 
-$fields->output(\*STDOUT); # Note: no substitution of variables
+$fields->apply_substvars($substvars);
+$fields->output(\*STDOUT);

Thanks!

[1] https://wiki.debian.org/ReproducibleBuilds

-- 
Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#719854; Package dpkg. (Fri, 16 Aug 2013 09:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 16 Aug 2013 09:42:04 GMT) Full text and rfc822 format available.

Message #10 received at 719854@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Jérémy Bobbio <lunar@debian.org>, 719854@bugs.debian.org
Subject: Re: Bug#719854: dpkg: Please expand all substvars in dpkg-genchanges
Date: Fri, 16 Aug 2013 11:39:41 +0200
Control: tags -1 - patch
Control: tags -1 + wontfix

Hi!

On Fri, 2013-08-16 at 09:44:15 +0200, Jérémy Bobbio wrote:
> Package: dpkg
> Version: 1.16.10
> Severity: wishlist
> Tags: patch

> We are currently a few folks interested in enabling byte for byte
> reproducible builds of Debian packages [1].
> 
> In order to achieve this, we need a way to record the environment that
> was used to do the initial build. We currently think that the right
> place to do so is the `.changes` file.

Sure, there's also another bug report requesting builtin support for
this, the problem is about possible privacy issue, like leaks of user
information.

> We can currently easily add new fields there by using the `XC-`
> construct in `debian/control`. Unfortunately, `dpkg-genchanges`
> does currently not expand all substvars, limiting our abilities to
> experiment.

For experimenting purposes there's already everything you need in
place, no need for patching, something like this would do:

  $ dpkg-buildpackage --changes-option="-DBuild-Env=VarA=foo VarB=bar"

> Can you consider applying the following patch that make
> `dpkg-genchanges` behave just like `dpkg-gencontrol`?
> 
> diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
> index 0b004c7..13cedd6 100755
> --- a/scripts/dpkg-genchanges.pl
> +++ b/scripts/dpkg-genchanges.pl
> @@ -516,4 +516,5 @@ for my $f (keys %remove) {
>      delete $fields->{$f};
>  }
>  
> -$fields->output(\*STDOUT); # Note: no substitution of variables
> +$fields->apply_substvars($substvars);
> +$fields->output(\*STDOUT);

Expanding substvars “might” possibly only make sense for unknown fields,
the rest of the known fields should be deterministic from the source
package itself. And there's multiple fields that must not use them
at all, this includes the Changes field for example, or we'd get
expansions on changelog entries that mention substvars.

So in principle I'll be tagging this wontfix, and probably closing after
a bit, given that the original request can be already fulfilled by other
(nicer) means.

Thanks,
Guillem



Removed tag(s) patch. Request was from Guillem Jover <guillem@debian.org> to 719854-submit@bugs.debian.org. (Fri, 16 Aug 2013 09:42:04 GMT) Full text and rfc822 format available.

Added tag(s) wontfix. Request was from Guillem Jover <guillem@debian.org> to 719854-submit@bugs.debian.org. (Fri, 16 Aug 2013 09:42:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#719854; Package dpkg. (Fri, 16 Aug 2013 10:09:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jérémy Bobbio <lunar@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 16 Aug 2013 10:09:09 GMT) Full text and rfc822 format available.

Message #19 received at 719854@bugs.debian.org (full text, mbox):

From: Jérémy Bobbio <lunar@debian.org>
To: Guillem Jover <guillem@debian.org>
Cc: 719854@bugs.debian.org
Subject: Re: Bug#719854: dpkg: Please expand all substvars in dpkg-genchanges
Date: Fri, 16 Aug 2013 12:07:23 +0200
[Message part 1 (text/plain, inline)]
Guillem Jover:
> Sure, there's also another bug report requesting builtin support for
> this, the problem is about possible privacy issue, like leaks of user
> information.

Are you talking about #138409 (opened 15 Mar 2002!)?

> > We can currently easily add new fields there by using the `XC-`
> > construct in `debian/control`. Unfortunately, `dpkg-genchanges`
> > does currently not expand all substvars, limiting our abilities to
> > experiment.
> 
> For experimenting purposes there's already everything you need in
> place, no need for patching, something like this would do:
> 
>   $ dpkg-buildpackage --changes-option="-DBuild-Env=VarA=foo VarB=bar"

This has the downside that it needs a wrapper script, or modifications
to existing ones (debuild, pbuilder, sbuild, …) but I guess we can cope
with that in a first phase.
 
> Expanding substvars “might” possibly only make sense for unknown fields,
> the rest of the known fields should be deterministic from the source
> package itself. And there's multiple fields that must not use them
> at all, this includes the Changes field for example, or we'd get
> expansions on changelog entries that mention substvars.

I had not thought of the issue related to changelog entries. I think it
would be worth documenting it, maybe close to the “Note: no substitution
of variables” comment.

> So in principle I'll be tagging this wontfix, and probably closing after
> a bit, given that the original request can be already fulfilled by other
> (nicer) means.

Fair enough.

-- 
Jérémy Bobbio                        .''`. 
lunar@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#719854; Package dpkg. (Fri, 16 Aug 2013 11:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 16 Aug 2013 11:54:04 GMT) Full text and rfc822 format available.

Message #24 received at 719854@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Jérémy Bobbio <lunar@debian.org>, 719854@bugs.debian.org
Subject: Re: Bug#719854: dpkg: Please expand all substvars in dpkg-genchanges
Date: Fri, 16 Aug 2013 13:51:23 +0200
Hi!

On Fri, 2013-08-16 at 12:07:23 +0200, Jérémy Bobbio wrote:
> Guillem Jover:
> > Sure, there's also another bug report requesting builtin support for
> > this, the problem is about possible privacy issue, like leaks of user
> > information.
> 
> Are you talking about #138409 (opened 15 Mar 2002!)?

Yes (and only 11 years, not too bad :).

> > Expanding substvars “might” possibly only make sense for unknown fields,
> > the rest of the known fields should be deterministic from the source
> > package itself. And there's multiple fields that must not use them
> > at all, this includes the Changes field for example, or we'd get
> > expansions on changelog entries that mention substvars.
> 
> I had not thought of the issue related to changelog entries. I think it
> would be worth documenting it, maybe close to the “Note: no substitution
> of variables” comment.

Sure, I'll clarify such comments.

Thanks,
Guillem



Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. (Fri, 23 Aug 2013 23:18:05 GMT) Full text and rfc822 format available.

Notification sent to Jérémy Bobbio <lunar@debian.org>:
Bug acknowledged by developer. (Fri, 23 Aug 2013 23:18:05 GMT) Full text and rfc822 format available.

Message #29 received at 719854-done@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Jérémy Bobbio <lunar@debian.org>, 719854-done@bugs.debian.org
Subject: Re: Bug#719854: dpkg: Please expand all substvars in dpkg-genchanges
Date: Sat, 24 Aug 2013 01:15:02 +0200
Hi!

On Fri, 2013-08-16 at 12:07:23 +0200, Jérémy Bobbio wrote:
> Guillem Jover:
> > Expanding substvars “might” possibly only make sense for unknown fields,
> > the rest of the known fields should be deterministic from the source
> > package itself. And there's multiple fields that must not use them
> > at all, this includes the Changes field for example, or we'd get
> > expansions on changelog entries that mention substvars.
> 
> I had not thought of the issue related to changelog entries. I think it
> would be worth documenting it, maybe close to the “Note: no substitution
> of variables” comment.

I've done so now locally.

> > So in principle I'll be tagging this wontfix, and probably closing after
> > a bit, given that the original request can be already fulfilled by other
> > (nicer) means.
> 
> Fair enough.

Ok closing then.

Thanks,
Guillem



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 21 Sep 2013 07:30:19 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 04:45:09 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.