mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-23 21:17:11 -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
|
||||
make-ld-wrapper
|
||||
libiconv-if-needed
|
||||
|
||||
;; Beware: the following should not be used the top level to avoid
|
||||
;; introducing circular module dependencies.
|
||||
canonical-package
|
||||
%final-inputs))
|
||||
|
||||
;;; Commentary:
|
||||
|
@ -1778,12 +1782,18 @@ (define* (libiconv-if-needed #:optional (target (%current-target-system)))
|
|||
(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'.
|
||||
(let* ((iface (resolve-interface '(gnu packages commencement)))
|
||||
(proc (module-ref iface 'canonical-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)))
|
||||
"Return the list of \"final inputs\"."
|
||||
;; Avoid circular dependency by lazily resolving 'commencement'.
|
||||
|
|
Loading…
Reference in a new issue