[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sbuild & lxc problems



Hi Ross,

sbuild maintainer here. :)

Quoting Ross Gammon (2017-06-23 21:18:13)
> I mainly use pbuilder/cowbuilder to build my packages, but I would
> really like to try using the tool from pkg-ruby-extras, because I am
> told it is very good for test building reverse dependencies and also
> runs debci to test any autopkgtest testsuites. It uses sbuild.

pkg-ruby-extras? The alioth group? What is "the tool" you are referring to? If
this part of your question is ruby specific, then maybe the debian-ruby list is
a better fit?

> However, sbuild does not seem to agree with me, and I have had several
> attempts over the years to get it going but I gave up each time.

Please help by filing bugs with the problems you faced! I am aware that many
things are not well documented that but to make the software better I need to
know which things need more explanation.

> One time I thing I ran out of room on the root partition halfway through
> setting it up (my fault). Once I had fixed the space problem, I had all sorts
> of problems working out how to clear out the failed sbuild schroot (and I
> can't remember how I did it now).

That's probably a schroot problem and I share your pain - it also took me quite
a while until I understood schroot and its relationship to sbuild. ^^

> Then the next time I think it failed with some gpg archive key problem. I got
> around this by upgrading to sbuild from jessie-backports.

The problem was, that apt in unstable stopped depending on gpg but sbuild in
jessie still required gpg inside the chroot. As you figured out yourself
already, the problem got fixed by an upload to jessie-backports.

> But then it failed for some reason I can't remember. It is difficult to
> search for help when everything seems to be a wrapper for something else, and
> you can't workout where in the chain the problem is. I have been around in
> circles several times :-)

Yes, the wrapper count is indeed high in this one:

sbuild -> schroot -> dpkg-buildpackage -> debian/rules

The man pages should be enough but there is also this potentially useful wiki
page:

https://wiki.debian.org/sbuild

> Anyway, that is the background. I am hoping that with some help from mentors,
> I will get up and running this time. Here goes:
> 
> -------------------------------------
> 
> ross@DebianJessieLaptop:~/debian/pkg-ruby-extras$ git remote -v
> origin   
> https://anonscm.debian.org/cgit/pkg-ruby-extras/pkg-ruby-extras.git (fetch)
> origin   
> https://anonscm.debian.org/cgit/pkg-ruby-extras/pkg-ruby-extras.git (push)
> 
> ross@DebianJessieLaptop:~/debian/pkg-ruby-extras$ setup
> + sudo apt-get install -qy autopkgtest build-essential gem2deb git
> git-buildpackage myrepos quilt sbuild lxc debci
> <snip lots of apt action>
> + sudo mkdir -p /root/.gnupg
> + sudo sbuild-update --keygen
> Generating archive key.
> 
> Not enough random bytes available.  Please do some other work to give
> the OS a chance to collect more entropy! (Need 188 more bytes)
> .+++++
> .+++++
> gpg: /root/.gnupg/trustdb.gpg: trustdb created
> gpg: key 5F4C78AD marked as ultimately trusted

This is not needed anymore since sbuild 0.67.0

> + sudo sbuild-adduser ross
> The user `ross' is already a member of `sbuild'.

This only needs to be done once and not multiple times.

> 
> # Setup tasks for sudo users:
> 
> # BUILD
> # HOME directory in chroot, user:sbuild, 0770 perms, from
> # passwd/group copying to chroot, filtered
> # Maybe source 50sbuild, or move into common location.
> 
> Next, copy the example sbuildrc file to the home directory of each user and
> set the variables for your system:
> 
>   cp /usr/share/doc/sbuild/examples/example.sbuildrc /home/ross/.sbuildrc
> 
> Now try a build:
> 
>   cd /path/to/source
>   sbuild-update -ud <distribution>
>   (or "sbuild-apt <distribution> apt-get -f install"
>        first if the chroot is broken)
>   sbuild -d <distribution> <package>_<version>
> + dpkg --print-architecture
> + chrootname=unstable-amd64-sbuild
> + chroot=/srv/chroots/unstable-amd64-sbuild
> + grep unstable-amd64-sbuild
> + schroot --list --all-source-chroots
> + sudo sbuild-createchroot unstable /srv/chroots/unstable-amd64-sbuild
> http://httpredir.debian.org/debian
> I: SUITE: unstable
> I: TARGET: /srv/chroots/unstable-amd64-sbuild
> I: MIRROR: http://httpredir.debian.org/debian
> I: Running debootstrap --arch=amd64 --variant=buildd --verbose
> --include=fakeroot,build-essential --components=main --resolve-deps
> unstable /srv/chroots/unstable-amd64-sbuild
> http://httpredir.debian.org/debian
> I: Retrieving Release
> I: Retrieving Release.gpg
> I: Checking Release signature
> I: Valid Release signature (key id 126C0D24BD8A2942CC7DF8AC7638D0442B90D010)
> I: Retrieving Packages
> I: Validating Packages
> <snip more apt action in the chroot>
> 
> I: Base system installed successfully.
> I: Configured /usr/sbin/policy-rc.d:
>    +------------------------------------------------------------------------
>    |#!/bin/sh
>    |echo "All runlevel operations denied by policy" >&2
>    |exit 101
>    +------------------------------------------------------------------------
> I: Configured APT /etc/apt/sources.list:
>    +------------------------------------------------------------------------
>    |deb http://httpredir.debian.org/debian unstable main
>    |deb-src http://httpredir.debian.org/debian unstable main
>    +------------------------------------------------------------------------
> I: Please add any additional APT sources to
> /srv/chroots/unstable-amd64-sbuild/etc/apt/sources.list
> modprobe: FATAL: Module overlay not found.
> I: schroot chroot configuration written to
> /etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID.
>    +------------------------------------------------------------------------
>    |[unstable-amd64-sbuild]
>    |description=Debian unstable/amd64 autobuilder
>    |groups=root,sbuild
>    |root-groups=root,sbuild
>    |profile=sbuild
>    |type=directory
>    |directory=/srv/chroots/unstable-amd64-sbuild
>    |union-type=none
>    +------------------------------------------------------------------------
> I: Please rename and modify this file as required.
> W: Not creating symlink /srv/chroots/unstable-amd64-sbuild to
> /etc/sbuild/chroot/unstable-amd64-sbuild: file already exists

