🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.maint.dpkg
4 messages
4 total messages Started by Colin Watson Wed, 25 Nov 2026 16:20
Bug#1155323: dpkg-dev: .changes file format has no way to indicate the target archive/repository
#21
Author: Colin Watson
Date: Wed, 25 Nov 2026 16:20
88 lines
6441 bytes
Package: dpkg-dev
Version: 1.23.11
Severity: wishlist

This has been a design issue in the .changes file format for as long as 
I can remember, and I've seen it worked around in several different 
places.  I could have sworn I'd had a discussion about it in a bug 
report at some point, but I just looked through all of dpkg's archived 
and unarchived bugs for likely keywords and to my surprise couldn't find 
anything.  I suspect I'll end up working around this again, but it seems 
like a good idea to at least start figuring out how things could be 
improved for the future.


The deb-changes(5) file format is essentially a signed instruction to a 
target archive to install new files into a particular suite 
("Distribution:") if they pass the target archive's checks.  When it was 
first designed, there was pretty much only one archive anyone cared 
about, namely the Debian archive.  Nowadays there are lots: we have 
derived distributions, Ubuntu PPAs hosted on Launchpad, Debusine 
repositories, reprepro deployments, and so on.  This means that a signed 
.changes file can be used to replay an upload into an entirely different 
archive as long as it happens to have a suite with a matching name.  
Unlike signed .dsc files, therefore, the signature on the .changes file 
has to be treated as somewhat radioactive, which is an inconvenience.

