From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sHl/JIkwHmI3ogAAgWs5BA (envelope-from ) for ; Tue, 01 Mar 2022 15:41:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id X5TRIYkwHmLGgwEA9RJhRA (envelope-from ) for ; Tue, 01 Mar 2022 15:41:13 +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 CB4508BCE for ; Tue, 1 Mar 2022 15:41:12 +0100 (CET) Received: from localhost ([::1]:33460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP3gd-0007Tr-UB for larch@yhetil.org; Tue, 01 Mar 2022 09:41:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP3gU-0007RS-HS for bug-guix@gnu.org; Tue, 01 Mar 2022 09:41:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nP3gU-0003vh-6t for bug-guix@gnu.org; Tue, 01 Mar 2022 09:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nP3gT-00044Z-Ri for bug-guix@gnu.org; Tue, 01 Mar 2022 09:41:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#40998: [PATCH 1/4] system: Add a version field to the record. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Mar 2022 14:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 40998-submit@debbugs.gnu.org id=B40998.164614563915603 (code B ref 40998); Tue, 01 Mar 2022 14:41:01 +0000 Received: (at 40998) by debbugs.gnu.org; 1 Mar 2022 14:40:39 +0000 Received: from localhost ([127.0.0.1]:35929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP3g7-00043b-3d for submit@debbugs.gnu.org; Tue, 01 Mar 2022 09:40:39 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:46027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP3g5-00043N-OC for 40998@debbugs.gnu.org; Tue, 01 Mar 2022 09:40:38 -0500 Received: by mail-qv1-f41.google.com with SMTP id h13so16691905qvk.12 for <40998@debbugs.gnu.org>; Tue, 01 Mar 2022 06:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=TxRvuSs/3An62TeEtVR5LFVU0ULj9Fzef9gTl7UNVKI=; b=lW0qYIMq88BTVb2/sumXxzy68Ov4FF5L1w2yWAdlNW6JH/ozCUTJQVScA7K6YCM9sc 5RbwT5xwhmvRxgnCGnT8l8OOAEzxNsLmhd5QYsnS7wMIzN1EtUp3Y7CM6tBvs/l+A0AB Vg8ZdZfBdCkPXGlnl/snxx3App209vxylqYQ/GuTtBYOjrciixYuZELuA9VWcj87A/Q7 O7E5Hcf/lq4JBHtwusjjgwFoxwUq1qNrUg43kAVGDKVJk/YmrdQziiTDSX64aOI6yJYa qcewClNigBkqiFfE29QGv0Yr2FAGluaY2Ug16YXt5eFknHKAxrI0KoGK162tJAbCZ8NX tqgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=TxRvuSs/3An62TeEtVR5LFVU0ULj9Fzef9gTl7UNVKI=; b=TFrlddLoA9ZJCyDKk+UlK4d7pNGp3ihKYZWE/Yf5lHrN8o1vt7ODICbitpSPGaFFtC DfR4dQZ+8jc9c32nKbcKWzSmhfQz07jBd3fxNj7WfgpJZy84WjxIHrSYi8FZv4dv2arU fvCqqR4ybIWSkzXw+6Yf/HCGrgxWcvhYD8KdTYWxIAoBWwJitAOm1KfHbqEi7+ZPO+08 ncSExXJ1lVJ8V9L2+CdaC/SMz6pAFfStW8X9uBzMRuJxJ1HJk9QTBGOQvlSdmoZa6uyB RQV/BoNHq13kD0Fw4/B0FJ7hctUkdqZPXXiAqLDmoL0eSnFlr6A0hrEToJ844rv8JNCd Zhag== X-Gm-Message-State: AOAM531mU+/KIf9Mx5cK1a0pZYSj8ve5Rbx2DSDNV5/9s24htdwy98Sb MYjy0foNlRgWB62zTO9sINQoAf0AVbA= X-Google-Smtp-Source: ABdhPJxEyX/cVxBVLo5YiORHpdNNeG7XCTiEYNoA2nAG2Kj7/VRqPyw1EsdFTjdUHP4E7Zm/n1hbjA== X-Received: by 2002:a0c:be8f:0:b0:42c:5083:c6d2 with SMTP id n15-20020a0cbe8f000000b0042c5083c6d2mr17052045qvi.86.1646145632166; Tue, 01 Mar 2022 06:40:32 -0800 (PST) Received: from hurd (dsl-155-199.b2b2c.ca. [66.158.155.199]) by smtp.gmail.com with ESMTPSA id b127-20020a376785000000b00648ee0245dasm6708819qkc.69.2022.03.01.06.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:40:31 -0800 (PST) From: Maxim Cournoyer References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> <877d9e822e.fsf@gnu.org> Date: Tue, 01 Mar 2022 09:40:30 -0500 In-Reply-To: <877d9e822e.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 01 Mar 2022 10:16:57 +0100") Message-ID: <87k0dd3fdt.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 40998@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" 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=1646145673; 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: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=TxRvuSs/3An62TeEtVR5LFVU0ULj9Fzef9gTl7UNVKI=; b=TB8RBc+IM5uet1FSyovrymw29NFMHExNuB0hg1eZ12j38G0HFZVH2p7biUrggCn4MiTxjC bkVbF2bA5DgGjxSFw1TL0aaHnq9Q9D+CjRv+wH9lUaA0UHkSGkV9UbkJNkajMXY80w3IiJ wBVTsbiwpPNZi8nzD+z6kthEOXmxo2aTPRDV/VdHH28PjUKwJygdHyHKbE1yLops/CptLu FNrfkMsLZlFNCrJxtaQMkES2uLpoS9+bCyBlflxSAKaQSAh4d3BUNK6JLQ1ASc2FnAS5M9 1MjyXexWCYZi/KalU5PJiQ1pJgaGobrczdNrT3Vgl0qSs68DmRpLJsYk+LvBfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646145673; a=rsa-sha256; cv=none; b=P9bMBcK+rDvJN96fUQOpAn50JTBBwk0fbq/R0VbD4BHB4Pfj/zPtqrFAu43jDETZ12hg+2 9M4Mmrd6oeNufWIDXwg43j3+mS+4irUFn+6iPCFpJbhfyS3ZN07mpd4l1doNPGCHtGlJ5k c0qfY3dbLpwOphTOsFJYXjBvYOnKrobO1nz+A/oecTyl+wjMGGWjsBxdPzygXKI69B+Jsj r8mEX33HQKNtxKjZx/J7A4tzb7AIibDjiTPEfaHiiBoCSySZG51RFSJJl2joAgWxYhO/I8 xRuCawzlY2KNJOrLeqsgExiNf4kgLfKCSf5c4pBGGZbN6wKjeHAcJNbhoPaA4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lW0qYIMq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lW0qYIMq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CB4508BCE X-Spam-Score: 5.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: u2B7MjxlnYoN Hi Ludovic, Ludovic Court=C3=A8s writes: > Hi! > > Maxim Cournoyer skribis: > >> This version field exposes the (already present) version information of = a boot >> parameters file. >> >> * gnu/system.scm (%boot-parameters-version): New variable. >> ()[version]: New field. >> (read-boot-parameters): Use it. >> (operating-system-boot-parameters-file): Likewise. >> * tests/boot-parameters.scm (test-read-boot-parameters): Use >> %boot-parameters-version as the default version value in the template. > > [...] > >> + ;; New versions are not backward-compatible, so only accept past and = current >> + ;; versions, not future ones. >> + (define (version? n) >> + (member n (iota (1+ %boot-parameters-version)))) >> + >> (match (read port) >> - (('boot-parameters ('version 0) >> + (('boot-parameters ('version (? version? version)) > > I still have a preference for an explicit list right here, for clarity, > and so that we don=E2=80=99t unwillingly find ourselves treating any past > version in the same way in the future. OK. I prefer that we can bump %boot-parameters-version at one place and have the rest of the code base do the right thing instead of having to manually remember to adjust bits left and right. I've added a comment next to %boot-parameters-version to mention it should be incremented by 1 when bumping it. > I think I wasn=E2=80=99t clear about it (sorry!) but I wonder if we could, > instead of bumping the version, use something like: > > (find (cut string-prefix? "gnu.load=3D") kernel-arguments) > > to determine whether we=E2=80=99re dealing with an =E2=80=9Cold-style=E2= =80=9D =E2=80=9Cparameters=E2=80=9D > file. > > If that=E2=80=99s not possible, then what this patch is doing SGTM. That's not possible, because the parameters file doesn't include the gnu.load nor gnu.system parameters because of their self-referential nature, so we don't have such information to look at. I'll be looking toward pushing this series today. Thank you for the review! Maxim