guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing the defaults for --localstatedir and --sysconfdir?


From: Richard Sent
Subject: Changing the defaults for --localstatedir and --sysconfdir?
Date: Wed, 01 May 2024 16:49:07 -0400

Hi Guix,

As everyone who's built Guix from source knows, when running ./configure
on a system with an existing Guix installation you must remember to
specify --localstatedir=/var and --sysconfdir=/etc. I think we should
consider whether those variables should default to those values.

There's been discussion on this in the distant past, see [1]. At risk of
oversimplifying, I think previous consensus was in favor of making some
sort of change over the existing behavior before discussion fizzled.

The reason for the current situation is so if a user builds and installs
Guix from source, localstatedir and sysconfdir will be located in
$prefix/var and $prefix/etc. See [2] for Ludo's comments on the matter,
[3] for the convention of localstatedir and sysconfdir being under
$prefix.

However, the "guix" package packaged with Guix (that's a sentence...)
configures itself with "--localstatedir=/var" and "--sysconfdir=/etc".
See (gnu packages package-management)[guix]. Many (~70) other packages
also use the "--localstatedir=/var" configure flag.

My understanding is this means even if Guix itself was built+installed
from source with the intent of custom Guix-specific var and etc
locations, various Guix-related files will inevitably wind up in /var
anyway. They would either appear from Guix directly or from the packages
Guix installs.

(I've noticed the Guix package'd guix be built in the process of
reconfiguring my system before, although the cause or impact of that
isn't clear to me. It may or may not try placing more files in /var and
/etc.)

As such, if the benefits in [2] aren't achievable (keeping every guix
state-based file in $prefix/var), perhaps it's worth biting the bullet.
Defaulting to /var and /etc would lower the complexity of building Guix.

The number of users manually installing from source is likely lower than
the number of users building Guix for testing purposes. And a user that
wants localstatedir in $prefix/var or sysconfdir in $prefix/etc can
still choose to specify that manually.

If that's not desirable, perhaps there is a third option?

./configure is already smart enough to detect if the configured
localstatedir does not match the installed Guix's localstatedir. How
about a mechanism that follows this process:

1. If ./configure is invoked without localstatedir and/or sysconfdir,
check if there is an existing Guix installation.

2. If there is an existing Guix installation, use the existing
localstatedir and sysconfdir values.

3. If there is not an existing Guix installation, use $prefix/var and
$prefix/etc.

My autotools skill level can be described as asymptotically approaching
0, so that suggestion may or may not be achievable. But I (naively)
think it would satisfy everyone.

Sorry for the wall of text! Congrats on making it to the end. Have a
cookie: 🍪

[1]: https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00718.html
[2]: https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00098.html
[3]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]