From: ng0@n0.is
To: 30351@debbugs.gnu.org
Subject: [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase.
Date: Sun, 04 Feb 2018 22:33:23 +0000 [thread overview]
Message-ID: <87inbcgzbg.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <874lmwwkgn.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 04 Feb 2018 15:47:36 -0500")
On Sun, 04 Feb 2018, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> Hello!
>
> As a follow up to my previous patch to mcron2, this completes the wrap
> phases and fix a small issue where the mcron modules were installed to
> share/guile/site/2.0 instead of 2.2.
Looks promising, this could fix the issue I still have.
I reconfigured the system and it looks good to me. At least the
no errors are being displayed.
> For those using dyndns services, a job like the following should now
> work without having to propagate Guile or GnuTLS in your user/system
> profile[0]:
>
> --8<---------------cut here---------------start------------->8---
> ;;; Secrets defined as variables prefixed by "sec-".
> (include "/abs/path/to/your/secrets.scm")
>
> (define duckdns-job
> ;; Update personal domain IP every 5 minutes.
> #~(job '(next-minute (range 0 60 5))
> (lambda ()
> (use-modules (web client))
> (http-get
> (string-append
> "https://www.duckdns.org/update?domains=apteryx&token="
> #$sec-dyndns-token "&ip=")))))
>
> (operating-system
> ...
> (services
> (cons*
> (mcron-service (list duckdns-job))
> ...
> --8<---------------cut here---------------end--------------->8---
>
> I had tested my previous patch as a user (where Guile and GnuTLS were
> installed), so it was working, but after testing from the "real" herd
> service (which runs as root), it was failing, not finding the (web
> client) and GnuTLS modules.
>
> The attached patch fixes that.
>
> From 385343b1370d87e6104ebe2ef473bf2d1e31f2f2 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Sun, 4 Feb 2018 14:05:40 -0500
> Subject: [PATCH] gnu: mcron2: Correct and enhance the wrap phase.
>
> * gnu/packages/guile.scm (mcron2)[inputs]: Rename "guile-2.2" to just "guile".
> [phases]: Install mcron2 modules to guile/site/2.2 instead of guile/site/2.0.
> Add Guile 2.2 and GnuTLS modules to the wrap phase.
> ---
> gnu/packages/guile.scm | 43 ++++++++++++++++++++++++++-----------------
> 1 file changed, 26 insertions(+), 17 deletions(-)
>
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index 3bc18ffdd..37e6703fa 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -64,6 +64,7 @@
> #:use-module (gnu packages sdl)
> #:use-module (gnu packages maths)
> #:use-module (gnu packages image)
> + #:use-module (gnu packages tls)
> #:use-module (gnu packages version-control)
> #:use-module (gnu packages xdisorg)
> #:use-module (gnu packages xorg)
> @@ -632,7 +633,8 @@ format is also supported.")
> ("texinfo" ,texinfo)
> ("help2man" ,help2man)))
> (inputs
> - `(("guile-2.2" ,guile-2.2)
> + `(("guile" ,guile-2.2)
> + ("gnutls" ,gnutls) ;for the wrap-mcron phase
> ,@(srfi-1:alist-delete "guile" (package-inputs mcron))))
> (arguments
> `(#:modules ((ice-9 match) (ice-9 ftw)
> @@ -645,6 +647,7 @@ format is also supported.")
> (add-after 'unpack 'use-guile-2.2
> (lambda _
> (substitute* "configure.ac"
> + (("guile/site/2.0") "guile/site/2.2")
> (("PKG_CHECK_MODULES\\(\\[GUILE\\],.*$")
> "PKG_CHECK_MODULES([GUILE], [guile-2.2])\n"))
> #t))
> @@ -652,22 +655,28 @@ format is also supported.")
> (lambda _
> (invoke "autoreconf" "-vfi")))
> (add-after 'install 'wrap-mcron
> - (lambda* (#:key outputs #:allow-other-keys)
> - ;; Wrap the 'mcron' command to refer to the right
> - ;; modules.
> - (let* ((out (assoc-ref outputs "out"))
> - (bin (string-append out "/bin"))
> - (site (string-append
> - out "/share/guile/site")))
> - (match (scandir site)
> - (("." ".." version)
> - (let ((modules (string-append site "/" version)))
> - (wrap-program (string-append bin "/mcron")
> - `("GUILE_LOAD_PATH" ":" prefix
> - (,modules))
> - `("GUILE_LOAD_COMPILED_PATH" ":" prefix
> - (,modules)))
> - #t))))))))))))
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + ;; Wrap the 'mcron' command to refer to the right modules. We
> + ;; also include Guile 2.2 modules and GnuTLS, so that Guile
> + ;; libraries can be used in mcron jobs without having to
> + ;; propagate those in a user profile.
> + (let* ((site-dir "/share/guile/site/2.2")
> + (ccache-dir "/lib/guile/2.2/ccache")
> + (mcron (assoc-ref outputs "out"))
> + (mcron-bin (string-append mcron "/bin/mcron"))
> + (mcron-modules (string-append mcron site-dir))
> + (guile (assoc-ref inputs "guile"))
> + (guile-modules (string-append guile site-dir))
> + (guile-ccache (string-append guile ccache-dir))
> + (gnutls (assoc-ref inputs "gnutls"))
> + (gnutls-modules (string-append gnutls site-dir))
> + (gnutls-ccache (string-append gnutls ccache-dir)))
> + (wrap-program mcron-bin
> + `("GUILE_LOAD_PATH" ":" prefix
> + (,mcron-modules ,guile-modules ,gnutls-modules))
> + `("GUILE_LOAD_COMPILED_PATH" ":" prefix
> + (,mcron-modules ,guile-ccache ,gnutls-ccache)))
> + #t)))))))))
>
> (define-public guile-ics
> (package
--
ng0 :: https://ea.n0.is
A88C8ADD129828D7EAC02E52E22F9BBFEE348588 :: https://ea.n0.is/keys/
next prev parent reply other threads:[~2018-02-04 22:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-04 20:47 [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase Maxim Cournoyer
2018-02-04 22:33 ` ng0 [this message]
2018-02-09 10:09 ` Ludovic Courtès
2018-03-12 0:23 ` bug#30351: " Maxim Cournoyer
2018-03-12 9:08 ` [bug#30351] " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87inbcgzbg.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me \
--to=ng0@n0.is \
--cc=30351@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).