all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with building service from my channel
@ 2019-06-10 19:47 Jack Hill
  2019-06-11 10:31 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Hill @ 2019-06-10 19:47 UTC (permalink / raw)
  To: help-guix

Hi Guix,

I have defined the planisphere-report-service-type in my channel 
<https://gitlab.oit.duke.edu/jackhill/guix-at-duke/blob/363d6270d5e3505c34aa0dbfa221f64421497587/guix-at-duke/services/endpoint-management.scm>

This has been working well for me, and I have most recently been able to 
build my channel with `guix pull` with the following version of guix:

```
$ guix describe
Generation 5	Jun 10 2019 13:44:44	(current)
   guix 31775e4
     repository URL: https://git.savannah.gnu.org/git/guix.git
     commit: 31775e400e05fb05fff0de4d3ffbf9549fe20994
   guix-at-duke 363d627
     repository URL: https://gitlab.oit.duke.edu/jackhill/guix-at-duke.git
     branch: master
     commit: 363d6270d5e3505c34aa0dbfa221f64421497587
```

However, when I try to pull the most recent guix, 
aec9bb8793ca75a5bbc1731460ed4eb388764202, the build of my channel fails:

```
building /gnu/store/hycfgn8iiy9z205zi1174sgcgs0vnm5r-guix-at-duke.drv...
|builder for `/gnu/store/hycfgn8iiy9z205zi1174sgcgs0vnm5r-guix-at-duke.drv' failed to produce output path `/gnu/store/kd88fi3fsbghnscxp0ccjrzh0si055mg-guix-at-duke'
build of /gnu/store/hycfgn8iiy9z205zi1174sgcgs0vnm5r-guix-at-duke.drv failed
View build log at '/var/log/guix/drvs/hy/cfgn8iiy9z205zi1174sgcgs0vnm5r-guix-at-duke.drv.bz2'.
```

The build log is;

```
(repl-version 0 0)
(exception misc-error (value #f) (value "Unbound variable: ~s") (value (mcron-service-type)) (value #f))
```

Presumably there was some change to the mcron-service-type recently that 
requires changes in my channel, but I don't see what they could be or how 
to fix my channel.

What's going on here? What is the Guile exception trying to tell me?

Best,
Jack

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with building service from my channel
  2019-06-10 19:47 Problem with building service from my channel Jack Hill
@ 2019-06-11 10:31 ` Ludovic Courtès
  2019-06-11 13:38   ` Jack Hill
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2019-06-11 10:31 UTC (permalink / raw)
  To: Jack Hill; +Cc: help-guix

Hi Jack,

Jack Hill <jackhill@jackhill.us> skribis:

> The build log is;
>
> ```
> (repl-version 0 0)
> (exception misc-error (value #f) (value "Unbound variable: ~s") (value (mcron-service-type)) (value #f))
> ```
>
> Presumably there was some change to the mcron-service-type recently
> that requires changes in my channel, but I don't see what they could
> be or how to fix my channel.
>
> What's going on here? What is the Guile exception trying to tell me?

The Guile exception possibly means that code in your channel refers to
‘mcron-service-type’, but that this variable is unbound.  It could be
because one of your modules lacks #:use-module (gnu services mcron).

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with building service from my channel
  2019-06-11 10:31 ` Ludovic Courtès
@ 2019-06-11 13:38   ` Jack Hill
  2019-06-13  0:47     ` Jack Hill
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Hill @ 2019-06-11 13:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

On Tue, 11 Jun 2019, Ludovic Courtès wrote:

> Jack Hill <jackhill@jackhill.us> skribis:
>
>> ```
>> (repl-version 0 0)
>> (exception misc-error (value #f) (value "Unbound variable: ~s") (value (mcron-service-type)) (value #f))
>> ```
>
> The Guile exception possibly means that code in your channel refers to
> ‘mcron-service-type’, but that this variable is unbound.  It could be
> because one of your modules lacks #:use-module (gnu services mcron).

Ludo’,

That makes sense, except, I don't see where I have used 
mcron-service-type, but not used the (gnu services mcron) module, and the 
same channel code was working as of 
31775e400e05fb05fff0de4d3ffbf9549fe20994, so I think it that means it has 
to be something else.

Here's where I define a service that extends mcron-service-type

```
(define-module (guix-at-duke services endpoint-management)
   #:use-module (gnu packages certs)
   #:use-module (gnu services mcron)
   #:use-module (gnu services)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix-at-duke packages endpoint-management)
   #:export (planisphere-report-configuration
 	    planisphere-report-configuration?
 	    planisphere-report-service-type))

…[snip]…

(define planisphere-report-service-type
   (service-type
    (name 'planisphere-report)
    (extensions
     (list (service-extension mcron-service-type planisphere-report-jobs)))
    (default-value (planisphere-report-configuration))
    (description "Periodically run @command{planisphere-report} to update the OIT endpoint database.")))
```

Best,
Jack

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with building service from my channel
  2019-06-11 13:38   ` Jack Hill
@ 2019-06-13  0:47     ` Jack Hill
  0 siblings, 0 replies; 4+ messages in thread
From: Jack Hill @ 2019-06-13  0:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

On Tue, 11 Jun 2019, Jack Hill wrote:

> Here's where I define a service that extends mcron-service-type

I copied the code for this service from my channel into an arbitrary 
service file in the guix repository, hoping for a different message that 
would provide more insight. To my surprise, it build sucessfully, and I as 
able to sucessfully search for my service using `./pre-inst-env guix 
system search`.

Ideas?

Here's the patch that I added to guix:

From c91455049a4bd5eca9f3128135c000d6d881a23a Mon Sep 17 00:00:00 2001
From: Jack Hill <jackhill@jackhill.us>
Date: Wed, 12 Jun 2019 20:38:13 -0400
Subject: [PATCH] test commit

---
  gnu/services/certbot.scm | 32 +++++++++++++++++++++++++++++++-
  1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index ae34ad17bb..ecca5f360b 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -27,6 +27,7 @@
    #:use-module (gnu services web)
    #:use-module (gnu system shadow)
    #:use-module (gnu packages tls)
+  #:use-module (gnu packages certs)
    #:use-module (guix i18n)
    #:use-module (guix records)
    #:use-module (guix gexp)
@@ -35,7 +36,10 @@
    #:export (certbot-service-type
              certbot-configuration
              certbot-configuration?
-            certificate-configuration))
+            certificate-configuration
+            planisphere-report-configuration
+	    planisphere-report-configuration?
+	    planisphere-report-service-type))

  ;;; Commentary:
  ;;;
