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 ms0.migadu.com with LMTPS id QIQ/C/BmHmKijQAAgWs5BA (envelope-from ) for ; Tue, 01 Mar 2022 19:33:20 +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 eCH0A/BmHmL8gQEAG6o9tA (envelope-from ) for ; Tue, 01 Mar 2022 19:33:20 +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 D9F69F985 for ; Tue, 1 Mar 2022 19:33:19 +0100 (CET) Received: from localhost ([::1]:46382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP7JH-0003X6-2r for larch@yhetil.org; Tue, 01 Mar 2022 13:33:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP7J0-0003Wn-VV for bug-guix@gnu.org; Tue, 01 Mar 2022 13:33:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nP7J0-0007SB-N2 for bug-guix@gnu.org; Tue, 01 Mar 2022 13:33:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nP7J0-0004mT-L6 for bug-guix@gnu.org; Tue, 01 Mar 2022 13:33:02 -0500 Subject: bug#40998: [PATCH 1/4] system: Add a version field to the record. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Tue, 01 Mar 2022 18:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 40998 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Mail-Followup-To: 40998@debbugs.gnu.org, maxim.cournoyer@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 40998-done@debbugs.gnu.org id=D40998.164615953818298 (code D ref 40998); Tue, 01 Mar 2022 18:33:02 +0000 Received: (at 40998-done) by debbugs.gnu.org; 1 Mar 2022 18:32:18 +0000 Received: from localhost ([127.0.0.1]:38189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP7II-0004l4-Cg for submit@debbugs.gnu.org; Tue, 01 Mar 2022 13:32:18 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:42875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP7IG-0004ko-7e for 40998-done@debbugs.gnu.org; Tue, 01 Mar 2022 13:32:16 -0500 Received: by mail-qt1-f180.google.com with SMTP id 11so10732634qtt.9 for <40998-done@debbugs.gnu.org>; Tue, 01 Mar 2022 10:32:16 -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=BNnTUPCbNF6Paaz3tI8+Emijl9HiY0yF6z+U5bvmLJQ=; b=eGnZnIBaaBChT+hsjYh1CTyRefICyVaEIw76BUcwZdKXW7YBDP2g3ZmEYNvjgH9VFr HS21dngv4noEclqnIQGhzaKkeVM2bSGs75D59ywu8p0sFUng9KKdEM38Zq53ygwuqaRo vw4TdHHVO8vAZiZXOS7S/q7aU8tvTzlzhWLHEcz3OnsEB6XtIWpsCwPQxmY/4g4j/+4k 9bfd+clkzv8Q8dMi7Fg2sWwtoRaCEaASM+ZE9TaRPGa8U5J2wyjxwbx9h7iXYlUaeIkr qdcBSer/fQMTchDM12zIXk82MQbmgY4VjR/NHWW9UXDcAy7VvElsKTURzjFQ6js/kBc4 6dPQ== 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=BNnTUPCbNF6Paaz3tI8+Emijl9HiY0yF6z+U5bvmLJQ=; b=iUyti3aOJ9bRMG69NEURR2oC2lGFWDPI8wCLCunWhSM6koE/LC2H7fpodcuga9d9e8 E+FwybHJ0xn6GraoA3Ky/ukCLv9/7C7gMEXrEXZ6D5bpD6Iz2xLvWsdziLEfvCGJSNoX g1JGwz1z7AOhybSiboYVEwnqkea7DilieP+BB9j9L0hov3z4LitN0cW+DWE/IP50wY6w GpsQg4siR4m9FCa+r/dQvP0BjEWVdOfWLrtjGK+Njen2roI5gmZIHCLYkptnZ+yn/u3G oT2cILG3xOeg3Zotd+6PhUg2rvXkZ9meEwFlG/R5UWqytDHjWrZ066aRLrXKIfnGb6US sTBQ== X-Gm-Message-State: AOAM530T3jgi0kefI4/rTGvI6Yl0N5ZCtoBypEovrvngt4/Aavl/9yvs 9iJ22Gk8nFXrI+NVptUsUSjzeX/f1LQ= X-Google-Smtp-Source: ABdhPJwThc9QuKDGuIyjxeYfXRuF9ctUEh27ZcVRyoFlL6xfmBR2LiKU8X72FQJ1RvmJJb2wjG3yxA== X-Received: by 2002:a05:622a:64a:b0:2de:ac9e:fd34 with SMTP id a10-20020a05622a064a00b002deac9efd34mr19704041qtb.280.1646159530362; Tue, 01 Mar 2022 10:32:10 -0800 (PST) Received: from hurd (dsl-155-199.b2b2c.ca. [66.158.155.199]) by smtp.gmail.com with ESMTPSA id o64-20020a37be43000000b00648fd02ac00sm7072445qkf.64.2022.03.01.10.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 10:32:09 -0800 (PST) From: Maxim Cournoyer References: <20220228225047.11105-1-maxim.cournoyer@gmail.com> <877d9e822e.fsf@gnu.org> <87k0dd3fdt.fsf@gmail.com> Date: Tue, 01 Mar 2022 13:32:09 -0500 In-Reply-To: <87k0dd3fdt.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 01 Mar 2022 09:40:30 -0500") Message-ID: <874k4hle1i.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-done@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=1646159599; 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-to: 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=BNnTUPCbNF6Paaz3tI8+Emijl9HiY0yF6z+U5bvmLJQ=; b=RPucY/qAxBfb3CEzLmTNBoG/5thhmHqhgBnntVd7zoMuUQ9ZG7sxir3ZJUJOiJLRw9/UIC zc1JOAygh3VeRvRZJb41l+ej55mg6zoJa55Sj/HUTbrwnDT8qnjggdCZm9gZQ2r2wMqPXb 1a9fziRGU9IGFrxE7LFWBvByWi/T9kLjHnKdlMPLM8/NE7cExLOt0kygz+zGI955qB9RDI ltoBAzgiCzurwgDRKpcGiCuHQ0WdQmx1TH/x0OU4xAuACka5TC9b5eNwdEpZPf+yj9r7si AtPgHm/qixK1vJZswuONXjljGjbyRdyXBwuRsbcre1oVirGidToKEA1yAaHI1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646159599; a=rsa-sha256; cv=none; b=M9bmDNepGUPwwWXp0ZDbCjdUQIzAQ815JQ9q/c129pf0NVZ/14QXDgtJm/P8qHYFLJVmJJ YpJBMnh6uvZMdxC/2X2naAxWqpmKddwFw8OMbJPkuzGn9YyiKOjTJPhPIWGMRPRcDLN5vt IXj2XvGc1E7fZlIaYBpRmSfSkQI7PEwfk96J0yD30eK3ceKJI4EsULgUueaKWTIdiLZVw8 iFSV7hX7ZjMABrABAHgbK+ehMXRL9qK/vfeSTWnB3Eol8ckCn6UItSWX6GMZP8oDz/xk0v ZVqT7IhzoCDQI+maVZvO5y4WAwYQ2n5n1c8vZBMqkHrIuMBUje8BRokh+8N5tw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eGnZnIBa; 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: 4.12 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eGnZnIBa; 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: D9F69F985 X-Spam-Score: 4.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: LJSzQjmemcaR Hi Ludovic, Maxim Cournoyer writes: > 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 coul= d, >> 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. I've now pushed it as 6d9d616113cf051d80567b584a5b0a6489ddc065. Thanks for the review! Maxim