From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uPviJwNRmGPfVwAAbAwnHQ (envelope-from ) for ; Tue, 13 Dec 2022 11:16:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GPjgJwNRmGOnyAAA9RJhRA (envelope-from ) for ; Tue, 13 Dec 2022 11:16:35 +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 5C333C1DB for ; Tue, 13 Dec 2022 11:16:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p52Kc-0005fQ-V6; Tue, 13 Dec 2022 05:16:14 -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 1p52KQ-0005cb-22 for guix-patches@gnu.org; Tue, 13 Dec 2022 05:16:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p52KP-0006qT-PY for guix-patches@gnu.org; Tue, 13 Dec 2022 05:16:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p52KP-0002p2-Kj for guix-patches@gnu.org; Tue, 13 Dec 2022 05:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60014] [PATCH] activation: make install-special-file match against pairs as well. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 10:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: mirai , 60014@debbugs.gnu.org Received: via spool by 60014-submit@debbugs.gnu.org id=B60014.167092654010839 (code B ref 60014); Tue, 13 Dec 2022 10:16:01 +0000 Received: (at 60014) by debbugs.gnu.org; 13 Dec 2022 10:15:40 +0000 Received: from localhost ([127.0.0.1]:59449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p52K4-0002ol-53 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 05:15:40 -0500 Received: from jpoiret.xyz ([206.189.101.64]:46732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p52K2-0002od-9I for 60014@debbugs.gnu.org; Tue, 13 Dec 2022 05:15:38 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 34A4B185315; Tue, 13 Dec 2022 10:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1670926535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QVQkQ1A5Q/lfiM6e7sn/W/kL2AcM9hKiqwV9d6R14vc=; b=wfrRPpWdKkxCtl/ZCOcoKA9RFZZsWtNrRcFYv10Ve2GFBxu1eiQ0NR2gP7GMjzTTyfaRTc Cio6R10p6OQSk8pwHr5ZpGy3Di7dMmR0+4ONaHyBIjb9qCyD0tpvWS3ZkXEDb7AXiS+ldl 2LNA1zobhjp7/aUMVeaZ5ro7OAa2VXdf/msqBo3kKryMYdVFk0hpvzEpmPXlvj2Mb8JzD8 CsuwVZRYjqIcLOtQV6e3FGZ5PNDxOLKK1ZGgtqa5ZmlHovznl3rPACUq3vyIGRcUera9lt 6x7fvcBUmCSytBIfXfsyTQlHS7nwD6MwoC6g4rBUJAHpHr0Ax0d45f9Uu9Scsw== In-Reply-To: <7f00edbf-8b39-0d3e-4d29-0815176d143c@makinata.eu> References: <43e937e1625b47a80887e68847fb8a8811d3f39f.1670867103.git.mirai@makinata.eu> <87k02wfjk5.fsf@jpoiret.xyz> <7f00edbf-8b39-0d3e-4d29-0815176d143c@makinata.eu> Date: Tue, 13 Dec 2022 11:15:34 +0100 Message-ID: <87h6xzfw3d.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670926595; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QVQkQ1A5Q/lfiM6e7sn/W/kL2AcM9hKiqwV9d6R14vc=; b=J6v1YRTCx7VwR4Sw6ADXBqRBjfh0BuFxY+ztRKr6cSCa7RSQA5uansdNtVOY4gphP+pARk E7GIYdZyYMfKSl7Kg2JJ1JIAusJ1eWyPiYprAsK8dl67zZ0F+eSnorq5J+nd1ZtjGwg/ss AwmNrnJmSSF1rvcYUtAiMZ4F3UUOAr1JSVjSKPUCnZaIXQBYxHuij23xmMVHSrMTWrTdyl g7ePBKN2K/fF9gJNc/TY97zOnGjeF90WWGXb0E67ZrwsnBeodWcGrCgUKzk29CRNgAfdFT 11FOEICLfYbUejHxfrCd68NxWqQCabPk08ae/Ptx5foNRn5W6nVaBw6YJSO4UA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=wfrRPpWd; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670926595; a=rsa-sha256; cv=none; b=qy5BV1XeabQKki/ZhE9sEhi/fb7nV0nNvdUIZ6SJQBat0DPfvENgCh8CKFK92vN4Z4bn1d O68pl2JMQ3I/utfMm8R+hOoBpGe/x/FfLpih8iB5/A5ZvfXsWEmdGogltcwW5Gge0Launu HLa5UJGYBiHkuIL/J9oEi3QICDI3t5/M539v15odIwBOIRpha4xGT3pYcECLNvTKNaRmc1 7k1gZ5kWyxxzqSqi0eDyjjmD+eSAXRs3Se19LbEz+rhzv0k0CqlbOOF6LHHJpHnj6kPFHl hs+zV2tt4JPAY5/R15DGXGpBi8a2kI8y75WbinxKlXlsYRCpPzh2GPuaI8YB8g== X-Migadu-Spam-Score: -2.27 X-Spam-Score: -2.27 X-Migadu-Queue-Id: 5C333C1DB X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=wfrRPpWd; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: DzI3j3F4J6my Hi Bruno, mirai writes: > The documentation for it says: > --8<---------------cut here---------------start------------->8--- > The value associated with special-files-service-type services must be a l= ist of tuples where the first element is the =E2=80=9Cspecial file=E2=80=9D= and the second element is its target.=20 > --8<---------------cut here---------------end--------------->8--- > > Which I think is the natural way of doing it. (and communicates the inten= t, a pair with a path and a file-like object.) Right, that's unfortunate, although that could be changed to =E2=80=9Clist = of lists=E2=80=9D to make it clearer. > Of course, (list "path" file-like-obj) works as well but imo the pair is = clearer in purpose. > (what meaning would the third element and so on have, if ever present?) > This I found out the hard way by getting strange errors until I looked in= to what happens behind > `special-files-service-type' and realizing that only lists were accepted. > > The mixing of cases is unfortunate (it should have been pairs from the st= art) but preserves > compatibility with existing syntax.=20 I agree with you here, but then I think to avoid having to maintain both cases at the same time, all existing uses of special-files-service-type should also be modified, and only one kind should remain, with the other triggering some deprecation warning. You could match to `(path . file-like)`, and if (list? file-like), throw an exception. As a sidenote, the main problem is that Guile is not a statically typed language, but that's a whole other debate to have. In any case, I don't think this patch will be accepted as-is. I would only be partially in favor of the second solution (because it breaks existing code), while the first solution is low-effort and should work well enough. Up to you (and maintainers) to decide. Best, --=20 Josselin Poiret