Hi,

Quoting Carles Pina i Estany (2022-04-19 13:39:23)
> sbuild does not download packages unless libwww-perl is installed.
> 
> To reproduce:
> 
> $ docker run -it debian:bullseye /bin/bash # just to have a clean system
> # apt-get update && apt-get -y install sbuild # same final result as using 
> "apt install sbuild"
> # sbuild --no-clean --arch-any --arch-all --no-source --dist=stable 
> --arch=amd64  http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc
> E: Failed to open build log 
> //http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc_amd64-2022-04-19T10:20:26Z.build:
>  No such file or directory
> E: Error creating chroot
> 
> I expected the .dsc file to be downloaded.
> 
> After installing libwww-perl sbuild works as expected:
> 
> # apt-get -y install libwww-perl
> 
> # sbuild --no-clean --arch-any --arch-all --no-source --dist=stable 
> --arch=amd64  http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc 
> # it downloads the package as expected
> 
> 
> Not a Perl programmer here but I followed the code:
> 
> /usr/bin/sbuild around line 103 does "check_url($jobname)" which is 
> implemented in /usr/share/perl5/Sbuild/Utility.pm around line 166. It does:
> 
>     # Load LWP::UserAgent if possible, else return 0.
>     if (! can_load( modules => { 'LWP::UserAgent' => undef, } )) {
>         return 0;
>     }
> 
> Without libwww-perl package installed it returns 0. Then sbuild assumes that
> http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc is a
> local file.
> 
> I don't know if the way to go is to make the error message more helpful
> (suggesting to install the package?), or make libwww-perl a dependency
> (or at least recommended). Or perhaps add a note in the manual? It
> currently says "For .dsc files  in  remote locations,  the source
> packages are downloaded first, then built." without noting that
> libwww-perl is required for this.

wow, I didn't even know sbuild could do this!

I don't think it'd be wise to promote libwww-perl from a Suggests to a
Recommends because this far from an essential sbuild functionality and I only
see it as a convenience feature. And even as that I never needed it. For
example you run:

    sbuild --no-clean --arch-any --arch-all --no-source --dist=stable 
--arch=amd64  http://deb.debian.org/debian/pool/main/h/hello/hello_2.10-2.dsc

But you can achieve the same thing by running:

    sbuild --no-clean --arch-any --arch-all --no-source --dist=stable 
--arch=amd64 hello_2.10-2

I've now added a warning if libwww-perl is missing:

https://salsa.debian.org/debian/sbuild/-/commit/c510b2f54e0a743d7ba06a630e65d20d8f95118c

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to