GNU bug report logs - #26341
[PATCH] build: vm: Add missing module.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>

Date: Sun, 2 Apr 2017 15:03:01 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #8 received at 26341 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 26341 <at> debbugs.gnu.org
Subject: Re: bug#26341: [PATCH] build: vm: Add missing module.
Date: Tue, 04 Apr 2017 14:41:23 +0200
[Message part 1 (text/plain, inline)]
Hello Mathieu,

Mathieu Othacehe <m.othacehe <at> gmail.com> skribis:

> * gnu/build/vm.scm (define-module): Use module (guix build syscalls).
>
> It fixes the following warnings during guix build :
>
> gnu/build/vm.scm:233:3: warning: possibly unbound variable `mount'
> gnu/build/vm.scm:238:3: warning: possibly unbound variable `umount'
> gnu/build/vm.scm:268:8: warning: possibly unbound variable `mount'
> gnu/build/vm.scm:276:8: warning: possibly unbound variable `umount'
> gnu/build/vm.scm:315:4: warning: possibly unbound variable `mount'
> gnu/build/vm.scm:323:4: warning: possibly unbound variable `umount'

This is weird but on purpose: this module is used in a context, in (gnu
system vm), where ‘guile-static-stripped’ is running, in the initrd.
And ‘guile-static-stripped’ has ‘guile-linux-syscalls.patch’, which adds
bindings for ‘mount’, ‘umount’, etc.

Conversely, (guix build syscalls) relies on the ability to do
dlopen(NULL) and to resolve “mount” et al. from libc.so.  This cannot
work with the statically-linked Guile, which is why we have
‘guile-linux-syscalls.patch’.

So this patch cannot be applied as is, and I think it would break things
that use (gnu build vm).

That said, we should improve this.  Perhaps something along the lines of
the attached patch would work.

Could you try and send an updated patch?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 5aae1530f..e108d6169 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -462,7 +462,9 @@ the returned procedure is called."
 (define UMOUNT_NOFOLLOW 8)
 
 (define mount
-  (let ((proc (syscall->procedure int "mount" `(* * * ,unsigned-long *))))
+  (let ((proc (if (module-defined? the-scm-module 'mount)
+                  (module-ref the-scm-module 'mount)
+                  (syscall->procedure int "mount" `(* * * ,unsigned-long *)))))
     (lambda* (source target type #:optional (flags 0) options
                      #:key (update-mtab? #f))
       "Mount device SOURCE on TARGET as a file system TYPE.  Optionally, FLAGS

This bug report was last modified 8 years and 44 days ago.

Previous Next


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