mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 06:18:07 -05:00
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
c498a07e2d
commit
96783ed627
1 changed files with 5 additions and 11 deletions
|
@ -396,17 +396,11 @@ (define-syntax define-as-needed
|
|||
((_ (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)))))))
|
||||
|
||||
|
||||
;;;
|
||||
|
|
Loading…
Reference in a new issue