[buildd-tools-devel] Bug#626361: Bug#626361: Bug#626361: run lintian and piuparts from within the chroot

Reinhard Tartler siretart at tauware.de
Fri Jan 6 20:23:18 UTC 2012


tags 626361 patch
stop

On Mi, Mai 11, 2011 at 15:56:42 (CEST), Roger Leigh wrote:

> On Wed, May 11, 2011 at 12:31:24PM +0200, Reinhard Tartler wrote:
>> On Wed, May 11, 2011 at 12:23:43 (CEST), Roger Leigh wrote:
>> 
>> > On Wed, May 11, 2011 at 11:46:56AM +0200, Reinhard Tartler wrote:
>> >> Thanks for implementing the --run-lintian and --run-piuparts hooks in
>> >> sbuild. I noticed that both swtiches try to use the system utilities. I
>> >> think it would be far more useful if they would install the packages in
>> >> the chroot and use them right inside the chroot. Imagine the case that
>> >> you have several chroots (oldstable, unstable, testing, lucid, natty,
>> >> etc), where using the system lintian from debian/stable might not give
>> >> the best results.  In case you used the tool versions from the chroot,
>> >> always the matching version of these QA are used and you get better
>> >> reports.
>> >
>> > This shouldn't be a problem--it's just a matter of adding them
>> > to the dependency list and running them after the build.
>> 
>> Well, with this approach, the package wouldn't be built in a "clean"
>> chroot any longer but in a chroot with a couple of extra packages. The
>> dependency list of lintian and piuparts are both quite large.
>
> We can always just install them on demand, after the build has
> completed.  This avoids any issues when them being present during
> the build (though the admin would be free to install them manually
> so they would be present all the time, if they wished).
>
>> I'm not aware of any packages that expose problems with that, but it
>> might be better to have the builds behave the same regardless if
>> lintian/piuparts is installed/used or not.
>
> Agreed.

Please review the following patch. It seems to me much more sensible to
run lintian in the chroot than running lintian on the host for the
mentioned reasons above. For the sake of simplicity and to avoid
confusion on the user side, I've decided against making the choice
between "use host lintian" or "install lintian in the chroot"
configurable. With this, the patch turned out to be quite short:

=== modified file 'lib/Sbuild/Build.pm'
--- lib/Sbuild/Build.pm	2011-08-18 09:22:10 +0000
+++ lib/Sbuild/Build.pm	2012-01-06 20:22:17 +0000
@@ -1127,12 +1127,17 @@
 
     $self->log_subsubsection("lintian");
 
+    my $resolver = $self->get('Dependency Resolver');
     my $lintian = $self->get_conf('LINTIAN');
     my @lintian_command = ($lintian);
     push @lintian_command, @{$self->get_conf('LINTIAN_OPTIONS')} if
         ($self->get_conf('LINTIAN_OPTIONS'));
     push @lintian_command, $self->get('Changes File');
-    $self->get('Host')->run_command(
+
+    $resolver->add_dependencies('LINTIAN', 'lintian');
+    return 1 unless $resolver->install_deps('lintian', 'LINTIAN');
+
+    $self->get('Session')->run_command(
         { COMMAND => \@lintian_command,
           PRIORITY => 0,

>> Thinking a bit more of that, at least for session chroots it might make
>> sense to change piuparts to not test in an extra testing-chroot, but
>> directly in sbuild's build-chroot. But probably only for session managed
>> chroots.
>
> This should also be possible.

Probably its best to just run puiparts from the host. AFAIUI, it will
anyways always create a new, clean chroots for package testing.

Cheers,
Reinhard

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4





More information about the Buildd-tools-devel mailing list