#997805 gbp buildpackage: wrongly thinks sbuild -A option means changes file will always be called "_all.changes" which breaks lintian

#997805#5
Date:
2021-10-24 20:48:04 UTC
From:
To:
I ran the following command:

gbp buildpackage --git-builder=sbuild -A -v -d unstable

and received the following error in the postbuild hook, which runs
lintian:

gbp:info: Running Postbuild hook
/home/jdg/debian/spyder-packages/pyxdameraulevenshtein/build-area/pyxdameraulevenshtein_1.7.0-1_all.changes is not a readable file
gbp:error: Postbuild-hook 'lintian $GBP_CHANGES_FILE' failed: it exited with 2

The changes file in this case is called ..._amd64.changes.

Running the build with --verbose resulted in the attached log file.

It seems that for sbuild, "-A" does not stop the Architecture: any
packages from being built, which is different from the "-A" option for
dpkg-buildpackage.

Best wishes,

   Julian

#997805#10
Date:
2022-05-26 18:52:03 UTC
From:
To:
Hi Julian,

So would we rather check for `--no-arch-any` in the sbuild case?
changes_file_suffix() would allow for that but I'd be great if an
sbuild user would come up with a patch so I don't mess up any corner
cases.
Worst case we'd just ignore `-A` with sbuild for the moment.

Cheers,
 -- Guido

#997805#15
Date:
2022-05-29 08:29:05 UTC
From:
To:
Hi Guido,

I've just been looking at sbuild's documentation, and it decides how
to call dpkg-buildpackage (which itself determines the name of the
.changes file) using a mixture of commandline arguments, configuration
files and environment variables.  So it seems too much to try to work
out what the changes file will be called.

One possible option might be to try these in turn:

<pkg>_<version>_<arch>.changes
<pkg>_<version>_all.changes
<pkg>_<version>_source.changes

and check whether they exist and their timestamp is reasonable (say:
between the start of the sbuild call and the current time) before
using it.

Best wishes,

   Julian