summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-02-01 12:51:07 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-02-20 22:18:33 -0500
commit35719f7c7df5b08cd3afeea908a696cc65de41f9 (patch)
treeb74074d5a3eb4eaaf7b76e1e43fb047dc5a8f81f
parent05e99036dc480a150b399735ae3c02d5b824b35b (diff)
gnu: base: Add cautionary comments for canonical-package, %final-inputs usage.
* gnu/packages/base.scm (canonical-package, %final-inputs): Add comments. Change-Id: I8b2f5802127dbde169850a7931a64fb5eb503b7c
-rw-r--r--gnu/packages/base.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index deda116964..cffc99d4cc 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -82,6 +82,10 @@
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:
@@ -1720,12 +1724,18 @@ package needs iconv ,@(libiconv-if-needed) should be added."
(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'.