mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
gnu: base: Add cautionary comments for canonical-package, %final-inputs usage.
* gnu/packages/base.scm (canonical-package, %final-inputs): Add comments. Change-Id: I8b2f5802127dbde169850a7931a64fb5eb503b7c
This commit is contained in:
parent
96e2eeee74
commit
b07c028a84
1 changed files with 11 additions and 1 deletions
|
@ -84,6 +84,10 @@ (define-module (gnu packages base)
|
||||||
libc-utf8-locales-for-target
|
libc-utf8-locales-for-target
|
||||||
make-ld-wrapper
|
make-ld-wrapper
|
||||||
libiconv-if-needed
|
libiconv-if-needed
|
||||||
|
|
||||||
|
;; Beware: the following should not be used the top level to avoid
|
||||||
|
;; introducing circular module dependencies.
|
||||||
|
canonical-package
|
||||||
%final-inputs))
|
%final-inputs))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
@ -1778,12 +1782,18 @@ (define* (libiconv-if-needed #:optional (target (%current-target-system)))
|
||||||
(list libiconv)
|
(list libiconv)
|
||||||
'()))
|
'()))
|
||||||
|
|
||||||
(define-public (canonical-package package)
|
;;; Beware: canonical-package should not be used at the top level, to avoid
|
||||||
|
;;; eagerly resolving (gnu packages commencement), which would introduce
|
||||||
|
;;; circular module dependencies.
|
||||||
|
(define (canonical-package package)
|
||||||
;; Avoid circular dependency by lazily resolving 'commencement'.
|
;; Avoid circular dependency by lazily resolving 'commencement'.
|
||||||
(let* ((iface (resolve-interface '(gnu packages commencement)))
|
(let* ((iface (resolve-interface '(gnu packages commencement)))
|
||||||
(proc (module-ref iface 'canonical-package)))
|
(proc (module-ref iface 'canonical-package)))
|
||||||
(proc package)))
|
(proc package)))
|
||||||
|
|
||||||
|
;;; Beware: %final-inputs should not be used at the top level, to avoid
|
||||||
|
;;; eagerly resolving (gnu packages commencement), which would introduce
|
||||||
|
;;; circular module dependencies.
|
||||||
(define* (%final-inputs #:optional (system (%current-system)))
|
(define* (%final-inputs #:optional (system (%current-system)))
|
||||||
"Return the list of \"final inputs\"."
|
"Return the list of \"final inputs\"."
|
||||||
;; Avoid circular dependency by lazily resolving 'commencement'.
|
;; Avoid circular dependency by lazily resolving 'commencement'.
|
||||||
|
|
Loading…
Reference in a new issue