From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#36430: mcron would benefit from a better way to test jobs Date: Mon, 08 Jul 2019 11:54:35 +0200 Message-ID: <87wogsg8bo.fsf@gnu.org> References: <87h87xapnp.fsf@gnu.org> <325C9E85-468F-4EE3-93CC-C9F88D10E9CE@vllmrt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53722) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkQMR-0004Rq-8q for bug-guix@gnu.org; Mon, 08 Jul 2019 05:55:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkQMQ-0000hg-6u for bug-guix@gnu.org; Mon, 08 Jul 2019 05:55:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkQMQ-0000hS-3s for bug-guix@gnu.org; Mon, 08 Jul 2019 05:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkQMP-0004eo-UT for bug-guix@gnu.org; Mon, 08 Jul 2019 05:55:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <325C9E85-468F-4EE3-93CC-C9F88D10E9CE@vllmrt.net> (Robert Vollmert's message of "Mon, 8 Jul 2019 09:18:32 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Robert Vollmert Cc: 36430@debbugs.gnu.org Hi, Robert Vollmert skribis: >> On 7. Jul 2019, at 16:24, Ludovic Court=C3=A8s wrote: >>=20 >> Hi Robert, >>=20 >> Robert Vollmert skribis: >>=20 >>> Defined a mcron job in config.scm scheduled to run once a day, >>> with a scheme expression. How do I test this? >>>=20 >>> herd schedule mcron lists the job as merely a =E2=80=9CLambda expressio= n=E2=80=9D. >>> I learned how to give it a descriptive name, but still there=E2=80=99s >>> no script linked that I can run by hand. >>=20 >> Commit 89fdd9ee0cc8817283449b33a8c1a2604c575c7e changes the rottlog job >> in a simple way so we see an actual command rather than =E2=80=9CLambda >> expression=E2=80=9D. I would recommend using this style to improve >> transparency. > > I understand that passing an executable works better. But that also > loses the feature of allowing to write a script in place advertised by > the lambda variant. In Guix, if you write: #~(job =E2=80=A6 #$(program-file "do-something" #~(begin =E2=80=A6))) instead of: #~(job =E2=80=A6 (lambda () =E2=80=A6)) you=E2=80=99re still writing Scheme code, and the result is pretty much the same. Now, from a pure mcron viewpoint (if you were to use it outside Guix), I agree that procedures are handled in a suboptimal way. Mcron should simply display the procedure object, which includes its source location info. Aternately it could display its source location info as obtained with =E2=80=98program-source=E2=80=99 if that helps readability: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(system vm program) scheme@(guile-user)> (program-source derivation (program-code derivation)) $6 =3D (2780 "guix/derivations.scm" 877 . 17) --8<---------------cut here---------------end--------------->8--- > I find that kind of =E2=80=9Cfeature that doesn=E2=80=99t actually work= =E2=80=9D to be quite > painful. > > A way to get the best of both worlds (within guix) would be to use > program-file / gexp, so maybe that=E2=80=99s what should be advertised in= the > guix manual? Yes, definitely. > At this stage, there=E2=80=99s just too many small hacking sessions requi= red > all over the place :). I=E2=80=99ll stick with filing bug reports for the > clear pain points if that=E2=80=99s ok? Sure, definitely! It=E2=80=99s good to have all these pain points filed, a= nd I think many can be addressed quite easily, so that=E2=80=99ll help us improve things gradually. Thanks, Ludo=E2=80=99.