-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparison between debspawn and sbuild #27
Comments
Hi @josch ! To give a bit of context: When debspawn was created, the reason for doing so were a few (but not all of them existed initially):
Debspawn is one of these projects that start to scratch one partcular itch (be a well-integrated build tool for Laniakea) and then grow way beyond their initially intended scope :-)
Could it do that 4 years ago already? If so, then I must have overlooked it. I know sbuild can do these things today, and even build via QEMU, so today that statement is definitely wrong nowadays.
I don't know how user namespaces are implemented exactly in sbuild - is unshare a chroot with user namespaces on top? Systemd-nspawn creates a pretty neat lightweight container that virtualizes the file system hierarchy, process tree, IPC subsystems, the host and domain name and also has a system callback filter to filter out some potentially problematic syscalls (which actually can be an issue if packages need these for tests, so debspawn weakens that by default).
Systemd-nspawn can actually run without the need for superuser privileges if you tell it to use user namespaces - and I think debspawn should actually do that eventually. When playing with it a while back, I remember I ran into issues with it though. I can't recall what the actual problem was though which was a dealbreaker back then, which is a bit annoying (debspawn's method for dropping privileges inside of the container is also complicated, and user namespaces would have solved this). Maybe I should just try this again ;-)
I am kind of tempted to drop comparisons to other tools, as they are likely not useful and get outdated sooner or later...
Oh, this was actually a huge debate years ago! Maybe https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873919 can give some insight. Debian's default locale is "C", and therefore some stuff, especially Python code occasionally, falls flat when parsing unicode (file)names. Dpkg doesn't want to have an opinion on this. My opinion was that UTF-8 should be default (also to test things like building in a directory consisting of random emojis to see what fails - back then I was working on some QA to make sure software was handling unicode correctly).
I am not sure what past-me was thinking about there exactly, but I'm pretty sure it was Debian/kFreeBSD and Debian/Hurd. For the former, I definitely know people who use sbuild on it.
Back then I actually benchmarked this, but LZ4 would obviously beat zstd in most settings. The eatmydata stuff may be misleading, what I mean is that with sbuild you need (needed?) to configure this manually - debspawn just does it. I hope this clarifies things - I haven't read the README full in almost 4 years, and maybe with your feedback I can clean it up quite a bit :-) |
Hi Matthias, thanks a lot for your very extensive and detailed reply!
Even if it's not in the README, I think that listing what makes debspawn different/better than alternatives would be useful to have stated somewhere.
Ah, reminds me of myself when I wrote mmdebstrap 3 years ago. XD
Yes. Today, there is the
Yes, the log parsing is still an issue. There is still no machine readable way to identify reliably why a build failed without using shaky log parsing.
Agreed. Sbuild is far from being that easy to use. I should write maybe another set of wrapper scripts to make default usage as easy as using a single command.
Ah, that's where the root requirement of systemd-nspawn comes from, I guess.
Yes. While sbuild (and schroot) also supports overlayfs mounting, for my personal use I also resort to just unpacking chroot tarballs to a tmpfs as I found it to be sufficiently fast.
Understandable. I still struggle with apt-cacher-ng as it seems to somehow fill up the package cache without ever cleaning up and dropping cached packages after some time...
The autopkgtest backend was introduced in sbuild 0.69.0, released in May 2016. The unshare backend was introduced in sbuild 0.77, released in July 2018. In any case, both backends were never advertised anywhere and I haven't yet received a single bug report for those two backends, so either nobody is using those or they are bug free (very unlikely).
The ushare backend uses linux user namespaces to unshare the mount, UTS, IPC, network, PID and user namespaces. I think that's also what other container solutions like docker, lxc and systemd-nspawn do. The unshare backend cannot limit resources like CPU or RAM and it cannot limit syscalls -- all these features would require being root at some point and I wanted to avoid that. I see that it might make sense to add a systemd-nspawn backend to make these features available to sbuild users.
I haven't been able to make it work though. When I try to run Though to get features like RAM and CPU limits, root would be definitely needed. How does debspawn handle this? Does the user need to run
As the author of one of these tools, I actually find these comparisons useful.
Using C.UTF-8 has been the default in sbuild since 0.78.0 (released Jan 2019).
Ah okay, I misunderstood and was thinking of Linux as in GNU/Linux but yes, you are right, the Debian ports buildds for hurd and kfreebsd definitely run sbuild.
Thanks a lot for your time! :-) |
Hi,
sbuild maintainer here. Today I learned that debspawn exists and as I seek to reduce the list of System Build Tools I would like to find out what debspawn offers that sbuild does not.
For example the first paragraph claims that sbuild uses a plain chroot. True it can do that. But it can also use any environment supported by autopkgtest (like lxc, lxd, qemu, schroot, ssh...) as well as the unshare backend which uses linux user namespaces to do package builds. What advantage does systemd-nspawn have over that? I'm tempted to implement a systemd-nspawn backend and/or a debspawn backend into sbuild but it seems that systemd-nspawn requires super user privileges while the sbuild unshare backend does not (not for the setup, nor for image creation and neither for running the build). Maybe you can point out in the README why a user would prefer to use debspawn over the sbuild unshare backend.
You state that a difference between sbuild and debspawn is unicode handling. Could you point me to the debspawn code that implements this so that I can understand what this paragraph means? Maybe this functionality should be included into sbuild.
You also state that sbuild works on OSes that are not Linux. I'd be interested to know which ones you are talking about. I have not heard of people using sbuild outside of Linux.
Then you state that debspawn is faster due to zstd tarballs and eatmydata. sbuild supports that as well plus lz4 tarballs which are again a tiny bit faster. Can you provide benchmarks to back up your claim?
Thanks!
cheers, josch
The text was updated successfully, but these errors were encountered: