diff mbox series

[bug#54539,5/6] gnu: earlyoom: Avoid importing Goland and Haskelland to break cycles.

Message ID 20220323184855.25241-5-maximedevos@telenet.be
State New
Headers show
Series Start breaking up import cycles | expand

Commit Message

M March 23, 2022, 6:48 p.m. UTC
This (partially?) breaks a cycle between (gnu packages linux),
(gnu packages haskell-xyz) and (gnu packages golang).

It seems a bit cheaty to me but it works.

* gnu/packages/linux.scm (earlyoom): Use 'module-ref' and friends to access
  'go' and 'pandoc'.  Remove now unneeded imports.
---
 gnu/packages/linux.scm | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 5a0c5650e4..c47204dc76 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -52,7 +52,7 @@ 
 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
-;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021,2022 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
@@ -110,12 +110,13 @@ 
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
-  #:use-module (gnu packages golang)
+  ;; Don't import these modules here, otherwise a cycle would result.
+  ;; #:use-module (gnu packages golang)
   #:use-module (gnu packages gperf)
   #:use-module (gnu packages gstreamer)
-  ;; Don't import that module here, otherwise a cycle would result.
+  ;; Don't import these modules here, otherwise a cycle would result.
   ;; #:use-module (gnu packages gtk)
-  #:use-module (gnu packages haskell-xyz)
+  ;; #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages llvm)
@@ -3771,12 +3772,17 @@  from the module-init-tools project.")
       (append
         ;; To generate the manpage.
         (if (or (target-x86-64?) (target-x86-32?))
-          (list pandoc)
+          ;; Avoid adding Haskelland to the module closure
+          ;; when all we need is util-linux.
+          (list (module-ref (resolve-interface '(gnu packages haskell-xyz))
+                            'pandoc))
           '())
         (list
           ;; For the test suite.
           cppcheck
-          go)))
+          ;; Avoid adding 'golang' and its dependencies Rubyland and
+          ;; Nodeland to the module closure when all we need is util-linux.
+          (module-ref (resolve-interface '(gnu packages golang)) 'go))))
     (home-page "https://github.com/rfjakob/earlyoom")
     (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
     (description "Early OOM is a minimalist out of memory (OOM) daemon that