Making sure that suites have globally-unique names is one defence 
against this, although it's often impractical, even leaving aside the 
fact that Launchpad's PPAs only allow using the suite names from the 
base Ubuntu archive.  More realistically, archive implementations 
generally take care to avoid exposing signed .changes files publicly.  
In Debian you can find recent ones if you poke around on coccia, but 
they aren't visible in the archive; Launchpad strips the signature 
before making the .changes file visible (e.g.  
https://git.launchpad.net/launchpad/tree/lib/lp/soyuz/model/queue.py#:~:text=Strip%20any%20PGP%20signature); 
and I'm sure there are other cases.  But all this is quite poorly 
documented and (in my experience) easy to get wrong.

Because there's no record of the intended target archive anywhere other 
than the uploader's `dput` command, it's easy to make mistakes, either 
manually or when using more intelligent wrappers.  There's the Launchpad 
PPA suite naming problem above (which I would certainly design 
differently with hindsight; fortunately maintaining it is no longer my 
problem).  Debian and Devuan both have an "experimental" suite (see 
https://bugs.debian.org/1145095).  And even if we did have 
globally-unique suite names, that still leaves people doing a lot of 
manual guessing when reading through old changelog entries; I've seen 
packages that went through three or more archives over their history, 
and I only know that because I have far too much information in my head 
about what all the names mean.

Systems that support multiple archives need bespoke ways to figure out 
which of their hosted archives an upload should end up in.  This is 
usually done with some kind of arrangement where the path is sent 
alongside the upload, maybe using an FTP/SFTP directory (e.g.  
https://git.launchpad.net/launchpad/tree/lib/lp/archiveuploader/uploadprocessor.py#:~:text=def%20parse_upload_path) 
or parameters to an API request (e.g.  
https://freexian-team.pages.debian.net/debusine/reference/dput-ng-profiles.html).  
But as above, that isn't recorded anywhere in the package itself, and 
it's easy to get wrong.


Is it too late to fix this?  Probably not, although it would take a 
while.  I could imagine adding another field to deb-changes(5) 
("Archive:" or "Repository:" or something) that identifies the target 
archive somehow.  There could be a registry of short names for archives, 
with some kind of namespacing mechanism for systems like Launchpad and 
Debusine that support many archives.  Perhaps there could be a way to 
annotate .changes entries with the intended target distribution, at 
least if it isn't Debian.

Archive implementations would need to check the new field, and reject 
uploads where it doesn't match what they expect.

It would only be safe to publish signed .changes files once all known 
archive implementations that accept them have been updated to check this 
field, so realistically even if you were to magically do this yesterday 
then it would still be years before we could simplify code that deals 
with .changes files.  All the same, it would be good to start that 
process if possible.

I expect that all this may need broader discussion, but dpkg seems like 
a good place to start.

Thanks,

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]
Bug#1155323: dpkg-dev: .changes file format has no way to indicate the target archive/repository
#22
Author: Guillem Jover
Date: Thu, 26 Nov 2026 05:00
83 lines
5144 bytes
Hi!

On Wed, 2026-11-25 at 16:16:34 +0000, Colin Watson wrote:
> Package: dpkg-dev
> Version: 1.23.11
> Severity: wishlist

> This has been a design issue in the .changes file format for as long as 
> I can remember, and I've seen it worked around in several different 
> places.  I could have sworn I'd had a discussion about it in a bug 
> report at some point, but I just looked through all of dpkg's archived 
> and unarchived bugs for likely keywords and to my surprise couldn't find 
> anything.  I suspect I'll end up working around this again, but it seems 
> like a good idea to at least start figuring out how things could be 
> improved for the future.

It's late now, so I don't want to spend lots of time writing a long
mail, but didn't want to not send one either. So just a quick mental
dump and state update.


I've been recently planning on retrying a .changes format bump, to
deprecate old stuff and change semantics for fields with confusing or
odd names (such as Suite instead of Distribution). So I've now rebased
and updated a bit the next/changes-format-2.0 branch in the
https://git.hadrons.org/cgit/debian/dpkg.git repo.


I also thought we already had an Origin field in .changes, but
apparently I only added one to .buildinfo! In any case I've also wanted
to improve our general Origin tracking for a long time:

  https://lists.debian.org/debian-derivatives/2012/10/msg00046.html
  https://lists.debian.org/debian-devel/2017/03/msg00339.html

Specially the reference to:

  https://www.hadrons.org/~guillem/debian/docs/origin.proposal

Which until these "recent" mails, I mostly circulated them on IRC,
and which AFAIR was the basis for the current dpkg-vendor and increasing
Origin support.

And had been also working on pushing this a bit further with the
pu/origin-tracking (which I've now also rebased and reworked a bit)
in the same hadrons.org repo.


I think one of my biggest mental blocks for pushing this further has been
that it's not clear to me whether there should be a distinction between:

  * the target source vendor (as say specified in debian/changelog),
    because one should be able to build a source elsewhere (for example
    for other distros that do simple source rebuilds), but the intent
    for the target suite (which can be ambiguous) is currently encoded
    in there!
  * the target binary vendor (as obtained from the current chroot dpkg
    vendor), because this represents the environment this was built in.
    (That's why the current field in .buildinfo is called Build-Origin.)
  * or even if it even makes sense to override (any of) these concepts.

Another is that tracking Origin in .debs requires most probably for the
archive to drop the fields from the metaindices to avoid bloating it
with redundant information.

And as you imply with your proposed field names (?), the Origin might
not even be enough sometimes to qualify an upload, where even for Debian
you need to use different queues and hosts for different repos. Although
I think that might perhaps be no such issue as the queues should be
mappable from the suite names? (I'm thinking about dupload here for
example.)


(For ref, I was also recently exposed to
https://wiki.debian.org/DebVendorVariable which is also somehow related
to all this.)

(I might also be missing stuff, I'll try to better collect my thoughts
tomorrow.)


Thanks,
Guillem
Bug#1155323: dpkg-dev: .changes file format has no way to indicate the target archive/repository
#24
Author: Guillem Jover
Date: Fri, 27 Nov 2026 14:40
26 lines
3274 bytes
Hi!

On Thu, 2026-11-26 at 05:49:20 +0100, Guillem Jover wrote:
> And as you imply with your proposed field names (?), the Origin might
> not even be enough sometimes to qualify an upload, where even for Debian
> you need to use different queues and hosts for different repos. Although
> I think that might perhaps be no such issue as the queues should be
> mappable from the suite names? (I'm thinking about dupload here for
> example.)

Ah! Sorry, right, for something like Ubuntu's PPAs or debusine I see how
something like an Archive/Repository field might make sense (in addition
to something like Origin), to be able to specify which specific (overlay?)
repository to use for this specific upload.

I'm not sure how it would be best specified though, because it does not
necessarily seem directly related to the current build, as in the same
build might be targeting such queue, but also, say, the main Origin
queue? And requiring a rebuild seems a bit meh. So it feels more like
something for the uploading tool perhaps, but that would need to inject
the field, and then resign .changes (or create a new one for this specific
upload? So the original one can be used for the Origin queue f.ex.), which
I don't think is a common operation among uploading tools right now?

Thanks,
Guillem
Bug#1155323: dpkg-dev: .changes file format has no way to indicate the target archive/repository
#25
Author: Ian Jackson
Date: Mon, 30 Nov 2026 15:30
95 lines
6333 bytes
Guillem Jover writes ("Re: Bug#1155323: dpkg-dev: .changes file format has no way to indicate the target archive/repository"):
> I think one of my biggest mental blocks for pushing this further has been
> that it's not clear to me whether there should be a distinction between:

I think you're talking mostly about where this information should come
from, during the upload workflow.  I see two reasonable possibilities.

1. From the d/changelog.

If one takes a source package from one archive and intends to upload
it to another, possibly with modifications, the user/uploader is going
to be editing the changelog anyway.  We should not expect them to
alter metadata in d/control or elsewhere.

IDK precisely what the representation should be there.  There are a
lot of editors and things that read/write changelogs, which will need
to be considered.

2. At the point of signing

So, for example, signchanges could insert it.  After all, signchanges
is the point at which the user is declaring that the thing *should* be
uploaded and presumably at that point they know *where* as well.
signchanges could take a "target archive" parameter, and have a
configurable default (including a config for "must be specified every
time").

There are psome other tools that aren't just signchanges that sign
changes files.  In the dgit ecosystem, that includes dgit and the
tag2upload service.  dgit already needs to know where it's uploading,
and tag2upload gets the information from the tag made by git-debpush.

There is precedent for signing deb822 files  to involve minor
changes.  signchanges edits the .dsc's hashes into the .changes.
dgit push-built inserts the Dgit: header.


I think these two options are not necessarily mututally exclusive.

Probably this should be discussed on d-policy where a wider set of
people can help.


But, in the meantime, it would at least be possible to define an
optional target archive field in .changes.  That would at least make
it possible for tools that generate or manipulate .changes to make
them unambiguous.

I think that's a good first step, even if we don't understand, for
every tool that generates a signed .changes, how it would know what to
put in that field - after all, it could just leave it out, leaving us
with the status quo.


I suggest:

 * "Target:" or "Archive:"
 * "debian" means the collection of official archives run by the
   Debian Project.  (Ie, the suite namespace managed by Debian.)
   So "trixie-security" is in "debian".
 * If the field is absent, it is not checked.  Debian's
   systems will accept the upload if the field is absent.
 * If the field is present, it must match the archive by which
   the .changes is being processed.
 * At some point in the future, we intend to make the field
   mandatory.  This can be done by each target archive as and
   when they think their uploaders have software that will generate
   it.

This change would involve coordination with the archive team
and should probably be disucssed on -policy.


> I've been recently planning on retrying a .changes format bump, to
> deprecate old stuff and change semantics for fields with confusing or
> odd names (such as Suite instead of Distribution). So I've now rebased
> and updated a bit the next/changes-format-2.0 branch in the
> https://git.hadrons.org/cgit/debian/dpkg.git repo.

On terminology, in dgit we had to choose a consistent set.  I mostly
followed the dak nomenclature, in particular for "suite" which didn't
otherwise have a good name.  ("Distribution" is IMO rather wrong for
that.  "Debian" is a distribution; "trixie" is not; and
"trixie-updates" certainly isn't.)

Debian has historically had poor terminological consistency.  This is
another area where involving d-policy might be a good idea.

Ian.

-- 
Ian Jackson <ijackson@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads