website: Add draft post about the Guile guix-daemon.
* website/drafts/guile-guix-daemon-introduction.md: New file.
This commit is contained in:
parent
9c5b07cde7
commit
16b3181109
|
@ -0,0 +1,94 @@
|
|||
title: Building a Guile guix-daemon
|
||||
author: Christopher Baines
|
||||
tags:
|
||||
date: 2023-10-13 14:30:00
|
||||
---
|
||||
|
||||
When using Guix, you might be aware of the
|
||||
[daemon](https://guix.gnu.org/en/manual/en/html_node/Setting-Up-the-Daemon.html).
|
||||
It runs in the background but it's a key component in Guix. Whenever
|
||||
you've been using Guix to operate on the store, whether that's
|
||||
building something or downloading some substitutes, it's the daemon
|
||||
managing that operation.
|
||||
|
||||
The daemon also is a key part of the history of Guix. The Guix
|
||||
project started mixing Guile with ideas from the Nix project, and the
|
||||
guix-daemon is a fork of the nix-dameon with some tweaks made over the
|
||||
years. Rather than being implemented in Guile though, the daemon is
|
||||
implemented in C++. Given the focus on Guile in Guix, this is
|
||||
unusual, and I believe it's made working on the daemon less desirable,
|
||||
especially since rewriting it in Guile has been discussed for many
|
||||
years now.
|
||||
|
||||
# What would a Guile guix-dameon mean?
|
||||
|
||||
Guix already has code written in Guile for doing some of what the
|
||||
daemon does internally, so being able to use this Guile code inside
|
||||
and outside the daemon would simplify Guix and allow removing the C++
|
||||
code.
|
||||
|
||||
There isn't Guile code yet for everything the daemon does though, so
|
||||
getting to this point will make new exciting features easier to
|
||||
implement. That could be things like making it easier to use Guix in
|
||||
environments where running the dameon in the usual way is inconvinient
|
||||
or infeasible. It may also help with portability, so help with
|
||||
running Guix on the Hurd and new architectures.
|
||||
|
||||
As someone who's more experienced writing Guile than C++, I'm also
|
||||
hoping it'll generally make hacking on the dameon more accessible.
|
||||
This in turn might lead to new features. For example, I think having
|
||||
a Guile guix-daemon will simplify implementing a way to jump in to a
|
||||
build and inspect the environment.
|
||||
|
||||
With some [monetary support from NLNet](https://nlnet.nl/project/GuixDaemon-Guile/),
|
||||
I'm planning to focus for the next year on getting a Guile
|
||||
implementation of the guix-daemon written and adopted.
|
||||
|
||||
# A technical plan
|
||||
|
||||
Building on the [recent discussion](https://lists.gnu.org/archive/html/guix-devel/2023-09/msg00328.html)
|
||||
of this topic on the guix-devel mailing list, here's some technical
|
||||
thoughts on how I'm approaching this.
|
||||
|
||||
While I think there's a substantial amount of work to do, progress
|
||||
towards a Guile guix-daemon has already been made. Given that things
|
||||
in Guix have probably changed since this work has happened, I plan to
|
||||
carefully review that existing work (most of which can be found on the
|
||||
`guile-daemon` branch) so that I can build upon it.
|
||||
|
||||
The priority for the Guile daemon is backwards compatability, so the
|
||||
plan is to allow switching between the C++ implementation and Guile
|
||||
implementation which any issues. This'll require not making changes
|
||||
to the database schema, and generally doing things in a way which the
|
||||
current C++ daemon will understand.
|
||||
|
||||
Like the build coordinator, I'm planning to make the daemon a single
|
||||
process using Guile Fibers for parallelism. This is in contrast to
|
||||
the forking model using by the C++ daemon. Even though it's not a
|
||||
priority to address feature issues with the current dameon, this
|
||||
approach might help to reduce database contention issues experienced
|
||||
with the current daemon, and allow for less locking, like not having
|
||||
the big GC lock for example.
|
||||
|
||||
# Progress reports
|
||||
|
||||
I'm planning on publishing more blog posts as the project progress, so
|
||||
keep an eye on the Guix blog for future updates.
|
||||
|
||||
#### About GNU Guix
|
||||
|
||||
[GNU Guix](https://guix.gnu.org) is a transactional package manager
|
||||
and an advanced distribution of the GNU system that [respects user
|
||||
freedom](https://www.gnu.org/distros/free-system-distribution-guidelines.html).
|
||||
Guix can be used on top of any system running the Hurd or the Linux
|
||||
kernel, or it can be used as a standalone operating system
|
||||
distribution for i686, x86_64, ARMv7, AArch64 and POWER9 machines.
|
||||
|
||||
In addition to standard package management features, Guix supports
|
||||
transactional upgrades and roll-backs, unprivileged package
|
||||
management, per-user profiles, and garbage collection. When used as a
|
||||
standalone GNU/Linux distribution, Guix offers a declarative,
|
||||
stateless approach to operating system configuration management. Guix
|
||||
is highly customizable and hackable through
|
||||
[Guile](https://www.gnu.org/software/guile) programming interfaces and
|
||||
extensions to the [Scheme](http://schemers.org) language.
|
Loading…
Reference in New Issue