all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: aurtzy <aurtzy@gmail.com>
To: 70051@debbugs.gnu.org
Cc: aurtzy <aurtzy@gmail.com>
Subject: bug#70051: [PATCH] gnu: open-luks-device: Fix unbound variables.
Date: Tue,  2 Apr 2024 02:23:29 -0400	[thread overview]
Message-ID: <6b8484d383512fe8f9c2bc65ff495395f6fa0abf.1712036470.git.aurtzy@gmail.com> (raw)
In-Reply-To: <ZgVTiUVfDlM20s8K@bluewin.ch>

It seems like `use-modules' never actually worked due to the way it is eval'd
by the Shepherd, and was only apparent after a change that prevented other
module imports from leaking into the namespace.  This is fixed by using direct
references instead.

* gnu/system/mapped-devices.scm (open-luks-device): Use direct references for
variables from other modules.

Fixes: https://issues.guix.gnu.org/70051

Change-Id: I993798e161c4b4fca6e8a4f14eea5042b184ebc9
---

Hi!

I encountered this issue as well, and think I've figured out what was
happening: `use-modules' appears to not work due to the way g-expressions are
evaluated by Shepherd, so after services became properly isolated in their own
modules, the variable references became no longer available.  There's a
comment further down in the file that seems to confirm this ("XXX: We're not
at the top level here...").

Can anyone confirm this patch works for them too?

Cheers,

aurtzy

 gnu/system/mapped-devices.scm | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index c19a818453..e46e2c7954 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -201,14 +201,12 @@ (define* (open-luks-device source targets #:key key-file)
        #~(let ((source #$(if (uuid? source)
                              (uuid-bytevector source)
                              source))
-               (keyfile #$key-file))
-           ;; XXX: 'use-modules' should be at the top level.
-           (use-modules (rnrs bytevectors) ;bytevector?
-                        ((gnu build file-systems)
-                         #:select (find-partition-by-luks-uuid
-                                   system*/tty))
-                        ((guix build utils) #:select (mkdir-p)))
-
+               (keyfile #$key-file)
+               (bytevector? (@ (rnrs bytevectors) bytevector?))
+               (find-partition-by-luks-uuid (@ (gnu build file-systems)
+                                               find-partition-by-luks-uuid))
+               (system*/tty (@ (gnu build file-systems) system*/tty))
+               (mkdir-p (@ (guix build utils) mkdir-p)))
            ;; Create '/run/cryptsetup/' if it does not exist, as device locking
            ;; is mandatory for LUKS2.
            (mkdir-p "/run/cryptsetup/")

base-commit: 6e2db85ca83528199a46b002d2592bd4bef017c8
-- 
2.41.0





  parent reply	other threads:[~2024-04-02  6:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 11:24 bug#70051: guix system hangs on boot with LUKS /home partition Fulbert
2024-03-28 11:49 ` bug#70051: Fulbert
2024-03-28 11:57 ` bug#70051: Fulbert
2024-03-31  0:56 ` bug#70051: same Lilah Tascheter
2024-04-02  6:23 ` aurtzy [this message]
2024-04-02 12:14   ` bug#70051: [PATCH] gnu: open-luks-device: Fix unbound variables Remco van 't Veer
2024-04-03 18:01 ` bug#70051: guix system hangs on boot with LUKS /home partition Adrien 'neox' Bourmault
2024-04-08 13:20 ` bug#70051: (no subject) Fulbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b8484d383512fe8f9c2bc65ff495395f6fa0abf.1712036470.git.aurtzy@gmail.com \
    --to=aurtzy@gmail.com \
    --cc=70051@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.