mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-14 19:10:49 +02: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 @@
|
||||||
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 @@ package needs iconv ,@(libiconv-if-needed) should be added."
|
||||||
(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…
Add table
Add a link
Reference in a new issue