MergeUploads fails if source upload contains binary buildinfo
Some of the debian_pipeline workflows on debusine.freexian.com are configured with:
upload_include_binaries: true
upload_merge_uploads: true
During an attempted upload of openssh to ELTS, we found that this failed with errors such as this:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/debusine/tasks/_task.py", line 859, in _execute
execution_succeeded = self.run(execute_directory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/debusine/tasks/mergeuploads.py", line 263, in run
merged = self.merge_changes(all_changes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/debusine/tasks/mergeuploads.py", line 224, in merge_changes
self._check_checksums(all_changes)
File "/usr/lib/python3/dist-packages/debusine/tasks/mergeuploads.py", line 199, in _check_checksums
raise MergeUploadsError(
debusine.tasks.mergeuploads.MergeUploadsError: Entries in Files for openssh_7.9p1-10+deb10u6_amd64.buildinfo do not match: {'md5sum': 'f641314731c51a022ee8c82ffde85a85', 'size': '17578', 'section': 'net', 'priority': 'standard', 'name': 'openssh_7.9p1-10+deb10u6_amd64.buildinfo'} != {'md5sum': 'e0fdd52d1a553cada6cb375c6e56c1e2', 'size': '17852', 'section': 'net', 'priority': 'standard', 'name': 'openssh_7.9p1-10+deb10u6_amd64.buildinfo'}
This is because both the source artifact (https://debusine.freexian.com/freexian/elts/artifact/114150/ in this case) and one of the built binary artifacts (https://debusine.freexian.com/freexian/elts/artifact/114454/) contain openssh_7.9p1-10+deb10u6_amd64.buildinfo. Apparently this is because the upload was built with gbp buildpackage --git-builder='sbuild -d buster-security --no-run-lintian' --source-only-changes --git-debian-branch=debian/buster, which builds the package and then throws away the binaries; however, it apparently keeps the binary buildinfo, causing this conflict.
A workaround is to use a simpler mechanism to build the source upload, such as gbp buildpackage --git-debian-branch=debian/buster -S -d, or even just debuild -S -nc. (IMO there isn't much point in using gbp buildpackage to build source packages unless one is using something exotic like a split debian/ branch.)
Perhaps we could just skip binary buildinfo files in source uploads to avoid this problem.