syscalls: 'define-as-needed' does not re-export local variables.
Fixes <https://bugs.gnu.org/36723>. Reported by Timothy Sample <samplet@ngyro.com>. * 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.
This commit is contained in:
parent
aa2441c2cf
commit
7089f98ef1
|
@ -396,17 +396,11 @@ the returned procedure is called."
|
||||||
((_ (proc args ...) body ...)
|
((_ (proc args ...) body ...)
|
||||||
(define-as-needed proc (lambda* (args ...) body ...)))
|
(define-as-needed proc (lambda* (args ...) body ...)))
|
||||||
((_ variable value)
|
((_ variable value)
|
||||||
(begin
|
(if (module-defined? the-scm-module 'variable)
|
||||||
(when (module-defined? the-scm-module 'variable)
|
(module-re-export! (current-module) '(variable))
|
||||||
(re-export variable))
|
(begin
|
||||||
|
(module-define! (current-module) 'variable value)
|
||||||
(define variable
|
(module-export! (current-module) '(variable)))))))
|
||||||
(if (module-defined? the-scm-module 'variable)
|
|
||||||
(module-ref the-scm-module 'variable)
|
|
||||||
value))
|
|
||||||
|
|
||||||
(unless (module-defined? the-scm-module 'variable)
|
|
||||||
(export variable))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Reference in New Issue