From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gFfNLaXkVmcFeQEAe85BDQ:P1 (envelope-from ) for ; Mon, 09 Dec 2024 12:37:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id gFfNLaXkVmcFeQEAe85BDQ (envelope-from ) for ; Mon, 09 Dec 2024 13:37:57 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bZt+ClQt; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733747861; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=z1Tl6xFUuENnMNfom6vZLFQhpEYwXbmKB5VD+Wp9G3I=; b=YlFugDDUtV4pDnzFH8a36UKwidc4nzy050N2vfr/kBSP64OaHL0pbx/Kf1wrfvWCNtUuhg RsLNnGXD+jXOnjtxX2PYXvgWQwscllU/rIwzgjzB3L1nXiQ5uWpGb2c4V9igyc0B15K6ds D3ZMSGK7bH4+DBEZbNPdxbxiBMGfc2z62fzbXqjMYrdr8Dl+iZ9hMfvNfVvpmukkyi6FBH Q2V9mC5l9yNwo35izMWL4DyTI5otj3th/HZJCfT2v2VLqUELnQZ6tXPi+kxwSky71n1EVh 7SAEUO9cDrffw5gymfbsDCdu/WEN1dDfFHpCZeleVRmmLTZMG3/sP0uk2v+D8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bZt+ClQt; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733747861; a=rsa-sha256; cv=none; b=KsvddIb/CBA3g7/kiGXg2M+CJ6gEpXeTDh3QeT5CK6vwHHsM6wOSmTLMVCMW2S72mG7Mk/ 6367zpicMTLi/isx9Qngz53kZKZoQWHkuo3aESwkGXNHrcPD7xtgVY5sUfVNxX9lItMWEP 7du7RMV0PkmtPwE6Qzf628/ypO3KLJunQVvMEntBzpzKS0k14TgddKn3WldnsNhLCZQc/5 OE0r6wZradHcR+60lazTqzs5ckKk/x+8B4ucn3VY5BcyT28GmNN/rt46WHkXFhxUnKnalX w9uER1ZRh3A6OIyoMf1Y227K2BPa50KpLarM1x8pIo+Apgte7rRDYWjIn45Xtw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0213D8347B for ; Mon, 09 Dec 2024 13:37:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKd0U-0003bM-3V; Mon, 09 Dec 2024 07:36:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKd0S-0003b2-AB for help-guix@gnu.org; Mon, 09 Dec 2024 07:36:56 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKd0Q-0007Fz-2H for help-guix@gnu.org; Mon, 09 Dec 2024 07:36:56 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1FC43240101 for ; Mon, 9 Dec 2024 13:36:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1733747808; bh=N4ywNJktI3JHW7yvL5QehoK1pEvsSthpKG0NRhTKM68=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=bZt+ClQtiKfC3EWM0tZLvCsquKFl2CXXrg0BxuR/NuIJEUunVSim7mDa5MNMHeYgY rezXrU+PbOThgcXC/62A3khd83+btVtO250Fm2d5/7UqUIB8RDQQWpz0f6CmwJ11FO INc1X/ffeJj38X+zagxP2DeZJYtwgsOQH9BQOHAKA4zx0becB8bcp1RwjuwQ7W1Nbd /X/ZEj5+BPzBH1LTTJIOjit9p1cGBqzR9lWLIvfNpG4rKEex4PhrqL1QXkkW9g+tJA ZN4pEHM/GGnGTwdLo5RmF3clrKhT5GPcMDUQhhrVjCmFXetuweKLN3nRH52RqqF53E YskAtm7Tt01Ag== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Y6Lvz5TkVz9rxF for ; Mon, 9 Dec 2024 13:36:47 +0100 (CET) From: Yulran To: help-guix@gnu.org Subject: Nested gexps in mcron job definitions Date: Mon, 09 Dec 2024 12:36:45 +0000 Message-ID: <87o71lc9sy.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yulran@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -5.38 X-Spam-Score: -5.38 X-Migadu-Queue-Id: 0213D8347B X-TUID: IZNcdMp5ghXW Hi guix, I'm having trouble with nesting g-expressions when defining a mcron job. I want the job to run the same "mastodon-archive" commands for several accounts, so I define a list of accounts and use 'map' to build the complete command. This works well when there are only strings involved, but I can't make it work with gexps. Here's a simplified example with only strings: --8<---------------cut here---------------start------------->8--- (define succeeding-job (let* ((accounts '("account1" "account2")) (cmd (apply string-append (map (lambda (acct) (string-append "mastodon-archive archive " acct "; ")) accounts)))) #~(job '(next-second (range 1 61 10)) (lambda () (system (string-append "echo '" #$cmd "'"))) "mastodon-archive"))) --8<---------------cut here---------------end--------------->8--- The job succeeds and the mcron log prints as expected "mastodon-archive archive account1; mastodon-archive archive account2;". Now to use the full path to the mastodon-archive binary, cmd must be a gexp: --8<---------------cut here---------------start------------->8--- (define failing-job (let* ((accounts '("account1" "account2")) (cmd #~(apply string-append (map (lambda (acct) (string-append #$mastodon-archive "/bin/mastodon-archive archive " acct "; ")) #$accounts)))) #~(job '(next-second (range 1 61 10)) (lambda () (system (string-append "echo '" #$cmd "'"))) "mastodon-archive"))) --8<---------------cut here---------------end--------------->8--- The home configuration builds fine, but the mcron job fails with the error: (wrong-type-arg #f Wrong type to apply: ~S (account1) (account1)) I played around with gexp-ing the string-append in the lambda, ungexp-ing acct, and trying every other combination of gexp/ungexp I could think of, but I could only make it worse. Any idea what I'm doing wrong?