Re: Re: trouble with sbuild

2021-04-14 Thread Patrice Duroux


I should have stacked the changelog to reads: wiki, manpages, README!
Now I will think about a wish report to sbuild package.
Thanks



Re: trouble with sbuild

2021-04-13 Thread Alexandre Rossi
Hi,

> $ sbuild-createchroot --chroot-mode=unshare --make-sbuild-tarball ~/.cache/
> sbuild/unstable-amd64.tar.gz unstable $(mktemp -d)
> https://deb.debian.org/debian/
> [...] 
> If I understand well, it is a Perl script that tries to execute some
> 'newuidmap' command that is part of the uidmap package and is not currently
> installed, neither present in the sbuild depends.
> I am trying to follow /u/s/d/sbuild/README.Debian that does not mention
> anything on this.
> What did I miss?

In the source upstream changelog:

   * Major changes in 0.77.0:

   1) core: New chroot mode "unshare" which allows unprivileged package builds
  by using Linux user namespaces. Only requires lightweight newuidmap and
  newgidmap suid binaries. Chroots can be created and updated without
  needing sudo and are stored in ~/.cache/sbuild or an arbitrary absolute
  path given via the --chroot option.

Installing the uidmap should fix your problem.

Maybe sbuild should recommend uidmap.

Alex



trouble with sbuild

2021-04-12 Thread Patrice Duroux
Hi,

I am trying to quit pbuilder/cowbuilder to work on packaging and so use
sbuild directly. Currently it is the version 0.81.2 on a Sid system. So
after looking at sbuild-createchroot(8) manpage, I used the command:

$ sbuild-createchroot --chroot-mode=unshare --make-sbuild-tarball ~/.cache/
sbuild/unstable-amd64.tar.gz unstable $(mktemp -d)
https://deb.debian.org/debian/

But I got the following error message:

I: SUITE: unstable
I: TARGET: /tmp/tmp.sKNyIB4DeD
I: MIRROR: https://deb.debian.org/debian/
I: Running debootstrap --arch=amd64 --variant=buildd --verbose
--include=fakeroot,build-essential --components=main --resolve-deps
--no-merged-usr unstable /tmp/tmp.sKNyIB4DeD https://deb.debian.org/debian/
newuidmap failed: No such file or directory at -e line 1.
child had a non-zero exit status: 512 at -e line 1.
newuidmap failed: No such file or directory at -e line 1.
child had a non-zero exit status: 512 at -e line 1.
E: Error running env PATH=/usr/sbin:/usr/bin:/sbin:/bin perl -e require '
syscall.ph';pipe my $rfh, my $wfh;my $ppid = $$;my $cpid = fork() // die
"fork() failed: $!";if ($cpid == 0) {close $wfh;0 == sysread $rfh, my $c, 1
or die "read() did not receive EOF";0 == system "newuidmap $ppid  0 10
65536" or die "newuidmap failed: $!";0 == system "newgidmap $ppid  0 10
65536" or die "newgidmap failed: $!";exit 0;}0 == syscall _unshare,
1006764032 or die "unshare() failed: $!";close $wfh;$cpid == waitpid $cpid,
0 or die "waitpid() failed: $!";if ($? != 0) {die "child had a non-zero
exit status: $?";}0 == syscall _setgid, 0 or die "setgid failed: $!";0
== syscall _setuid, 0 or die "setuid failed: $!";0 == syscall
_setgroups, 0, 0 or die "setgroups failed: $!";my $cpid = fork() // die
"fork() failed: $!";if ($cpid != 0) {$cpid == waitpid $cpid, 0 or die
"waitpid() failed: $!";exit ($? >> 8);}exec { $ARGV[0] } @ARGV or die
"exec() failed: $!"; sh -c
   rootdir="$1"; shift;
   hostname sbuild;
   mkdir -p "$rootdir/dev";
   for f in null zero full random urandom tty; do
touch "$rootdir/dev/$f";
chmod -rwx "$rootdir/dev/$f";
mount -o bind "/dev/$f" "$rootdir/dev/$f";
   done;
   mkdir -p "$rootdir/sys";
   mount -o rbind /sys "$rootdir/sys";
   mkdir -p "$rootdir/proc";
   mount -t proc proc "$rootdir/proc";
   mkdir -p "$rootdir/fakebin";
   ln -sf /bin/true "$rootdir/fakebin/mknod";
   ln -sf /bin/true "$rootdir/fakebin/mount";
   export PATH="$rootdir/fakebin:/fakebin:$PATH"
   "$@";
   exit_status=$?;
   rm "$rootdir/fakebin/mknod" "$rootdir/fakebin/mount";
   rm -d "$rootdir/fakebin";
   exit $exit_status;
-- /tmp/tmp.sKNyIB4DeD debootstrap --arch=amd64 --variant=buildd
--verbose --include=fakeroot,build-essential --components=main
--resolve-deps --no-merged-usr unstable /tmp/tmp.sKNyIB4DeD
https://deb.debian.org/debian/ at /usr/bin/sbuild-createchroot line 433.

If I understand well, it is a Perl script that tries to execute some
'newuidmap' command that is part of the uidmap package and is not currently
installed, neither present in the sbuild depends.
I am trying to follow /u/s/d/sbuild/README.Debian that does not mention
anything on this.
What did I miss?

Thanks