This is troublesome. It appears you already had a chroot set up?

> I: Setting reference package list.
> I: Updating chroot.
> Err:1 http://httpredir.debian.org/debian unstable InRelease
>   Temporary failure resolving 'httpredir.debian.org'
> Reading package lists... Done         
> W: Failed to fetch
> http://httpredir.debian.org/debian/dists/unstable/InRelease  Temporary
> failure resolving 'httpredir.debian.org'
> W: Some index files failed to download. They have been ignored, or old
> ones used instead.

Problem with the network connection?

> Reading package lists... Done Building dependency tree      Reading state
> information... Done Calculating upgrade... Done
> 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
> I: Successfully set up unstable chroot.
> I: Run "sbuild-adduser" to add new sbuild users.
> + grep -l ^union-type=
> /etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
> /etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7
> + grep -q ^union-overlay-directory=
> /etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
> + echo union-overlay-directory=/dev/shm
> + sudo tee --append /etc/schroot/chroot.d/unstable-amd64-sbuild-GlcVID
> [sudo] password for ross:
> union-overlay-directory=/dev/shm
> + grep -q /var/cache/apt/archives /etc/schroot/sbuild/fstab
> + grep -q ^lxc.network.type\s*=\s*empty /etc/lxc/default.conf
> + sudo debci setup
> E: /etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7: line 1
> [unstable-amd64-sbuild]: A chroot or alias
> ‘chroot:unstable-amd64-sbuild’ already exists with this name
> I: Duplicate names are not allowed
> E: /etc/schroot/chroot.d/unstable-amd64-sbuild-Y02TR7: line 1
> [unstable-amd64-sbuild]: A chroot or alias
> ‘chroot:unstable-amd64-sbuild’ already exists with this name
> I: Duplicate names are not allowed

Yup, this looks like the chroot you want to create already exists.

> E: chroot debci-unstable-amd64 does not exit in custom location . Please
> create it first.
> 
> ---------------------------------
> 
> I think the sbuild setup completes, although I can't update the chroot.
> If I run "# chroot /srv/chroots/unstable-amd64-sbuild apt-get update"
> then I always get "Temporary failure resolving 'httpredir.debian.org".
> Httpredir resolves fine when I "apt update" the host Jessie laptop.

That's because this chroot is mean to be used by schroot, the suid program used
by sbuild. Schroot then does some remaining setup tasks before it uses the
chroot, like setting up /etc/resolv.conf properly.

> But then "debci setup" chokes due to an existing chroot with the same name.
> But I don't understand why it is creating a sbuild chroot when it should be
> using lxc. Maybe the lxc container was only half set up before? Most of the
> options from the setup script seem to be there.
> 
> If I run "sudo lxc-start -n adt-sid-amd64" I get:
> 
> lxc-start: Executing '/sbin/init' with no configuration file may crash
> the host
> 
> If I run "sudo lxc-attach -n adt-sid-amd64 apt-get update" I get:
> 
> lxc-attach: failed to get the init pid
> 
> Maybe I have to recreate the lxc container for debci. Any clues on how I
> can do that?

Everything you did so far didn't use lxc at all. Instead, schroot was used as a
build environment.

> Sorry about the long email.

Sometimes a long email is necessary to understand the problem and then it's
better to write a long email than having to write a second email with the
missing information. :)

If I understand it correctly, then you are using this script:

https://anonscm.debian.org/cgit/pkg-ruby-extras/pkg-ruby-extras.git/tree/setup

Unfortunately, there is much to be improved about this script. If you want to
help improve it, just contact the authors of the script with your problems and
CC me. :)

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: