<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/nix, branch koszko</title>
<subtitle>Wojtek's customized Guix</subtitle>
<id>https://git.koszko.org/guix/atom?h=koszko</id>
<link rel='self' href='https://git.koszko.org/guix/atom?h=koszko'/>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/'/>
<updated>2025-05-26T12:07:24Z</updated>
<entry>
<title>build: Fix generation of `guix-gc.timer' file in VPATH builds.</title>
<updated>2025-05-26T12:07:24Z</updated>
<author>
<name>W. Kosior</name>
<email>koszko@koszko.org</email>
</author>
<published>2025-03-21T08:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=aaa953e1cbf03678b3040093c538c4b83acefac3'/>
<id>urn:sha1:aaa953e1cbf03678b3040093c538c4b83acefac3</id>
<content type='text'>
* nix/local.mk (etc/guix-%.service): Replace `$@.in' with `$&lt;'.

Change-Id: I247c46faeaf0bff229e052365118fe79c0eea8d8
</content>
</entry>
<entry>
<title>build: Fix substitutions for .service files.</title>
<updated>2025-05-14T20:39:03Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-05-14T20:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=b47eed5ea78d30363af78dd593b3cc2f42f420dc'/>
<id>urn:sha1:b47eed5ea78d30363af78dd593b3cc2f42f420dc</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/78318&gt;.

This is a followup to 107eb8ee8f5f9192c795abeb47885b49a57bacd4.

* nix/local.mk (etc/guix-%.service): Add ‘g’ for ‘@localstatedir@’
substitution.  Substitute ‘@storedir@’.

Reported-by: Ido Yariv &lt;yarivido@gmail.com&gt;
Change-Id: I9b53d3a6d713a000bc0a7a57f667badc00d2dff8
</content>
</entry>
<entry>
<title>daemon: Replace ‘random_shuffle’ with ‘shuffle’.</title>
<updated>2025-05-12T08:40:02Z</updated>
<author>
<name>Congcong Kuo</name>
<email>congcong.kuo@gmail.com</email>
</author>
<published>2025-05-11T08:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=5f3518ca83ad22cd77f24a05110c52907a46565d'/>
<id>urn:sha1:5f3518ca83ad22cd77f24a05110c52907a46565d</id>
<content type='text'>
‘std::random_shuffle’ was removed in C++14.

* nix/libstore/gc.cc (LocalStore::collectGarbage): Use ‘std::random’ and
‘std::shuffle’.

Change-Id: If91ed3ec3596a419ae7c87d7ce677e0970853e9f
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
</entry>
<entry>
<title>daemon: Use the guest GID in /etc/group.</title>
<updated>2025-04-25T18:25:54Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-04-25T18:17:17Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=0d3bc50b0cffeae05beb12d0c270c6599186c0d7'/>
<id>urn:sha1:0d3bc50b0cffeae05beb12d0c270c6599186c0d7</id>
<content type='text'>
Partly fixes &lt;https://issues.guix.gnu.org/77862&gt;.

Fixes a bug whereby, when running guix-daemon unprivileged, /etc/group
would contain the wrong GID for the “nixbld” group.  This inconsistency
would lead to failures in the Coreutils test suite, for instance.

* nix/libstore/build.cc (DerivationGoal::startBuilder): Use ‘guestGID’
when writing /etc/group.
* tests/store.scm ("/etc/passwd and /etc/group"): New test.

Reported-by: keinflue &lt;keinflue@posteo.net&gt;
Change-Id: I739bc96c4c935fd9015a45e2bfe5b3e3f90554a9
</content>
</entry>
<entry>
<title>daemon: Catch SIGINT, SIGTERM, and SIGHUP for proper termination.</title>
<updated>2025-04-14T15:33:11Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-04-11T21:29:51Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=dd947985522886f9de6fdfdde3f0601e42219da5'/>
<id>urn:sha1:dd947985522886f9de6fdfdde3f0601e42219da5</id>
<content type='text'>
Previously the daemon would not install handlers for these signals.  It
would thus terminate abruptly when receiving them, without properly
closing the SQLite database.

Consequently, the database’s WAL file, which is normally deleted by the
last client closing the database (via ‘sqlite3_close’), would not be
deleted when the guix-daemon process is terminated; instead, it would
persist and possibly keep growing beyond reason.

This patch fixes that.

* nix/nix-daemon/nix-daemon.cc (handleSignal, setTerminationSignalHandler):
New functions.
(processConnection): Call it.

Reported-by: Christopher Baines &lt;mail@cbaines.net&gt;
Change-Id: I07e510a1242e92b6a629d60eb840e029c0f921be
</content>
</entry>
<entry>
<title>daemon: Do not make chroot root directory read-only.</title>
<updated>2025-04-11T10:18:01Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-04-08T13:18:04Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=ff5181e27e79c88a82dd429b382e0764af489957'/>
<id>urn:sha1:ff5181e27e79c88a82dd429b382e0764af489957</id>
<content type='text'>
Fixes &lt;https://issues.guix.gnu.org/77570&gt;.

Commit 40f69b586a440d0397fa3dfe03b95a0f44e4d242 made chroot root
directory read-only; as a consequence, build processes attempting to
write to the root directory would now get EROFS instead of EACCES.

It turns out that a number of test suites (Go, Ruby, SCons, Shepherd)
would fail because of this observable difference.

To restore previous behavior in build environments while still
preventing build processes from exposing their root directory to outside
processes, this patch (1) keeps the root writable but #o555 by default,
thereby restoring the EACCES behavior, and (2) ensures that the parent
of the chroot root directory is itself user-accessible only.

* nix/libstore/build.cc (class DerivationGoal)[chrootRootTop]: New
field.
(DerivationGoal::startBuilder): Initialize ‘chrootRootTop’ and make it
‘AutoDelete’.  Replace ‘mount’ call that made the root directory
read-only by a mere ‘chmod_’ call.
* tests/store.scm ("build root cannot be made world-readable"): Remove.
("writing to build root leads to EACCES"): New test.

Reported-by: Ada Stevenson &lt;adanskana@gmail.com&gt;
Reported-by: keinflue &lt;keinflue@posteo.net&gt;
Suggested-by: Reepca Russelstein &lt;reepca@russelstein.xyz&gt;
Change-Id: I5912e8b3b293f8242a010cfc79255fc981314445
</content>
</entry>
<entry>
<title>daemon: Move comments where they belong.</title>
<updated>2025-03-26T16:57:44Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-02-14T16:29:56Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=bdd7b9a45d650ed45a1569cbc4ed971b52728104'/>
<id>urn:sha1:bdd7b9a45d650ed45a1569cbc4ed971b52728104</id>
<content type='text'>
* nix/libstore/build.cc (DerivationGoal::startBuilder): Shuffle
comments for clarity.

Change-Id: I6557c103ade4a3ab046354548ea193c68f8c9c05
</content>
</entry>
<entry>
<title>daemon: Drop Linux ambient capabilities before executing builder.</title>
<updated>2025-03-26T16:57:44Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-01-23T21:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=0163c732a17f6358a6b0d8004b27d27650a7d5be'/>
<id>urn:sha1:0163c732a17f6358a6b0d8004b27d27650a7d5be</id>
<content type='text'>
* config-daemon.ac: Check for &lt;sys/prctl.h&gt;.
* nix/libstore/build.cc (DerivationGoal::runChild): When ‘useChroot’ is
true, call ‘prctl’ to drop all ambient capabilities.

Change-Id: If34637fc508e5fb6d278167f5df7802fc595284f
</content>
</entry>
<entry>
<title>daemon: Create /var/guix/profiles/per-user unconditionally.</title>
<updated>2025-03-26T16:57:44Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2025-01-23T11:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=a3d6f5ae70298b9b2ff357435ff5925cc6563b1a'/>
<id>urn:sha1:a3d6f5ae70298b9b2ff357435ff5925cc6563b1a</id>
<content type='text'>
* nix/libstore/local-store.cc (LocalStore::LocalStore): Create
‘perUserDir’ unconditionally.

Change-Id: I5188320f9630a81d16f79212d0fffabd55d94abe
</content>
</entry>
<entry>
<title>daemon: Allow running as non-root with unprivileged user namespaces.</title>
<updated>2025-03-26T16:57:43Z</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludovic.courtes@inria.fr</email>
</author>
<published>2025-01-22T22:40:24Z</published>
<link rel='alternate' type='text/html' href='https://git.koszko.org/guix/commit/?id=ae18b3d9e6bd0c184505a094851448d08555e23e'/>
<id>urn:sha1:ae18b3d9e6bd0c184505a094851448d08555e23e</id>
<content type='text'>
Many thanks to Reepca Russelstein for their review and guidance on these
changes.

* nix/libstore/build.cc (guestUID, guestGID): New variables.
(DerivationGoal)[readiness]: New field.
(initializeUserNamespace): New function.
(DerivationGoal::runChild): When ‘readiness.readSide’ is positive, read
from it.
(DerivationGoal::startBuilder): Call ‘chown’
only when ‘buildUser.enabled()’ is true.  Pass CLONE_NEWUSER to ‘clone’
when ‘buildUser.enabled()’ is false or not running as root.  Retry
‘clone’ without CLONE_NEWUSER upon EPERM.
(DerivationGoal::registerOutputs): Make ‘actualPath’ writable before
‘rename’.
(DerivationGoal::deleteTmpDir): Catch ‘SysError’ around ‘_chown’ call.
* nix/libstore/local-store.cc (LocalStore::createUser): Do nothing if
‘dirs’ already exists.  Warn instead of failing when failing to chown
‘dir’.
* guix/substitutes.scm (%narinfo-cache-directory): Check for
‘_NIX_OPTIONS’ rather than getuid() == 0 to determine the cache
location.
* doc/guix.texi (Build Environment Setup): Reorganize a bit.  Add
section headings “Daemon Running as Root” and “The Isolated Build
Environment”.  Add “Daemon Running Without Privileges” subsection.
Remove paragraph about ‘--disable-chroot’.
(Invoking guix-daemon): Warn against ‘--disable-chroot’ and explain why.
* tests/derivations.scm ("builder is outside the store"): New test.

Reviewed-by: Reepca Russelstein &lt;reepca@russelstein.xyz&gt;
</content>
</entry>
</feed>
