Subject: bug#36954: closed (Re: [bug#36954] [PATCH] deploy: Use all machine modules when loading deployment)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 07 Aug 2019 20:08:02 +0000

Your bug report

#36954: [PATCH] deploy: Use all machine modules when loading deployment

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
36954: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36954
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#36954] [PATCH] deploy: Use all machine modules when loading deployment
From: Christopher Lemmer Webber <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 07 Aug 2019 16:07:12 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Merged and pushed, thanks!

Jakob L. Kreuze writes:

> * guix/scripts/deploy.scm (load-source-file): Enumerate and include all
> submodules of (gnu machine) when loading the provided deployment
> specification.
> ---
>  guix/scripts/deploy.scm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
> index bc1d93a93a..6a67985c8b 100644
> --- a/guix/scripts/deploy.scm
> +++ b/guix/scripts/deploy.scm
> @@ -19,6 +19,7 @@
>  
>  (define-module (guix scripts deploy)
>    #:use-module (gnu machine)
> +  #:use-module (guix discovery)
>    #:use-module (guix scripts)
>    #:use-module (guix scripts build)
>    #:use-module (guix store)
> @@ -73,7 +74,10 @@ Perform the deployment specified by FILE.\n"))
>  
>  (define (load-source-file file)
>    "Load FILE as a user module."
> -  (let ((module (make-user-module '((gnu) (gnu machine) (gnu machine ssh)))))
> +  (let* ((guix-path (dirname (search-path %load-path "guix.scm")))
> +         (environment-modules (scheme-modules* guix-path "gnu/machine"))
> +         (module (make-user-module (append '((gnu) (gnu machine))
> +                                           environment-modules))))
>      (load* file module)))
>  
>  (define (guix-deploy . args)

Subject: [PATCH] deploy: Use all machine modules when loading deployment
From: [email-masked] (Jakob L. Kreuze)
To: [email-masked]
Date: Wed, 07 Aug 2019 08:43:27 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* guix/scripts/deploy.scm (load-source-file): Enumerate and include all
submodules of (gnu machine) when loading the provided deployment
specification.
---
 guix/scripts/deploy.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index bc1d93a93a..6a67985c8b 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -19,6 +19,7 @@
 
 (define-module (guix scripts deploy)
   #:use-module (gnu machine)
+  #:use-module (guix discovery)
   #:use-module (guix scripts)
   #:use-module (guix scripts build)
   #:use-module (guix store)
@@ -73,7 +74,10 @@ Perform the deployment specified by FILE.\n"))
 
 (define (load-source-file file)
   "Load FILE as a user module."
-  (let ((module (make-user-module '((gnu) (gnu machine) (gnu machine ssh)))))
+  (let* ((guix-path (dirname (search-path %load-path "guix.scm")))
+         (environment-modules (scheme-modules* guix-path "gnu/machine"))
+         (module (make-user-module (append '((gnu) (gnu machine))
+                                           environment-modules))))
     (load* file module)))
 
 (define (guix-deploy . args)
-- 
2.22.0