#1148144 dpkg-gencontrol: function to expand Built-Using/Static-Built-Using

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Simon Richter
Date:
2026-09-18 12:13:04 UTC
Severity:
normal
Tags:
#1148144#5
Date:
2026-09-17 13:52:48 UTC
From:
To:
Hi,

when building packages that have Built-Using or Static-Built-Using fields,
it is a bit cumbersome to gather the required information, and put it in
substvars.

Obviously this will need a few releases to be generally usable, but I think
it would be nice if

    Built-Using: foo, bar

was expanded to

    Built-Using: foo (=1), bar (=2)

substituting the respective Source fields from build dependencies.

If there is already a version field (e.g. with a substvar), nothing should
be done.

   Simon

#1148144#10
Date:
2026-09-18 12:11:03 UTC
From:
To:
Control: unarchive 689062
Control: reopen 689062
Control: unarchive 990073
Control: reopen 990073
Control: reassign -1 dpkg-dev
Control: forcemerge -1 990073 689062

Thanks for filing this. It had been filed in the past but those bug
reports got closed by Nicolas after uploading dh-builtusing, and I had
pending reopening them (but never got to it, or kept forgetting),
because I think something like dh-builtusing is a workaround given the
restricted list of allowed characters in substvar names, and the
verbosity implied with using substvars, those being AFAIR the main
reason I never ended up merging magic substvar support, even when I had
a prototype for it.

I think using an appropriate versioned build dependency would be enough
to start using this, right away.

I also got a change based on the patch from Nicolas for this, which I
need to further modify so that it does not call dpkg-query at all.

I'm not sure now why I didn't merge that at the time, perhaps because it
still seemed not-ideal. But given that non-versioned packages are invalid
values in the output field, I think these would be safe semantics to have,
even if we eventually get something better and/or more automatic.
(For example a way to declare static building from the depended on
package, similar to shlibs control files.)

I'll try to get to this for the upcoming release.

Thanks,
Guillem