@@ -190,3 +194,29 @@
                   "Automatically renew @url{https://letsencrypt.org, Let's
  Encrypt} HTTPS certificates by adjusting the nginx web server configuration
  and periodically invoking @command{certbot}.")))
+
+(define-record-type* <planisphere-report-configuration>
+  planisphere-report-configuration make-planisphere-report-configuration
+  planisphere-report-configuration?
+  (certs planisphere-report-certs
+	 (default nss-certs))
+  (package planisphere-report-package
+	   (default nss-certs))
+  (schedule planisphere-report-schedule
+	    (default '(quote (next-minute-from (next-hour '(0 12)) (list (random 60)))))))
+
+(define (planisphere-report-jobs config)
+  (let ((sched-spec (planisphere-report-schedule config))
+	(certs (file-append (planisphere-report-certs config) "/etc/ssl/certs"))
+	(cmd (file-append (planisphere-report-package config) "/bin/planisphere-report")))
+    (list
+     #~(append-environment-mods "SSL_CERT_DIR" #$certs)
+     #~(job #$sched-spec #$cmd))))
+
+(define planisphere-report-service-type
+  (service-type
+   (name 'planisphere-report)
+   (extensions
+    (list (service-extension mcron-service-type planisphere-report-jobs)))
+   (default-value (planisphere-report-configuration))
+   (description "Periodically run @command{planisphere-report} to update the OIT endpoint database.")))
-- 
2.21.0

compared to the service in my channel

(define-module (guix-at-duke services endpoint-management)
   #:use-module (gnu services)
   #:use-module (gnu services mcron)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix-at-duke packages endpoint-management)
   #:export (planisphere-report-configuration
 	    planisphere-report-configuration?
 	    planisphere-report-service-type))

(define-record-type* <planisphere-report-configuration>
   planisphere-report-configuration make-planisphere-report-configuration
   planisphere-report-configuration?
   (package planisphere-report-package
 	   (default planisphere-report))
   (schedule planisphere-report-schedule
 	    (default '(quote (next-minute-from (next-hour '(0 12)) (list (random 60)))))))

(define (planisphere-report-jobs config)
   (let ((sched-spec (planisphere-report-schedule config))
 	(cmd (file-append (planisphere-report-package config) "/bin/planisphere-report")))
     (list
      #~(job #$sched-spec #$cmd))))

(define planisphere-report-service-type
   (service-type
    (name 'planisphere-report)
    (extensions
     (list (service-extension mcron-service-type planisphere-report-jobs)))
    (default-value (planisphere-report-configuration))
    (description "Periodically run @command{planisphere-report} to update the OIT endpoint database.")))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-13  0:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-10 19:47 Problem with building service from my channel Jack Hill
2019-06-11 10:31 ` Ludovic Courtès
2019-06-11 13:38   ` Jack Hill
2019-06-13  0:47     ` Jack Hill

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.