unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 70266@debbugs.gnu.org
Subject: bug#70266: Failure to open LUKS devices from a Shepherd service
Date: Sun, 07 Apr 2024 23:54:30 +0200	[thread overview]
Message-ID: <87cyr0on3d.fsf@gnu.org> (raw)
In-Reply-To: <87h6gcoo85.fsf@inria.fr> ("Ludovic Courtès"'s message of "Sun, 07 Apr 2024 23:30:02 +0200")

Ludovic Courtès <ludo@gnu.org> skribis:

> Commit 6f9d844d2ece7b369d17bbe678978462425f869c led to a regression:
> when a ‘luks-device-mapping’ mapped device is opened from a Shepherd
> service (for instance a ‘device-mapping-XXX’ service created by
> ‘device-mapping-service-type’ because, say, /home is a separate LUKS
> partition), said service fails to start with:
>
>   Unbound variable: bytevector?
>
> This is the ‘bytevector?’ referred to in ‘open-luks-device’.

This is a situation with a non-top-level ‘use-modules’.

The problem can be illustrated like this:

--8<---------------cut here---------------start------------->8---
$ cat ~/src/guile-debugging/non-top-level-use-modules.scm
;; (define-module (xxxx))

(define (foo x)
  (use-modules (rnrs bytevectors))  ;bad!!
  (bytevector? x))

;; (pk '-> (foo (call-with-input-string "#vu8(1 2 3)" read)))

(pk 'foo foo)

$ guild compile -O1 ~/src/guile-debugging/non-top-level-use-modules.scm 
/home/ludo/src/guile-debugging/non-top-level-use-modules.scm:3:3: warning: possibly unbound variable `bytevector?'
wrote `/home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/guile-debugging/non-top-level-use-modules.scm.go'
$ guile
GNU Guile 3.0.99-git
Copyright (C) 1995-2024 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m(sdf)
scheme@(sdf)> ,use(guile)
scheme@(sdf)> (load-compiled "/home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/guile-debugging/non-top-level-use-modules.scm.go")

;;; (foo #<procedure foo (x)>)
$1 = #<procedure foo (x)>
scheme@(sdf)> ,m(guile-user)
scheme@(guile-user)> ($1 123)
;;; <stdin>:7:1: warning: possibly unbound variable `$1'
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
Unbound variable: bytevector?

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to contin
--8<---------------cut here---------------end--------------->8---

‘use-modules’, when used this way, loads the specified modules in
(current-module) at that point (at run time).  If you change what the
current module is, as I did above, then it breaks.

Ludo’.




  reply	other threads:[~2024-04-07 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07 21:30 bug#70266: Failure to open LUKS devices from a Shepherd service Ludovic Courtès
2024-04-07 21:54 ` Ludovic Courtès [this message]
2024-04-07 22:19 ` aurtzy
2024-04-07 23:43   ` bug#70051: " Ludovic Courtès
2024-04-08  1:05     ` aurtzy
2024-04-08 12:19       ` bug#70051: " Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87cyr0on3d.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=70266@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).