sbuild chroot manager for unshare backend users -----------------------------------------------
After installing sbuild 0.87.0 or later from unstable, you can now build
packages without any additional setup. With an empty ~/.sbuildrc and
with no chroot tarballs in ~/.cache/sbuild, just run this to build the
"hello" source package:
sbuild --chroot-mode=unshare --dist=unstable hello
To keep the dynamically created chroot tarball for subsequent builds, you
can make this configuration permanent by putting this into your
~/.sbuildrc:
$chroot_mode = 'unshare';
$unshare_mmdebstrap_keep_tarball = 1;
Whenever a chroot tarball doesn't exist yet, or whenever an existing
tarball is too old, sbuild will take care of creating one for you
automatically. If you want to customize the contents of the tarballs
sbuild creates, read the documentation of UNSHARE_MMDEBSTRAP_EXTRA_ARGS
in sbuild.conf(5).
The new chroot management functionality is marked as experimental and any
feedback is very much appreciated.
-- Johannes Schauer Marin Rodrigues
This is interesting. One concern I have is speed -- isn't it always slower to have to unpack a tarball before the build instead of having a chroot under /srv/chroot that's always unpacked?
This is interesting. One concern I have is speed -- isn't it alwaysPeople who feel this is a problem can try my super fast fork of pbuilder
slower to have to unpack a tarball before the build instead of having a chroot under /srv/chroot that's always unpacked?
Hi,
Quoting Sean Whitton (2024-11-24 01:23:24)
This is interesting. One concern I have is speed -- isn't it always slower >> to have to unpack a tarball before the build instead of having a chroot under
/srv/chroot that's always unpacked?
that is correct. Unpacking a tarball takes time. Having an already unpacked directory present will be faster. Lets look at how slow unpacking a buildd chroot tarball is in practice. My machine is an ARM Cortex A73 with 3.6 GB RAM.
$ time sudo tar -C chroot -xf ~/.cache/sbuild/unstable-arm64.tar
sudo tar -C chroot -xf ~/.cache/sbuild/unstable-arm64.tar 0.01s user 0.02s system 2% cpu 0.983 total
This number will of course be different on your system. If your system is slower than mine or if your chroot tarballs contain a lot more pre-built packages, then unpack times will be longer than this.
In principle, unshare mode can also work with directories. Helmut is working on something in that direction. But for me personally, one second of unpack time is not enough of a motivation for me to put time into directory+overlayfs
support. But of course patches welcome!
This is interesting. One concern I have is speed -- isn't it always
slower to have to unpack a tarball before the build instead of having a chroot under /srv/chroot that's always unpacked?
workingIn principle, unshare mode can also work with directories. Helmut is
unpackon something in that direction. But for me personally, one second of
time is not enough of a motivation for me to put time into directory+overlayfs support. But of course patches welcome!
Yes, one second is not that bad at all. It takes longer than that on
the porterboxes, and that is my most recent experience, so I was
thinking of that. Thanks for the timings.
I haven’t had time to do any analysis myself, but there is some information posted on https://wiki.debian.org/sbuild:
You can use choose the compression algorithm for the tarball by specifying the extension (.tar.xz, .tar.gz or plain .tar, etc). As of May 2024, ZST seemsto provide the best size/time ratio. It certainly is the fastest on a Dell Precision 3800M, 16GB RAM, on an SSD drive (a computer from early 2015):
Format Tarball size Time
.xz ~100MB 179,60s user 7,09s system 75% cpu 4:07,49 total
.gz ~150MB 38,51s user 6,13s system 83% cpu 53,423 total
.zst ~139MB 22,68s user 6,28s system 74% cpu 38,868 total
athe extension (.tar.xz, .tar.gz or plain .tar, etc). As of May 2024, ZST seems to provide the best size/time ratio. It certainly is the fastest on
Dell>
Precision 3800M, 16GB RAM, on an SSD drive (a computer from early 2015): >Format Tarball size Time
.xz ~100MB 179,60s user 7,09s system 75% cpu 4:07,49 total
.gz ~150MB 38,51s user 6,13s system 83% cpu 53,423 total
.zst ~139MB 22,68s user 6,28s system 74% cpu 38,868 total
IIRC these times are for tarball creation (incl. downloading and
apt). Unpacking is AFAICT a lot faster in many cases. Locally it
feels like <1s.
On Sun 24 Nov 2024 at 07:53am +01, Johannes Schauer Marin Rodrigues wrote:slower
Hi,
Quoting Sean Whitton (2024-11-24 01:23:24)
This is interesting. One concern I have is speed -- isn't it always
unpackedto have to unpack a tarball before the build instead of having a chroot
under
/srv/chroot that's always unpacked?
that is correct. Unpacking a tarball takes time. Having an already
0.02sdirectory present will be faster. Lets look at how slow unpacking a buildd chroot tarball is in practice. My machine is an ARM Cortex A73 with 3.6 GB RAM.
$ time sudo tar -C chroot -xf ~/.cache/sbuild/unstable-arm64.tar
sudo tar -C chroot -xf ~/.cache/sbuild/unstable-arm64.tar 0.01s user
workingsystem 2% cpu 0.983 total
This number will of course be different on your system. If your system is slower than mine or if your chroot tarballs contain a lot more pre-built packages, then unpack times will be longer than this.
In principle, unshare mode can also work with directories. Helmut is
unpackon something in that direction. But for me personally, one second of
time is not enough of a motivation for me to put time into directory+overlayfs support. But of course patches welcome!
Yes, one second is not that bad at all. It takes longer than that on
the porterboxes, and that is my most recent experience, so I was
thinking of that. Thanks for the timings.
You can use choose the compression algorithm for the tarball by specifying the extension (.tar.xz, .tar.gz or plain .tar, etc). As of May 2024, ZST seems to provide the best size/time ratio. It certainly is the fastest on a Dell Precision 3800M, 16GB RAM, on an SSD drive (a computer from early 2015):
Format Tarball size Time
.xz ~100MB 179,60s user 7,09s system 75% cpu 4:07,49 total
.gz ~150MB 38,51s user 6,13s system 83% cpu 53,423 total
.zst ~139MB 22,68s user 6,28s system 74% cpu 38,868 total
On Saturday, November 23, 2024 2:20:45 PM MST Philipp Kern wrote:/
The news are collected on https://wiki.debian.org/DeveloperNews
Please contribute short news about your work/plans/subproject.
In this issue:
+ Debian buildds are using sbuild with unshare now
+ sbuild chroot manager for unshare backend users
+ Building packages with make --shuffle
+ debian.org: Support for Security Key-backed SSH keys
Debian buildds are using sbuild with unshare now ------------------------------------------------
The wanna-build team switched all buildds to the sbuild unshare backend
for trixie/sid/experimental plus *-backports. This means that official
Debian builds now run as non-root user and rely on user namespaces
instead of schroot. In addition this blocks any network access during
the build as per Debian policy 4.9.
Prior to the switch Santiago Vila did test rebuilds of all packages and
bugs have been filed:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=unshare;users=debian-wb-t
ea
m@lists.debian.org
Help is welcome to fix the remaining bugs.
We recommend all developers to use sbuild with unshare as well.
Notes on how to set it up as well as hints for custom usage are collected
on the Wiki:
https://wiki.debian.org/sbuild
I am not able to get the example unshare .sbuildrc to work with piuparts.
0m0.0s DEBUG: Unpacking /home/soren/.cache/sbuild/unstable-amd64.tar.xz into
tmp/tmplbhnn26l
0m0.0s DEBUG: Starting command: ['tar', '-C', '/tmp/tmplbhnn26l', '--auto- compress', '-xf', '/home/soren/.cache/sbuild/unstable-amd64.tar.xz']
0m0.5s DUMP:
tar: ./dev/console: Cannot mknod: Operation not permitted
tar: ./dev/full: Cannot mknod: Operation not permitted
tar: ./dev/null: Cannot mknod: Operation not permitted
tar: ./dev/ptmx: Cannot mknod: Operation not permitted
tar: ./dev/random: Cannot mknod: Operation not permitted
tar: ./dev/tty: Cannot mknod: Operation not permitted
tar: ./dev/urandom: Cannot mknod: Operation not permitted
tar: ./dev/zero: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
Does anyone have any pointers as to the root of the problem?
The news are collected on https://wiki.debian.org/DeveloperNews
Please contribute short news about your work/plans/subproject.
In this issue:
+ Debian buildds are using sbuild with unshare now
+ sbuild chroot manager for unshare backend users
+ Building packages with make --shuffle
+ debian.org: Support for Security Key-backed SSH keys
Debian buildds are using sbuild with unshare now ------------------------------------------------
The wanna-build team switched all buildds to the sbuild unshare backend
for trixie/sid/experimental plus *-backports. This means that official
Debian builds now run as non-root user and rely on user namespaces
instead of schroot. In addition this blocks any network access during
the build as per Debian policy 4.9.
Prior to the switch Santiago Vila did test rebuilds of all packages and
bugs have been filed:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=unshare;users=debian-wb-tea
m@lists.debian.org
Help is welcome to fix the remaining bugs.
We recommend all developers to use sbuild with unshare as well.
Notes on how to set it up as well as hints for custom usage are collected
on the Wiki:
https://wiki.debian.org/sbuild
I suppose I should note that I have made a few modifications to the example file because it wasn’t behaving as expected. Specifically, I disabled the mmdebstgrap auto create because otherwise it was ignoring the tarball I had created in the previous steps (including the apt-cacher-ng setting) and creating a new tarball pulling straight from the internet at each build, at each run of lintian, and at each run of piuparts.
I also had to specify the distribution or things didn’t work when building against a changelog that targeting UNRELEASED.
Piuparts is fine if I let it generate its own tarball on each run. But it doesn’t like using the tarball previously created.
# Specify the distribution, -d
$distribution = 'unstable';
I am not able to get the example unshare .sbuildrc to work with piuparts.
0m0.0s DEBUG: Unpacking /home/soren/.cache/sbuild/unstable-amd64.tar.xz into / >tmp/tmplbhnn26l
0m0.0s DEBUG: Starting command: ['tar', '-C', '/tmp/tmplbhnn26l', '--auto- >compress', '-xf', '/home/soren/.cache/sbuild/unstable-amd64.tar.xz']
0m0.5s DUMP:
tar: ./dev/console: Cannot mknod: Operation not permitted
tar: ./dev/full: Cannot mknod: Operation not permitted
tar: ./dev/null: Cannot mknod: Operation not permitted
tar: ./dev/ptmx: Cannot mknod: Operation not permitted
tar: ./dev/random: Cannot mknod: Operation not permitted
tar: ./dev/tty: Cannot mknod: Operation not permitted
tar: ./dev/urandom: Cannot mknod: Operation not permitted
tar: ./dev/zero: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
Does anyone have any pointers as to the root of the problem?
On Tuesday, November 26, 2024 3:17:45 AM MST Jochen Sprickerhof wrote:auto-
Hi Soren,
* Soren Stoutner <soren@debian.org> [2024-11-25 16:57]:
I am not able to get the example unshare .sbuildrc to work with piuparts.
0m0.0s DEBUG: Unpacking /home/soren/.cache/sbuild/unstable-amd64.tar.xz
into
/ tmp/tmplbhnn26l
0m0.0s DEBUG: Starting command: ['tar', '-C', '/tmp/tmplbhnn26l', '--
compress', '-xf', '/home/soren/.cache/sbuild/unstable-amd64.tar.xz']
0m0.5s DUMP:
tar: ./dev/console: Cannot mknod: Operation not permitted
tar: ./dev/full: Cannot mknod: Operation not permitted
tar: ./dev/null: Cannot mknod: Operation not permitted
tar: ./dev/ptmx: Cannot mknod: Operation not permitted
tar: ./dev/random: Cannot mknod: Operation not permitted
tar: ./dev/tty: Cannot mknod: Operation not permitted
tar: ./dev/urandom: Cannot mknod: Operation not permitted
tar: ./dev/zero: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
Does anyone have any pointers as to the root of the problem?
Which version of piuparts did you use?
How did you create the unstable-amd64.tar.xz?
Can you paste the complete piuparts command line as in the sbuild log?
I created two bug reports that I believe have the information you need:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088307
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088304
Hi Soren,into
* Soren Stoutner <soren@debian.org> [2024-11-25 16:57]:
I am not able to get the example unshare .sbuildrc to work with piuparts.
0m0.0s DEBUG: Unpacking /home/soren/.cache/sbuild/unstable-amd64.tar.xz
/ tmp/tmplbhnn26l
0m0.0s DEBUG: Starting command: ['tar', '-C', '/tmp/tmplbhnn26l', '--auto- >compress', '-xf', '/home/soren/.cache/sbuild/unstable-amd64.tar.xz']
0m0.5s DUMP:
tar: ./dev/console: Cannot mknod: Operation not permitted
tar: ./dev/full: Cannot mknod: Operation not permitted
tar: ./dev/null: Cannot mknod: Operation not permitted
tar: ./dev/ptmx: Cannot mknod: Operation not permitted
tar: ./dev/random: Cannot mknod: Operation not permitted
tar: ./dev/tty: Cannot mknod: Operation not permitted
tar: ./dev/urandom: Cannot mknod: Operation not permitted
tar: ./dev/zero: Cannot mknod: Operation not permitted
tar: Exiting with failure status due to previous errors
Does anyone have any pointers as to the root of the problem?
Which version of piuparts did you use?
How did you create the unstable-amd64.tar.xz?
Can you paste the complete piuparts command line as in the sbuild log?
# Specify the distribution, -d
$distribution = 'unstable';
Setting this will override the Distribution of the .changes file created by sbuild with "unstable", ignoring what your package has set. Are you sure you
want this?
I would like it to be able to build instead of fail when the changelog says UNRELEASED
Hi,had
Quoting Soren Stoutner (2024-11-26 01:07:06)
I suppose I should note that I have made a few modifications to the example file because it wasn’t behaving as expected. Specifically, I disabled the
mmdebstgrap auto create because otherwise it was ignoring the tarball I
atcreated in the previous steps (including the apt-cacher-ng setting) and creating a new tarball pulling straight from the internet at each build,
toeach run of lintian, and at each run of piuparts.
please report a bug about this. This should not happen. It's easier to get
the bottom of this in a bug on the BTS than on d-devel. :)
I also had to specify the distribution or things didn’t work when building
against a changelog that targeting UNRELEASED.
That should also not happen. At least it works fine for me... If you open a bug or write me a private mail we can hopefully figure out how our setups differ.
Piuparts is fine if I let it generate its own tarball on each run. But it doesn’t like using the tarball previously created.
Jochen is the sbuild+piuparts expert and probably has some input on this. :)
# Specify the distribution, -d
$distribution = 'unstable';
Setting this will override the Distribution of the .changes file created by sbuild with "unstable", ignoring what your package has set. Are you sure you want this?
On Tue, Nov 26, 2024 at 12:21:55PM -0700, Soren Stoutner wrote:says
# Specify the distribution, -d
$distribution = 'unstable';
Setting this will override the Distribution of the .changes file created by
sbuild with "unstable", ignoring what your package has set. Are you sure you
want this?
I would like it to be able to build instead of fail when the changelog
UNRELEASED
I just always pass -d to sbuild explicitly. It's not a big deal when you always pass something like 7-8 options to sbuild explicitly and building for !unstable is rare enough so editing the command is not a big deal either.
Setting this will override the Distribution of the .changes file created by sbuild with "unstable", ignoring what your package has set. Are you sure you want this?
I would like it to be able to build instead of fail when the changelog says UNRELEASED, but I would be happy to not specify the distribution if I can figure out how to make it work. Lintian produces an error when this happens, so there is no chance I would ever upload such a package, because I always produce a lintian-clean build before upload.
On Saturday, November 23, 2024 2:20:45 PM MST Philipp Kern wrote:
Debian buildds are using sbuild with unshare now ------------------------------------------------
The wanna-build team switched all buildds to the sbuild unshare backend
for trixie/sid/experimental plus *-backports. This means that official
Debian builds now run as non-root user and rely on user namespaces
instead of schroot. In addition this blocks any network access during
the build as per Debian policy 4.9.
Prior to the switch Santiago Vila did test rebuilds of all packages and
bugs have been filed:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=unshare;users=debian-wb-t
ea
m@lists.debian.org
Help is welcome to fix the remaining bugs.
We recommend all developers to use sbuild with unshare as well.
Notes on how to set it up as well as hints for custom usage are collected
on the Wiki:
https://wiki.debian.org/sbuild
I am not able to get the example unshare .sbuildrc to work with piuparts.
My use case isn't with a single package, but with a bunch of them. For >example, updating the coq package means about fifty packages in seven
stages. That means I compile all packages of one of the stages
(sometimes in parallel), move the results to a local repo, then go on
with the packages of the next stage.
Previously, I had a ~/Debian/repo with those updated packages and my
chroot mounted it as /repo, with its sources.list pointing to it.
After the move, I tried to use webfs to serve the repo as
localhost:3143, adding it as a --extra-repository='deb [trusted=yes] >http://127.0.01:3143 ./Debian/repo/' argument when I launch sbuild. In
the build log I see the sbuild accesses the repo and sees the list of >packages -- but it 404s when it comes to downloading :-(
Would it be possible to document using a local repository in the above
wiki page?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 487 |
Nodes: | 16 (0 / 16) |
Uptime: | 153:12:55 |
Calls: | 9,660 |
Calls today: | 2 |
Files: | 13,709 |
Messages: | 6,166,145 |