GNU bug report logs - #71022
[PATCH] configure.ac: Set default value for the 'prefix' variable.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 17 May 2024 23:56:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: zimon.toutoune <at> gmail.com, vagrant <at> debian.org, ludo <at> gnu.org, efraim <at> flashner.co.il, andreas <at> enge.fr, attila <at> lendvai.name, richard <at> freakingpenguin.com, 71022 <at> debbugs.gnu.org, janneke <at> gnu.org
Subject: [bug#71022] [PATCH] configure.ac: Set default value for the 'prefix' variable.
Date: Tue, 21 May 2024 20:16:28 -0400
Hi Ricardo,

Ricardo Wurmus <rekado <at> elephly.net> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> -When configuring Guix on a system that already has a Guix installation,
>> -be sure to specify the same state directory as the existing installation
>> -using the @option{--localstatedir} option of the @command{configure}
>> -script (@pxref{Directory Variables, @code{localstatedir},, standards,
>> -GNU Coding Standards}).  Usually, this @var{localstatedir} option is set
>> -to the value @file{/var}.  The @command{configure} script protects
>> -against unintended misconfiguration of @var{localstatedir} so you do not
>> -inadvertently corrupt your store (@pxref{The Store}).  The configuration
>> -directory should also be configured by setting the @option{--sysconfdir}
>> -option to the @file{/etc} value, which is the location used by Guix to
>> -store for example the access control list of authorized machines and the
>> -definition of offload machines.
>
> This information is still useful, isn't it?  It's important for people
> who intend to modify these locations, such as system administrators who
> might want to install things elsewhere.  Perhaps this could be rewritten
> to explain why this would be a bad idea.

It's useful, but it's duplicated with the warning you'd get from
the GUIX_CHECK_LOCALSTATEDIR m4/guix.m4 macro:

--8<---------------cut here---------------start------------->8---
dnl GUIX_CHECK_LOCALSTATEDIR
dnl
dnl Check that the LOCALSTATEDIR value is consistent with that of the existing
dnl Guix installation, if any.  Error out or warn if they do not match.
AC_DEFUN([GUIX_CHECK_LOCALSTATEDIR], [
  AC_REQUIRE([GUIX_CURRENT_LOCALSTATEDIR])
  if test "x$guix_cv_current_localstatedir" != "xnone"; then
    if test "$guix_cv_current_localstatedir" != "$guix_localstatedir"; then
      case "$localstatedir" in
        NONE|\${prefix}*)
          # User kept the default value---i.e., did not pass '--localstatedir'.
          AC_MSG_ERROR([chosen localstatedir '$guix_localstatedir' does not match \
that of the existing installation '$guix_cv_current_localstatedir'
Installing may corrupt $storedir!
Use './configure --localstatedir=$guix_cv_current_localstatedir'.])
          ;;
        *)
          # User passed an explicit '--localstatedir'.  Assume they know what
          # they're doing.
          AC_MSG_WARN([chosen localstatedir '$guix_localstatedir' does not match \
that of the existing installation '$guix_cv_current_localstatedir'])
          AC_MSG_WARN([installing may corrupt $storedir!])
         ;;
      esac
    fi
  fi])
--8<---------------cut here---------------end--------------->8---

So it seems judicious to remove it, especially since with this change
the default `./configure` would no longer require the user to think
about '--localstatedir' and friends (unless their system was an odd
snowflake, in which case the macro would do its job to warn them).

Does that clarify the intent?

-- 
Thanks,
Maxim




This bug report was last modified 1 year and 52 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.