deb,build: export ddebs from binary builds
CI / build (push) Failing after 54s
CI / test (push) Skipped
CI / snap (push) Skipped
CI / publish (push) Skipped

dh_strip registers debug-symbol packages in debian/files under their
renamed .ddeb name; they are deliverables of the build just like the
regular .debs. Both artifact-type filters, the one collecting the
build's artifacts and the one feeding the .buildinfo/.changes
checksum sections, accepted only deb and udeb, so every ddeb a build
produced was silently discarded: nothing exported next to the .debs,
nothing in the upload metadata.

The filter is now a shared FilesEntry::is_binary_artifact() predicate
(plus unit tests) used by both call sites, so the two cannot drift
apart again.

One dpkg distinction has to be copied rather than shared:
dpkg-genchanges lists only deb/udeb packages in the changes' Binary:
and Description (a ddeb travels in Files and the checksum sections
but is not a listed binary of the upload), while dpkg-genbuildinfo
lists every binary artifact's package, ddebs included. The package
list is therefore accumulated twice, once per consumer.

The binary-metadata differential fixture gains a Package-Type: ddeb
package, so the native .changes/.buildinfo generation is compared
against real dpkg with a ddeb present. Without the fix the comparison
fails on the checksum sections (golden distributes the ddeb, ours
dropped it); with it every field matches.
This commit is contained in:
2026-09-30 14:18:45 +02:00
parent 72992f6ec8
commit ed76b3ef7f
4 changed files with 55 additions and 10 deletions
+18 -6
View File
@@ -92,7 +92,7 @@ pub fn generate_binary_metadata(
// ------------------------------------------------------------------
let artifact_names: Vec<String> = files_list
.iter()
.filter(|e| matches!(e.package_type.as_deref(), Some("deb") | Some("udeb")))
.filter(|e| e.is_binary_artifact())
.map(|e| e.filename.clone())
.collect();
@@ -159,16 +159,28 @@ pub fn generate_binary_metadata(
// ------------------------------------------------------------------
// Binary package names and descriptions
// ------------------------------------------------------------------
// dpkg-genchanges lists only deb/udeb packages in `Binary:` (a ddeb
// is distributed through Files but is not a listed binary of the
// upload), while dpkg-genbuildinfo lists every binary artifact's
// package, ddebs included.
let mut binaries: Vec<String> = Vec::new();
let mut buildinfo_binaries: Vec<String> = Vec::new();
for name in &artifact_names {
if let Some(e) = files_list.get(name)
&& let Some(pkg) = &e.package
&& !binaries.contains(pkg)
{
let Some(e) = files_list.get(name) else {
continue;
};
let Some(pkg) = &e.package else {
continue;
};
if !buildinfo_binaries.contains(pkg) {
buildinfo_binaries.push(pkg.clone());
}
if e.package_type.as_deref() != Some("ddeb") && !binaries.contains(pkg) {
binaries.push(pkg.clone());
}
}
binaries.sort();
buildinfo_binaries.sort();
// Description lines: first line of each binary stanza's Description,
// formatted exactly like dpkg-genchanges, sorted.
@@ -238,7 +250,7 @@ pub fn generate_binary_metadata(
let buildinfo_doc =
crate::build::buildinfo::render_buildinfo(&crate::build::buildinfo::BuildInfoInput {
source: source_display.clone(),
binaries: binaries.clone(),
binaries: buildinfo_binaries.clone(),
architecture: buildinfo_arch_values.join(" "),
version: entry.version.full(),
binary_only_changes: binary_only_changes.clone(),