From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WPktHNnprWFsFQAAgWs5BA (envelope-from ) for ; Mon, 06 Dec 2021 11:45:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aBnfF9nprWGyYAAAB5/wlQ (envelope-from ) for ; Mon, 06 Dec 2021 10:45:45 +0000 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 19212293AA for ; Mon, 6 Dec 2021 11:45:45 +0100 (CET) Received: from localhost ([::1]:53766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muBV8-0007if-IQ for larch@yhetil.org; Mon, 06 Dec 2021 05:45:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muBOg-0003bT-S0 for guix-patches@gnu.org; Mon, 06 Dec 2021 05:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muBOg-00022H-Iz for guix-patches@gnu.org; Mon, 06 Dec 2021 05:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muBOg-0007kC-4N for guix-patches@gnu.org; Mon, 06 Dec 2021 05:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Dec 2021 10:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163878713429751 (code B ref 52283); Mon, 06 Dec 2021 10:39:02 +0000 Received: (at 52283) by debbugs.gnu.org; 6 Dec 2021 10:38:54 +0000 Received: from localhost ([127.0.0.1]:60621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muBOX-0007jn-LX for submit@debbugs.gnu.org; Mon, 06 Dec 2021 05:38:53 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:48485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muBOT-0007jX-Gq for 52283@debbugs.gnu.org; Mon, 06 Dec 2021 05:38:53 -0500 IronPort-HdrOrdr: A9a23:zguCrqpKK9mcna9hcgcT0VwaV5qseYIsimQD101hICF9WteTlsCwkPle/QKcskdfZJhAo6HnBEDuewKgyXce2+gs1ImZLXrbUQeTXeZfBWWL+UytJ8XRntQtnJuIWZIOfuEZlTNB/IvHCDDRKadr/DFsmJrYzds2tk0dBj2CFZsQlzuRezzra3GeHzM2d+tNKHP03KMuzFfNFhRnDbXfdx04tqr41qb2ffTdEGA77jEcmX2zZFiTmcHH+najr20juw0k+8ZSzYG8qX2E2kzPiZ+GIhS37R6i032IorGRqOdrNYiKjIwcMT/sihmlDb4RLIG/gA== X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="400360311" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 11:38:43 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> Date: Mon, 06 Dec 2021 11:38:42 +0100 In-Reply-To: <87czmb1m8a.fsf_-_@gnu.org> (Mathieu Othacehe's message of "Sun, 05 Dec 2021 09:37:09 +0100") Message-ID: <87zgpeqaq5.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-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" 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=1638787545; 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; bh=Hf3Mk6Np8kDJeVIru9A97uDhdWT9p5spvQhWw0vVp/c=; b=SI+dYTHL+ILVAY8xu1ZrK2wXz0TjasKos3Ls1C6K/cdeTlWKA/GHwUzV4AtjGEPzvR1Y+s TVD/ss/7rR1nEtgafc53C8atEhngf6u+qJJfvUHBosHcATyjSA3h0fRC0P+pg+hk5Ysh67 Itpt3WYG+FxvuanMd6HfhbewJX0bcE+ZJEiEPWi9YRan8NdgpfvAu2bpVbpIoyny/ev7OV j8xkdfTMATzHstKkr+ZaaNeqhpqmr9vkW1EbbD77cw6KvHbcdI6QB4WPg59Qaoam+yADPg OMPnRFLqMLkw++7qJc06N0Yoc1Zup3YZSVF+P2os+uvoxlmEzm4u0kK8n+gzxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638787545; a=rsa-sha256; cv=none; b=jPQlW2wgjngQrqCgYelcyNN8GqpABTKLkAwDC7CEd8jpahqwMGQdDFw+e2jAEAAuH/zQSX Hy4vProp6Lls7tyrxI5DNUmVDOe3xvei525Wgq8Kp4G7roaF2dHB+dIYHiRQh+c6Y3jKy5 5mjqWc0ovOteK+TZ64oZybZVSuBkTTfEgS2m+N79Gkv69AmyJwyJv5S05OBr+K1BLXLIWJ QGd7QAAHoPoYE6BaLiECKxI+//IUguK/uVweupqNdUQt3xX8lyBNMYcR6tShuDRhRJCRol 0NIgzaepe5XomYnY8b3f6TK4sGCdrakwCYsHa/R3PgDj+38S6T1Vq1lw0stapA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Spam-Score: -2.14 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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" X-Migadu-Queue-Id: 19212293AA X-Spam-Score: -2.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: Z4rH/Dx8//ro Hello! Mathieu Othacehe skribis: > Wooh, nice addition! Glad you like it. :-) >> +(define-record-type >> + (cpu architecture family model flags) >> + cpu? >> + (architecture cpu-architecture) ;string, from 'uname' >> + (family cpu-family) ;integer >> + (model cpu-model) ;integer >> + (flags cpu-flags)) ;set of strings > > When using the "--tune" transformation option with "native", we can > expect the current-cpu method to fill the record correctly. > > However, when the user is passing a custom cpu name, it might be > incorrect. I think we should check the user input against a list of > valid/supported cpu architectures. > > That's something we should also enforce for the system and target > fields. Currently, this command "guix build -s arch64-linux hello" is > failing with an unpleasant backtrace, while it could warn that the > given system is not supported. Right. I=E2=80=99m a bit torn because I agree with the usability issue and solution you propose, but at the same time I know that maintaining a list of existing CPU names will be tedious and it=E2=80=99ll be annoying for users if they can=E2=80=99t just specify their CPU name (which they might w= ant to do precisely when =E2=80=98--tune=3Dnative=E2=80=99 doesn=E2=80=99t dete= rmine the right name because it doesn=E2=80=99t know about it yet.) Maybe it=E2=80=99s an acceptable limitation though. I=E2=80=99ll see how I can tweak the code so that the CPU detection code an= d the micro-architecture name validation code can share a single list of names. > Maybe the (guix cpu) and (gnu platform) modules should be merged somehow > to define the supported CPU micro-architectures: > > (define armv7-linux > (platform > (target "arm-linux-gnueabihf") > (system "armhf-linux") > (linux-architecture "arm") > (supported-march '("armv7" "armv7-a" "armv7ve")) > > we could then use those platform records in the (gnu ci) module to build > packages against all the supported micro architectures and remove the > "%x86-64-micro-architecture" variable you propose to introduce there. Hmm yeah, but it should be (guix platforms) then=E2=80=A6 Maybe that=E2=80=99s a broader refactoring we can keep for later? I agree = it would be logical but I=E2=80=99m not sure how to nicely factorize things. Thanks, Ludo=E2=80=99.