On Thu, Nov 05, 2020 at 12:15:23PM -0500, Stefan Monnier wrote:
> > Those "chrooty [1]" approaches find their limits whenever you depend on
> > a kernel version different from what your machine has.
>
> For me, this is basically never an issue.
Linux user space interfaces are pretty stable. So building things
for /past/ distributions tends to be pretty stress-free.
> What is problematic, OTOH is to keep those chroots (or VMs) up to date.
> Basically, each one of those is yet another machine to administer.
As I said, I usually do it the chroot way (I use schroot because it
gives me sudo-free chrooting (that saved my behind at least once [1])
and because it does the bind-mounting thingy for the right qemu
binary depending on the target arch. Nothing deeply magical.
What I don't like about it is that it wants its configs in a central
place (/etc), but since it's doing sudo-y things, that's kind of
understandable.
Before I build a package, I just do an apt-get up{date,grade} as
needed. My box has an apt cache, so that's reasonably fast.
> I'm still looking for a way to have a "lightweight" VM by using something
> like a Linux container but where the /usr (and friends) just reuses the
> one of the host system (so it's kept up to date as a side effect of
> keeping the main system up to date).
Hm. I have those chroots because they are different (e.g. build for
an old Debian wheezy, while I "am" on Buster). Or build for an ARM
(Raspberry Pi) while mine is an X86_64. Arguably, you could do the
latter by enabling multi-arch: packages for different arches are
co-installable... except when they ain't (Gtk, I'm looking at you).
> I had managed to get something like it running using LXC on one machine
> but couldn't make it work in the machine where I actually needed it.
> IIUC systemd offers something like that nowadays but I haven't had the
> occasion to dig into it.
In theory, you could bind-mount e.g. /usr and what not into your
chroot. Or even better: do an overlayfs, so whithin your chroot
you can "overwrite" parts of /usr.
Schroot does use overlayfs, but for a different thing: there you
can prepare a "base" which you keep immutable, and do the package
build on an overlay. When you're done, you drop the overlay and
get your pristine base back. Quite handy.
Cheers
- t
Attachment:
signature.asc
Description: Digital signature