guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: syscalls: 'define-as-needed' does not re-export local variables.


From: guix-commits
Subject: 01/01: syscalls: 'define-as-needed' does not re-export local variables.
Date: Thu, 18 Jul 2019 18:54:11 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit 96783ed6275cd2818ff56916274e6e4582f1dc9b
Author: Ludovic Court├Ęs <address@hidden>
Date:   Fri Jul 19 00:52:36 2019 +0200

    syscalls: 'define-as-needed' does not re-export local variables.
    
    Fixes <https://bugs.gnu.org/36723>.
    Reported by Timothy Sample <address@hidden>.
    
    * guix/build/syscalls.scm (define-as-needed): Rewrite to use lower-level
    module primitives; define VARIABLE only if it's not already defined to
    avoid "re-exporting local variable" error.
---
 guix/build/syscalls.scm | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 3c84d38..f2fdb4d 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -396,17 +396,11 @@ the returned procedure is called."
     ((_ (proc args ...) body ...)
      (define-as-needed proc (lambda* (args ...) body ...)))
     ((_ variable value)
-     (begin
-       (when (module-defined? the-scm-module 'variable)
-         (re-export variable))
-
-       (define variable
-         (if (module-defined? the-scm-module 'variable)
-             (module-ref the-scm-module 'variable)
-             value))
-
-       (unless (module-defined? the-scm-module 'variable)
-         (export variable))))))
+     (if (module-defined? the-scm-module 'variable)
+         (module-re-export! (current-module) '(variable))
+         (begin
+           (module-define! (current-module) 'variable value)
+           (module-export! (current-module) '(variable)))))))
 
 
 ;;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]