From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvNmh-0003I9-1N for guix-patches@gnu.org; Tue, 04 Apr 2017 08:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvNmc-0005LT-1b for guix-patches@gnu.org; Tue, 04 Apr 2017 08:42:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvNmb-0005LP-V5 for guix-patches@gnu.org; Tue, 04 Apr 2017 08:42:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvNmb-000349-NW for guix-patches@gnu.org; Tue, 04 Apr 2017 08:42:01 -0400 Subject: bug#26341: [PATCH] build: vm: Add missing module. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170402150157.7149-1-m.othacehe@gmail.com> Date: Tue, 04 Apr 2017 14:41:23 +0200 In-Reply-To: <20170402150157.7149-1-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Sun, 2 Apr 2017 17:01:57 +0200") Message-ID: <8760iks5u4.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mathieu Othacehe Cc: 26341@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Mathieu, Mathieu Othacehe 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 =E2=80=98guile-static-stripped=E2=80=99 is running, in th= e initrd. And =E2=80=98guile-static-stripped=E2=80=99 has =E2=80=98guile-linux-syscal= ls.patch=E2=80=99, which adds bindings for =E2=80=98mount=E2=80=99, =E2=80=98umount=E2=80=99, etc. Conversely, (guix build syscalls) relies on the ability to do dlopen(NULL) and to resolve =E2=80=9Cmount=E2=80=9D et al. from libc.so. T= his cannot work with the statically-linked Guile, which is why we have =E2=80=98guile-linux-syscalls.patch=E2=80=99. 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=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: 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 --=-=-=--