build: shepherd: Use autoload to lazily bind Shepherd modules.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Wed, 28 Jul 2021 03:24:23 +0000 (23:24 -0400)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Mon, 2 Aug 2021 18:16:22 +0000 (14:16 -0400)
Instead of imperative module-autoload! directives.

* gnu/build/shepherd.scm: Replace module-autoload! directives by autoload
arguments for define-module.

gnu/build/shepherd.scm

index d7b858d..778e3fc 100644 (file)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
+  ;; XXX: Lazy-bind the Shepherd to avoid a compile-time dependency.
+  #:autoload (shepherd service) (fork+exec-command
+                                 read-pid-file
+                                 exec-command
+                                 %precious-signals)
+  #:autoload (shepherd system) (unblock-signals)
   #:export (make-forkexec-constructor/container
             fork+exec-command/container))
 
                            (file-exists? (file-system-mapping-source mapping)))
                          mappings)))))
 
-;; XXX: Lazy-bind the Shepherd to avoid a compile-time dependency.
-(module-autoload! (current-module)
-                  '(shepherd service)
-                  '(fork+exec-command read-pid-file exec-command
-                    %precious-signals))
-(module-autoload! (current-module)
-                  '(shepherd system) '(unblock-signals))
-
 (define* (read-pid-file/container pid pid-file #:key (max-delay 5))
   "Read PID-FILE in the container namespaces of PID, which exists in a
 separate mount and PID name space.  Return the \"outer\" PID. "