From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GKX9IVkX8GF3BAEAgWs5BA (envelope-from ) for ; Tue, 25 Jan 2022 16:29:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2DiKHlkX8GHA/wAAauVa8A (envelope-from ) for ; Tue, 25 Jan 2022 16:29:29 +0100 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 4927843B11 for ; Tue, 25 Jan 2022 16:29:29 +0100 (CET) Received: from localhost ([::1]:44580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCNlA-0003os-DC for larch@yhetil.org; Tue, 25 Jan 2022 10:29:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCMJl-0008Rf-3E for guix-devel@gnu.org; Tue, 25 Jan 2022 08:57:05 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCMJi-0002eq-FL for guix-devel@gnu.org; Tue, 25 Jan 2022 08:57:04 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B3FCD316; Tue, 25 Jan 2022 14:56:54 +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 Kh7RhfekKmS7; Tue, 25 Jan 2022 14:56:54 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id AFF129E; Tue, 25 Jan 2022 14:56:53 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Simon Streit Subject: Re: WSDD Service Module References: <87ee4xrva3.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 =?utf-8?Q?Pluvi=C3=B4se?= an 230 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: Tue, 25 Jan 2022 14:56:53 +0100 In-Reply-To: (Simon Streit's message of "Tue, 25 Jan 2022 13:41:51 +0100") Message-ID: <871r0vncka.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: B3FCD316 X-Spamd-Result: default: False [0.73 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.83)[subject]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] Received-SPF: softfail client-ip=185.233.100.1; envelope-from=ludo@gnu.org; helo=hera.aquilenet.fr X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643124569; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qBDx8THK9XCc78XjtC6UNWGVB41BmAP+7f+iWuwbMiU=; b=JJF0rApl+hQFIZb2ErFQOpcz7NzruaHAFBCLe2gEu7DwrowcQrwCX/Z0sbYUqaMAa4tGKg tQ9oZQ5BPqjRUtU8TNSJU6tPl3p5sjReC/a46Wsv0BeT8fmTx7wAG5myI6K4riN0ZgLB8M QKuWpkVlNkceS2a75a1GM53wVP2P0G7HeQGZZ70NEJfdPfznZlOzp4wmRVMMItXl2PQ7NF ekNOtRi+Xyj+tgdlcwByjpRlqp/wp7weabzfn4ZEF7yP809F25K2ELC2xZKkGu8RfAnBGL uidzhGUGzteGD8SOaJXn1FuPwlAUZdxwyPFoShvsHqDlStzSDlclg9a21nEIwA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643124569; a=rsa-sha256; cv=none; b=d2opJtJiRRQZZoxuy+2TxtAiMK7X1DNz4KCwlmNCliSvb2YnWc7ONi+drMrcAvhsLYAPSv lwUEtaRTYuN13loMXXc8Zcy/A1YwtgRv1mx5Hg11HQDbumnIaeLnOYHYWYN8/bEjP8/0Mq fwO6FbGXMwnSEJIEk7X3ZQ7kk2gK51MBh9F4b8mw8O06vKGyd4rRjWelL0PppDCk9eMXtl q3qQhf7wEUUS6GCCQuyBma6n05DU6vaqVq3Y6IMr7rfJBBYyHQZUJhqSqQKvK3kQSXZt3y fH4UVv9KttuSGgb1JCkViKeU8aH1QRt8XBIZRXdgt9Knx+w+uTeYUwoYTlcowg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4927843B11 X-Spam-Score: -4.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: zprTh7X8RDFM Hi, (+Cc: guix-devel.) Simon Streit skribis: > Ludovic Court=C3=A8s writes: >> My understanding is that you intend the =E2=80=98interface=E2=80=99 fiel= d to be either >> #f or a string, is that right? > > I think it rather be a list of strings, Then I recommend calling it =E2=80=98interfaces=E2=80=99 (plural). >> When you write: >> >> (interface) >> >> that means: =E2=80=9Ccall the procedure bound to =E2=80=98interface=E2= =80=99, passing it zero >> arguments=E2=80=9D. However, if =E2=80=98interface=E2=80=99 is a string= , you cannot call it, so >> you get a wrong-type-to-apply error. >> >> Likewise, =E2=80=98for-each=E2=80=99 expects its second argument to be a= list. But >> here, =E2=80=98interface=E2=80=99 is supposedly a string, not a list, so= if you do: >> >> (for-each (lambda =E2=80=A6) interface) >> >> you=E2=80=99ll get a wrong-type-argument error. > > So I changed it, that interface is usually an empty list now, and with > for-each I'd like to have it expanded. Good thing is, I've gotten at > least a step further, but only after hard coding the list as an argument > in the for-each expression. So it should work? It still doesn't. And > I still don't understand how it is somehow not passed as a list > properly.=20=20 > > One thing I noticed, after hard coding the argument, the procedure is > not properly expanded in the constructor. How come? This is the output > in the service file: > > (make-forkexec-constructor > (list "/gnu/store/6jpn21wnnyz59ii634hfbk34yy48nxrq-wsdd-0.6.4/bin/wsdd" = "--hoplimit" "1" for-each > (lambda > (arg) > (format #t "--interface ~s " > (arg))) > (interface) > "--workgroup" "WORKGROUP") > #:user "wsdd" #:group "wsdd" #:log-file "/var/log/wsdd.log") This reads =E2=80=9C(interface)=E2=80=9D, meaning that (1) =E2=80=98interfa= ce=E2=80=99 must be a procedure, since you=E2=80=99re calling it, and (2) =E2=80=98interface=E2= =80=99 must be bound (the variable must be defined there). However, =E2=80=98interface=E2=80=99 is unbound here. You probably meant t= o write, within your gexp: #~(make-forkexec-constructor =E2=80=A6 #$@(map (lambda =E2=80=A6) interfaces) =E2=80=A6) which would expand to: (make-forkexec-constructor =E2=80=A6 "--interface=3Deth0" "--interface=3Deth1" =E2=80=A6) The #$@ bit (=E2=80=98ungexp-splicing=E2=80=99) means that the (map =E2=80= =A6) bit executes beforehand and that its results is staged in that generated shepherd file. HTH, Ludo=E2=80=99.