From unknown Fri Sep 05 18:47:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30351 <30351@debbugs.gnu.org> To: bug#30351 <30351@debbugs.gnu.org> Subject: Status: [PATCH] gnu: mcron2: Correct and enhance the wrap phase. Reply-To: bug#30351 <30351@debbugs.gnu.org> Date: Sat, 06 Sep 2025 01:47:11 +0000 retitle 30351 [PATCH] gnu: mcron2: Correct and enhance the wrap phase. reassign 30351 guix-patches submitter 30351 Maxim Cournoyer severity 30351 normal tag 30351 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 15:47:53 2018 Received: (at submit) by debbugs.gnu.org; 4 Feb 2018 20:47:53 +0000 Received: from localhost ([127.0.0.1]:57372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiRCa-0001Ps-OI for submit@debbugs.gnu.org; Sun, 04 Feb 2018 15:47:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiRCZ-0001Pd-E0 for submit@debbugs.gnu.org; Sun, 04 Feb 2018 15:47:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiRCS-0007iT-Qx for submit@debbugs.gnu.org; Sun, 04 Feb 2018 15:47:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eiRCS-0007iP-Ml for submit@debbugs.gnu.org; Sun, 04 Feb 2018 15:47:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiRCR-0006wj-1l for guix-patches@gnu.org; Sun, 04 Feb 2018 15:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiRCN-0007h8-VT for guix-patches@gnu.org; Sun, 04 Feb 2018 15:47:43 -0500 Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]:38057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiRCN-0007gs-N5 for guix-patches@gnu.org; Sun, 04 Feb 2018 15:47:39 -0500 Received: by mail-it0-x235.google.com with SMTP id k6so13620272ita.3 for ; Sun, 04 Feb 2018 12:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=W0SBbESWnThbefzQtUCLp8aYPQT457qt2mysZg5+dYk=; b=hyY5MxrVmddorpS2OoUaoYudIS1cHH4r4Xx/U0ETgXaKZ1O5YKRX4D+e+w7WMyl5M7 Pd0HwjB6poJ08ZF/nKRk3s5OzG/bFG1KTW4NPC9ZnosvI32oypKvFCbfGI90E5n1r2iY 2K8UVmFseVMDJ018LnaVX3aHrHMHp/X+al7OcMkzvMeyCcTmcgryr9ArdfG9Ap3dErYG N8+A/PTPRoNTEOtCPUA5hs24If5iIGwxNNacom5iNu6Qfl/ymSXeWBCybqYGbr2BMQDj SE4k0WnrRiqPJ8m4+nYBggRLQNQBWKSU9PWUho492d4xqi8g5nS2GnxDA5hbgyg+/YJp KEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=W0SBbESWnThbefzQtUCLp8aYPQT457qt2mysZg5+dYk=; b=Pjw4EJCwIrJck6P27o6MxbVkOtgfWsOOmwdh/JuXgAUbstIOmSVKuVOrX6x7tjHdno Sho+TFq+DQns3na5MiszzNry7M9OMVPFgKJuUrGXzT64a8+OMgP+Ec2SklzGpMHa5Q+R xbsX5tOXV0wc3bkX/R43WR5wyN+s8ixGWRInbdH9YKmJLNtIRTt3r4Dn2aXha2m6w2Jv BtDck/5po/NYGnulU9K0+PUzt7Cva8ahqYQyvd7ISdQOie5lJ75SGpZKfBpNBzEOXdNe oeun/AtUcn8CV6QmkmROOMc37QRrbCJS4MPMJExltbqD7kIp/O1KOicUElrjXFfBYX+h gEsw== X-Gm-Message-State: APf1xPBGw3OMCaNVBA3aNXz4IRb0da+gS3c6AWLioJNl+QDOmBjbBt7t +aoqKPk9Ntgzu1HE4LStMJJkbw== X-Google-Smtp-Source: AH8x2253AKMSH+D1xIu1s8pFQ87mbybmzTizcwQRKFgPOQ/RTI8TelVY5UR+9SrM7AIyIw2l86F+Nw== X-Received: by 10.36.5.81 with SMTP id 78mr2641478itl.135.1517777258542; Sun, 04 Feb 2018 12:47:38 -0800 (PST) Received: from apteryx ([45.72.232.234]) by smtp.gmail.com with ESMTPSA id j30sm4183317ioi.55.2018.02.04.12.47.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Feb 2018 12:47:37 -0800 (PST) From: Maxim Cournoyer To: guix-patches Subject: [PATCH] gnu: mcron2: Correct and enhance the wrap phase. Date: Sun, 04 Feb 2018 15:47:36 -0500 Message-ID: <874lmwwkgn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain 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. 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-mcron2-Correct-and-enhance-the-wrap-phase.patch >From 385343b1370d87e6104ebe2ef473bf2d1e31f2f2 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer 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 -- 2.16.0 --=-=-= Content-Type: text/plain Thank you, Maxim [0] A note of caution: secrets managed that way are not that secret: they are visible in the derived job script (world readable under /gnu/store). You might want to prefer keeping your mcron jobs in your $HOME for better security. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 17:33:46 2018 Received: (at 30351) by debbugs.gnu.org; 4 Feb 2018 22:33:46 +0000 Received: from localhost ([127.0.0.1]:57448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiSr3-0003rs-M9 for submit@debbugs.gnu.org; Sun, 04 Feb 2018 17:33:46 -0500 Received: from aibo.runbox.com ([91.220.196.211]:43036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiSr1-0003ri-4o for 30351@debbugs.gnu.org; Sun, 04 Feb 2018 17:33:43 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eiSqz-0006hD-KX for 30351@debbugs.gnu.org; Sun, 04 Feb 2018 23:33:41 +0100 Received: from dslb-092-072-208-126.092.072.pools.vodafone-ip.de ([92.72.208.126] helo=localhost) by mailfront11.runbox.com with esmtpsa (uid:892961 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eiSqe-0007yI-KI for 30351@debbugs.gnu.org; Sun, 04 Feb 2018 23:33:20 +0100 From: ng0@n0.is To: 30351@debbugs.gnu.org Subject: Re: [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase. In-Reply-To: <874lmwwkgn.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 04 Feb 2018 15:47:36 -0500") References: <874lmwwkgn.fsf@gmail.com> Date: Sun, 04 Feb 2018 22:33:23 +0000 Message-ID: <87inbcgzbg.fsf@abyayala.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sun, 04 Feb 2018, Maxim Cournoyer 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 > 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/ From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 05:09:51 2018 Received: (at 30351) by debbugs.gnu.org; 9 Feb 2018 10:09:52 +0000 Received: from localhost ([127.0.0.1]:34689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ek5ct-0001x0-MJ for submit@debbugs.gnu.org; Fri, 09 Feb 2018 05:09:51 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:46404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ek5cr-0001ws-9R for 30351@debbugs.gnu.org; Fri, 09 Feb 2018 05:09:49 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id BF04510BF9; Fri, 9 Feb 2018 11:09:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1ArQw_byf3d6; Fri, 9 Feb 2018 11:09:48 +0100 (CET) Received: from ribbon (unknown [193.50.110.130]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D17B68421; Fri, 9 Feb 2018 11:09:47 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Maxim Cournoyer Subject: Re: [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase. References: <874lmwwkgn.fsf@gmail.com> Date: Fri, 09 Feb 2018 11:09:47 +0100 In-Reply-To: <874lmwwkgn.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 04 Feb 2018 15:47:36 -0500") Message-ID: <87h8qq4gpg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30351 Cc: 30351@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hi Maxim, Maxim Cournoyer skribis: > 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. Good catch. I=E2=80=99ve committed that change separately. BTW, I encourage you to submit changes to bug-mcron@gnu.org. Mcron is now maintained by Mathieu Lirzin, who is familiar with current Guile and certainly interested in receiving improvements like this. (Another thing that should be done would be install .go files in $libdir/guile/2.2/site-ccache.) > 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]: [...] >>>From 385343b1370d87e6104ebe2ef473bf2d1e31f2f2 Mon Sep 17 00:00:00 2001 > From: Maxim Cournoyer > 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 "gu= ile". > [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. [...] > (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 Gui= le > + ;; 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))))))))) A couple of issues here: the =E2=80=98scandir=E2=80=99 trick above allowed = us to not hard-code =E2=80=9C2.2=E2=80=9D. I think it=E2=80=99d be nice to try to pr= eserve such things; it=E2=80=99ll be less pain down the road. Second issue is about adding GnuTLS to the search path: it=E2=80=99s not the right place for that. What if someone wants Guile-JSON? And Guile-Git? And=E2=80=A6 You get the idea. :-) Instead I=E2=80=99d suggest writing your mcron job along these lines: #~(begin (add-to-load-path (string-append #+gnutls "/share/guile/site/" (effective-version))) (use-modules (web client)) =E2=80=A6) (See (guix download) for an example of this hack.) The extra boilerplate is admittedly not great, so I=E2=80=99d like to add a =E2=80=98with-extensions=E2=80=99 or =E2=80=98with-imported-packages=E2=80= =99 form that would be like =E2=80=99with-imported-modules=E2=80=99 but for Guile =E2=80=9Cextensions= =E2=80=9D like GnuTLS. Last thing: it=E2=80=99s not necessary to put Guile=E2=80=99s own module di= rectories in the search path. They=E2=80=99re already there by default. So overall I think I=E2=80=99m arguing for the status quo. Would that work= for you? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 11 20:23:56 2018 Received: (at 30351-done) by debbugs.gnu.org; 12 Mar 2018 00:23:56 +0000 Received: from localhost ([127.0.0.1]:55852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evBFs-0003WN-GK for submit@debbugs.gnu.org; Sun, 11 Mar 2018 20:23:56 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:43842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evBFr-0003WA-04 for 30351-done@debbugs.gnu.org; Sun, 11 Mar 2018 20:23:55 -0400 Received: by mail-io0-f174.google.com with SMTP id l12so9401563ioc.10 for <30351-done@debbugs.gnu.org>; Sun, 11 Mar 2018 17:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=/+akq3qfyx7iNQnkKJjmbBd+z0i/Uuf2fQQTigJr/os=; b=UmLdJzcJfMgsi08FGX3gRm4LNRNQIstHHIvmslZnysNsMXLwO8RnpZLCdc4OJqcWrX w7lxY3YQsNsXmjLMrOWNNGR6iFbCXotKJ0Lj6073+9d6Ivj0ORMA9dXePwXdRq9G69lr w9Rv86/T2eueotOWMkzGkzEqJWs3BaFBZtKOsXBn32OBBhR0zXmGH855bFkO3IEigdsj v6zGQZroJcBmiu5vwRPxDfAGpzb6xxUotOjGKZR5V6FqKSmQXHn/2PXwOCCB1h8sQbbY ImHZQzW+/XJvOHf/wHieT9mJpnF9yYT+hn9ym553fu9Sk02u+JigW50EM4aNdvPSdcbX 03FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=/+akq3qfyx7iNQnkKJjmbBd+z0i/Uuf2fQQTigJr/os=; b=EsFC0D8vrUKWBvbKIasMtNFl9wR48NQsHvSwFzhn0ua7Rbvc9Gn6r2NEZc3SSndpiO MWZN8yboY3niymvxdNE1qASllAADa5JZrp1eZ2OyD9tUQgw4Qk5yuLoLkS1Ma3QlST5a kvuPY43HPJKRIyHLiEfBOaEEHVo9QgKukSqSlwVIQFp1Xo5a8v1SfcgD+68h1/6iR/If 0cPIZNMQJGxcVjDUApxoZfxBYBQ+NWW4zEfJj4U3VAZY/HaPjKe2pB8vWBvk+xyOxJad BwWaCzSzg1oo9lo9iltcHI18JH1olwTh4neeFktJsNUCynUQs94tz+uD61fZmQcOLksd eZ1g== X-Gm-Message-State: AElRT7ENI0X0ZjmWz4zYGMSyxVslo+5LvMysy5NzOYCLcYSqS3Tx3zql VSvDEZaK4YCC7rLBL9cAkwJSZw== X-Google-Smtp-Source: AG47ELs4G73WENBev4zaIjCTZ8nSDtIOCDl64ZS1CpfQHP/M+VUwwy3J0t+GOSJVjDd3skbjLE/SFg== X-Received: by 10.107.62.134 with SMTP id l128mr6729137ioa.199.1520814229035; Sun, 11 Mar 2018 17:23:49 -0700 (PDT) Received: from apteryx ([45.72.232.234]) by smtp.gmail.com with ESMTPSA id c139sm4041476ioe.5.2018.03.11.17.23.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Mar 2018 17:23:48 -0700 (PDT) From: Maxim Cournoyer To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase. References: <874lmwwkgn.fsf@gmail.com> <87h8qq4gpg.fsf@gnu.org> Date: Sun, 11 Mar 2018 20:23:47 -0400 In-Reply-To: <87h8qq4gpg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 09 Feb 2018 11:09:47 +0100") Message-ID: <87d10af8fg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30351-done Cc: 30351-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Hello! ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> 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. > > Good catch. I=E2=80=99ve committed that change separately. > > BTW, I encourage you to submit changes to bug-mcron@gnu.org. Mcron is > now maintained by Mathieu Lirzin, who is familiar with current Guile and > certainly interested in receiving improvements like this. > > (Another thing that should be done would be install .go files in > $libdir/guile/2.2/site-ccache.) It's already all fixed upstream! I verified myself. I guess we could poke Mathieu for a new release ;). >> 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]: > > [...] > >>>>From 385343b1370d87e6104ebe2ef473bf2d1e31f2f2 Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> 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 "g= uile". >> [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. > > [...] > >> (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 module= s. We >> + ;; also include Guile 2.2 modules and GnuTLS, so that Gu= ile >> + ;; 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))))))))) > > A couple of issues here: the =E2=80=98scandir=E2=80=99 trick above allowe= d us to not > hard-code =E2=80=9C2.2=E2=80=9D. I think it=E2=80=99d be nice to try to = preserve such things; > it=E2=80=99ll be less pain down the road. > > Second issue is about adding GnuTLS to the search path: it=E2=80=99s not = the > right place for that. What if someone wants Guile-JSON? And Guile-Git? > And=E2=80=A6 You get the idea. :-) > > Instead I=E2=80=99d suggest writing your mcron job along these lines: > > #~(begin > (add-to-load-path (string-append #+gnutls "/share/guile/site/" > (effective-version))) > (use-modules (web client)) > =E2=80=A6) > > (See (guix download) for an example of this hack.) Thanks for sharing this idea; it makes sense. I hadn't thought about manipulating the load-path at run time. > The extra boilerplate is admittedly not great, so I=E2=80=99d like to add= a > =E2=80=98with-extensions=E2=80=99 or =E2=80=98with-imported-packages=E2= =80=99 form that would be like > =E2=80=99with-imported-modules=E2=80=99 but for Guile =E2=80=9Cextensions= =E2=80=9D like GnuTLS. I don't think it's that bad as it is. Any enhancements welcome, of course :). > Last thing: it=E2=80=99s not necessary to put Guile=E2=80=99s own module = directories in > the search path. They=E2=80=99re already there by default. Tried, and indeed it works without it. Thanks. I must have gotten confused somewhere. > So overall I think I=E2=80=99m arguing for the status quo. Would that wo= rk for > you? I'm happy with status quo as well. Thanks for lending your sharp eyes to this review! Maxim From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 12 05:08:07 2018 Received: (at 30351-done) by debbugs.gnu.org; 12 Mar 2018 09:08:07 +0000 Received: from localhost ([127.0.0.1]:55978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evJR8-00020x-PT for submit@debbugs.gnu.org; Mon, 12 Mar 2018 05:08:06 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:49368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evJR7-00020n-6c for 30351-done@debbugs.gnu.org; Mon, 12 Mar 2018 05:08:05 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 0B2BF1234A; Mon, 12 Mar 2018 10:08:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rxoTfJUiHgKf; Mon, 12 Mar 2018 10:08:03 +0100 (CET) Received: from ribbon (vpn-0-27.aquilenet.fr [IPv6:2a0c:e300:4:27::]) by hera.aquilenet.fr (Postfix) with ESMTPSA id AD0C812349; Mon, 12 Mar 2018 10:08:02 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Maxim Cournoyer Subject: Re: [bug#30351] [PATCH] gnu: mcron2: Correct and enhance the wrap phase. References: <874lmwwkgn.fsf@gmail.com> <87h8qq4gpg.fsf@gnu.org> <87d10af8fg.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Vent=C3=B4se?= an 226 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 12 Mar 2018 10:08:02 +0100 In-Reply-To: <87d10af8fg.fsf@gmail.com> (Maxim Cournoyer's message of "Sun, 11 Mar 2018 20:23:47 -0400") Message-ID: <87a7vdslu5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30351-done Cc: 30351-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hi Maxim, Maxim Cournoyer skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hi Maxim, >> >> Maxim Cournoyer skribis: >> >>> 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. >> >> Good catch. I=E2=80=99ve committed that change separately. >> >> BTW, I encourage you to submit changes to bug-mcron@gnu.org. Mcron is >> now maintained by Mathieu Lirzin, who is familiar with current Guile and >> certainly interested in receiving improvements like this. >> >> (Another thing that should be done would be install .go files in >> $libdir/guile/2.2/site-ccache.) > > It's already all fixed upstream! I verified myself. I guess we could > poke Mathieu for a new release ;). Definitely! It=E2=80=99s great that Mathieu has taken care of all this. >> So overall I think I=E2=80=99m arguing for the status quo. Would that w= ork for >> you? > > I'm happy with status quo as well. Thanks for lending your sharp eyes to > this review! Heheh, you=E2=80=99re welcome. I hope I=E2=80=99ll get around to adding th= at =E2=80=98with-extensions=E2=80=99 thing soonish, because =E2=80=98add-to-lo= ad-path=E2=80=99 is not as convenient as we=E2=80=99d like. Thanks, Ludo=E2=80=99. From unknown Fri Sep 05 18:47:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 09 Apr 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator