From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sCX4J4x4mGPAtAAAbAwnHQ (envelope-from ) for ; Tue, 13 Dec 2022 14:05:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GGwnJ4x4mGOrnwAAG6o9tA (envelope-from ) for ; Tue, 13 Dec 2022 14:05:16 +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 21E6C3EA0E for ; Tue, 13 Dec 2022 14:05:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p54y0-000664-0l; Tue, 13 Dec 2022 08:05:04 -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 1p54xy-00065G-Nl for guix-patches@gnu.org; Tue, 13 Dec 2022 08:05:02 -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 1p54xy-0007iZ-5q for guix-patches@gnu.org; Tue, 13 Dec 2022 08:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p54xy-00013G-0d for guix-patches@gnu.org; Tue, 13 Dec 2022 08:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60014] [PATCH] activation: make install-special-file match against pairs as well. Resent-From: mirai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 13:05: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: Josselin Poiret , 60014@debbugs.gnu.org Received: via spool by 60014-submit@debbugs.gnu.org id=B60014.16709366564026 (code B ref 60014); Tue, 13 Dec 2022 13:05:01 +0000 Received: (at 60014) by debbugs.gnu.org; 13 Dec 2022 13:04:16 +0000 Received: from localhost ([127.0.0.1]:60236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p54xE-00012s-4V for submit@debbugs.gnu.org; Tue, 13 Dec 2022 08:04:16 -0500 Received: from smtpmciv2.myservices.hosting ([185.26.107.238]:40852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p54xC-00012k-5F for 60014@debbugs.gnu.org; Tue, 13 Dec 2022 08:04:14 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv2.myservices.hosting (Postfix) with ESMTP id EF9BB20CD8; Tue, 13 Dec 2022 14:04:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B03DF80093; Tue, 13 Dec 2022 14:04:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mi8KAHw0Oh12; Tue, 13 Dec 2022 14:04:08 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 01E6480097; Tue, 13 Dec 2022 14:04:07 +0100 (CET) Message-ID: <4e874c04-8cad-6d72-379b-967721b82713@makinata.eu> Date: Tue, 13 Dec 2022 13:04:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US References: <43e937e1625b47a80887e68847fb8a8811d3f39f.1670867103.git.mirai@makinata.eu> <87k02wfjk5.fsf@jpoiret.xyz> <7f00edbf-8b39-0d3e-4d29-0815176d143c@makinata.eu> <87h6xzfw3d.fsf@jpoiret.xyz> From: mirai In-Reply-To: <87h6xzfw3d.fsf@jpoiret.xyz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , 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=1670936716; 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: 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; bh=hm2PIyYl/xpbowgckJlDuiu0DbNkodwv9yfbunXKLCs=; b=c4XkYtFxGMnddSlzfkPfnZFAaK3BnhEFHnuoz74VCC/5eaCobcI0qfaekrj0OxjRbqMKRK CwDhk9IGGPuxr2Qjdi/JnqAnu/ydedtDh9kLyKuYovSaqEt6cvaDOkkeW84u191OMVRMkz zLDA3fyeMKDTlzMk327NEmbfLW4piCzvZ4nA65JU7djD1ccJsiEmpL5jDxrCZ3xM8+aXm0 pLAiSdnLAVjOcyVhzFmVnKsj4XJikHKiT7FIwTrNvlr0327jirmOIh5iHK3Xa6J8uf5sFV pQr1GQE8DGq0y1ubyx2htWo10OYaDtZM5Qg2+RD9CDw4VDaRswZLcbp9YjfRmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670936716; a=rsa-sha256; cv=none; b=Utru74TbwGCdkBCAG7fFyUT2p9Qt1UBzH6U4y1pqspQIg/1/6E3+o9OPSM5JN03Y4Agcoz AFrKmU9NzIZJvjbSnqt0hK2iRWj1n/xev2/0XVhrTn4V2I563eBpWP6qKw0nJ9Xpc1u/4q g1YulgDKC0NcgWXVzdmqkX8OWCrydAJfZu7GV1GMMjVvJ0pf0PRym9fJ4J28EEENX8w5UT W6bMEGM3Eyg0SptdtPXqqJibNjulc9UMHEuSDBQKwhm48mLkVKndnkhwoCadnv4W4+9Y7k SMnIZOuW+NVvukXVEB4kQ406NF3Ot6qtJP9Y0BtzVHBEv2PTlnWG7YGEWp/LkA== X-Migadu-Spam-Score: -1.47 X-Spam-Score: -1.47 X-Migadu-Queue-Id: 21E6C3EA0E X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; 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=none X-TUID: X0UEG/7vrdlY On 2022-12-13 10:15, Josselin Poiret wrote: > 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 list of tuples where the first element is the “special file” and the second element is its target. >> --8<---------------cut here---------------end--------------->8--- >> >> Which I think is the natural way of doing it. (and communicates the intent, a pair with a path and a file-like object.) > > Right, that's unfortunate, although that could be changed to “list of > lists” 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 into 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 start) but preserves >> compatibility with existing syntax. > > 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. The `(= car target) (= cdr file)' match pattern is lifted from https://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/match.upstream.scm?id=b54263dc98b2700fa777745405ad7651601bcdc6#n139 as Guile's Pattern Matching page doesn't specify how to match against pairs when I was looking into it. > 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. A breaking change here (or a non-breaking "deprecated" warning similar to how bootloader target field was renamed to targets can be done too, but before any further changes its best to discuss if such a change will be received. On 2022-12-12 20:34, Josselin Poiret wrote: > Otherwise, you're missing the ChangeLog entry format for the commit > message, which you can find described at [1]. You can take some > inspiration from other commits in the repository. I'm missing the link at [1], could you resend it? Cheers, Bruno