Hi Bill,

Quoting Bill Blough (2019-08-15 03:43:51)
> I've had a chance to do some more exploration.
> 
> Lintian is indeed getting run with a different .changes file than what
> is output to screen/disk.
> 
> The package build creates a changes file in the temporary <BUILDDIR>
> that contains a Distribution of UNRELEASED.  This happens even if the
> distribution is specified with -d.
> 
> The .changes file later gets written to BUILD_DIR, with the Distribution
> field set to what was specified by -d.
> 
> However, lintian is run against the original (Dist: UNRELEASED) .changes
> file left in <BUILDDIR>, not the modified version written in BUILD_DIR.
> 
> It seems to me that lintian should be run against the modified .changes
> file that is provided to the user after the build, rather than the
> leftover one in <BUILDDIR> that is different.

I agree. The lintian checks done by sbuild should be carried out on the same
artifacts as they are created by sbuild outside of the chroot.

> Also, after the new .changes file is written, there's an attempt to delete
> the old one in <BUILDDIR>, but it seems to fail silently.  So I assume this
> is a bug, rather than an intentional choice. (Also, the variables in question
> are very similarly named, so I think it would be an easy mistake to make).

I assume you are referring to this unlink call?

https://sources.debian.org/src/sbuild/0.78.1-2/lib/Sbuild/Build.pm/#L2620

> I've attached a small patch that makes it use the modified .changes file
> instead of the unmodified one.  On my system, this makes it behave as I would
> expect.  That is, lintian run via sbuild behaves the same way as lintian run
> manually, since they're now using the exact same .changes file.

that your patch works for you is coincidental. By using
$self->get_conf('BUILD_DIR') instead of $self->get('Build Dir') you will end up
using the output directory of the build artifacts *outside* the chroot. See the
documentation for the BUILD_DIR config option in sbuild.conf(5). That it works
for you might mean that you have set up your chroots in a way such that lintian
inside the chroot has access to the path outside of it. Maybe you are building
in /tmp and have that mounted inside as well, for example?

If you would like to prepare a patch that fixes this issue, then what should
actually happen is probably that the "copy_changes()" subroutine modifies the
.changes files inplace inside the chroot so that when Lintian is called later,
it sees the same files as the ones that get copied to the outside by
"copy_changes()".

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to