Message ID | b6f27a7aba739de0e1bc7437a050e5104065482f.1709722620.git.efraim@flashner.co.il |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1EEFD27BBEA; Wed, 6 Mar 2024 11:09:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C71C627BBE2 for <patchwork@mira.cbaines.net>; Wed, 6 Mar 2024 11:09:10 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1rhp8Z-0000p3-4u; Wed, 06 Mar 2024 06:08:39 -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 <Debian-debbugs@debbugs.gnu.org>) id 1rhp8V-0000ni-6N for guix-patches@gnu.org; Wed, 06 Mar 2024 06:08:35 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rhp8U-0007cb-UK for guix-patches@gnu.org; Wed, 06 Mar 2024 06:08:34 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rhp8y-0005HA-Ua; Wed, 06 Mar 2024 06:09:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69581] [PATCH 07/11] gnu: rust: Add tuning information. Resent-From: Efraim Flashner <efraim@flashner.co.il> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Wed, 06 Mar 2024 11:09:04 +0000 Resent-Message-ID: <handler.69581.B69581.170972332020157@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69581 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69581@debbugs.gnu.org Cc: Efraim Flashner <efraim@flashner.co.il>, Efraim Flashner <efraim@flashner.co.il> X-Debbugs-Original-Xcc: Efraim Flashner <efraim@flashner.co.il> Received: via spool by 69581-submit@debbugs.gnu.org id=B69581.170972332020157 (code B ref 69581); Wed, 06 Mar 2024 11:09:04 +0000 Received: (at 69581) by debbugs.gnu.org; 6 Mar 2024 11:08:40 +0000 Received: from localhost ([127.0.0.1]:49816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1rhp8a-0005Ey-7Z for submit@debbugs.gnu.org; Wed, 06 Mar 2024 06:08:40 -0500 Received: from mail-lj1-f170.google.com ([209.85.208.170]:54295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <efraim.flashner@gmail.com>) id 1rhp8V-0005Df-RF for 69581@debbugs.gnu.org; Wed, 06 Mar 2024 06:08:37 -0500 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2d22b8801b9so96697901fa.0 for <69581@debbugs.gnu.org>; Wed, 06 Mar 2024 03:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709723219; x=1710328019; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=jBZGFRnJoEwL09tKSNwa0bCrBO/V/tu7myL1ZrRPGTM=; b=LBXjyEUOK9V5vemydPrDNjvdDz42GDAtN5S907thfzMc3xhWLv9c7WQKl1eWaBBcDp cOYqZAv1TJy+6DL+7diZ/l8N86U0TMhBcQUpHuk0LvK8675Yw5hhZBJhcooYwlm17c8F lI+gfz7bX4xq6IG8KV6gZEDCHkLq3biSH/jCW+9TvGpo3UXcf7qYQk+Sriv+7Zr26Wsu hOUvWvExKddgkKgTI/qAZe/eRK7H3mpFFLS1i1uFT4+UFxI+jeSUFUMPsYYYQ9IjNtvx keS0AC4301DzL9+8W/vcJ6yL3DtbXWxEfvfHUulpgKxVcc/SEQb91A/ASWcwpZxPmd7L u5cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709723219; x=1710328019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jBZGFRnJoEwL09tKSNwa0bCrBO/V/tu7myL1ZrRPGTM=; b=XuzOQ5DJUQpYJMcBsf+VlKw/8tg4j+Z9EYdEC0NRXntDyxR7vxCrs0hw2Hk13FsoG9 Lv+8tvBDaNWbSyU+uQ/9y8PS/8QCG/+sgGMWfBU9sT1iH4Zo0heylDok5VZXPuDxTj2G QENtcWI2zsSC4Wiev6a8cC8WanD+vJXFibUIxzKECqqH6nJXEn5o785WmGiDV7Ax5vzl OtlBzPl8WFOokx42R60quldCxkSZqI7Nw/plLrIyyY+L/v7jGB+shm1bVMsYc8sEpdor rvs3PjdK5rUBzOmanYqCe9SBW1C/lN9VhD/AljBPkNO/bGvP85bBL6q+/x0+wtA5zvDf mfWA== X-Gm-Message-State: AOJu0YzkqUXAABHJ24gN7eDY0F81NBv36eTqcFvFfkJeZFYX0BEf7IRX eRafYq6OeqpFsW8UJWf8NUf0MfcpEgjuWHOZXxKf+0xPdSe6TsxaBjAn1jzThJA= X-Google-Smtp-Source: AGHT+IGaKx4k+XvYMXrQItsoejET1qFs+fElsPU0rin8swV/R45kNf/gho1SHxKwKVLT5s/k9rx+Sg== X-Received: by 2002:a2e:924e:0:b0:2d2:71cc:253d with SMTP id v14-20020a2e924e000000b002d271cc253dmr3085152ljg.25.1709723218648; Wed, 06 Mar 2024 03:06:58 -0800 (PST) Received: from localhost ([141.226.12.177]) by smtp.gmail.com with ESMTPSA id bo16-20020a056000069000b0033e422d0963sm6849719wrb.41.2024.03.06.03.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 03:06:58 -0800 (PST) From: Efraim Flashner <efraim@flashner.co.il> Date: Wed, 6 Mar 2024 13:06:08 +0200 Message-ID: <b6f27a7aba739de0e1bc7437a050e5104065482f.1709722620.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.41.0 In-Reply-To: <cover.1709722620.git.efraim@flashner.co.il> References: <cover.1709722620.git.efraim@flashner.co.il> MIME-Version: 1.0 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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
CPU tuning patches
|
|
Commit Message
Efraim Flashner
March 6, 2024, 11:06 a.m. UTC
* gnu/packages/rust.scm (rust)[properties]: Add clang-properties matching the input llvm package. Change-Id: Ie2ef2387fff8aa639dcd73752bcaf3c26bbb376d --- gnu/packages/rust.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Efraim Flashner <efraim@flashner.co.il> skribis: > * gnu/packages/rust.scm (rust)[properties]: Add clang-properties > matching the input llvm package. > > Change-Id: Ie2ef2387fff8aa639dcd73752bcaf3c26bbb376d Hmm rustc actually uses LLVM for code generation? I’m a bit lost. Anyway, if it supports those same flags as Clang, all good; maybe add a comment to say so explicitly. > + (properties `(`(append > + ,(alist-delete 'hidden? (package-properties base-rust)) > + ,@(clang-properties "15")))) I think you meant: (properties (append (alist-delete 'hidden? (package-properties base-rust)) (clang-properties "15"))) Ludo’.
Efraim Flashner <efraim@flashner.co.il> skribis: > + (properties `(`(append > + ,(alist-delete 'hidden? (package-properties base-rust)) > + ,@(clang-properties "15")))) Just realized that we cannot really call ‘clang-properties’ from here because ‘properties’ is not a thunked field, so this would lead to a top-level circular dependency… You might need to duplicate the info. Thanks, Ludo’.
On Wed, Mar 06, 2024 at 07:09:32PM +0100, Ludovic Courtès wrote: > Efraim Flashner <efraim@flashner.co.il> skribis: > > > * gnu/packages/rust.scm (rust)[properties]: Add clang-properties > > matching the input llvm package. > > > > Change-Id: Ie2ef2387fff8aa639dcd73752bcaf3c26bbb376d > > Hmm rustc actually uses LLVM for code generation? I’m a bit lost. > Anyway, if it supports those same flags as Clang, all good; maybe add a > comment to say so explicitly. It supports the same target_cpu targets as clang does. With llvm switching to a monorepo they've apparently done a better job about syncing the list between llvm and clang. > > + (properties `(`(append > > + ,(alist-delete 'hidden? (package-properties base-rust)) > > + ,@(clang-properties "15")))) > > I think you meant: > > (properties (append (alist-delete 'hidden? (package-properties base-rust)) > (clang-properties "15"))) I would love to have it cleaner like this. There was a lot of trial and error to end up with what I had above. I'll try that.
On Wed, Mar 06, 2024 at 07:10:54PM +0100, Ludovic Courtès wrote: > Efraim Flashner <efraim@flashner.co.il> skribis: > > > + (properties `(`(append > > + ,(alist-delete 'hidden? (package-properties base-rust)) > > + ,@(clang-properties "15")))) > > Just realized that we cannot really call ‘clang-properties’ from here > because ‘properties’ is not a thunked field, so this would lead to a > top-level circular dependency… You might need to duplicate the info. We also use the list for zig. Considering we're only supporting one version for rust duplicating the information wouldn't be the worst thing but it'd be better to only have it declared in one spot.
Efraim Flashner <efraim@flashner.co.il> skribis: > On Wed, Mar 06, 2024 at 07:10:54PM +0100, Ludovic Courtès wrote: >> Efraim Flashner <efraim@flashner.co.il> skribis: >> >> > + (properties `(`(append >> > + ,(alist-delete 'hidden? (package-properties base-rust)) >> > + ,@(clang-properties "15")))) >> >> Just realized that we cannot really call ‘clang-properties’ from here >> because ‘properties’ is not a thunked field, so this would lead to a >> top-level circular dependency… You might need to duplicate the info. > > We also use the list for zig. > > Considering we're only supporting one version for rust duplicating the > information wouldn't be the worst thing but it'd be better to only have > it declared in one spot. Then it should be declared in a module that’s not in a cycle with its users (that’s annoying!). Maybe a separate ‘llvm-meta.scm’? Ludo’.
On Thu, Mar 07, 2024 at 10:38:06PM +0100, Ludovic Courtès wrote: > Efraim Flashner <efraim@flashner.co.il> skribis: > > > On Wed, Mar 06, 2024 at 07:10:54PM +0100, Ludovic Courtès wrote: > >> Efraim Flashner <efraim@flashner.co.il> skribis: > >> > >> > + (properties `(`(append > >> > + ,(alist-delete 'hidden? (package-properties base-rust)) > >> > + ,@(clang-properties "15")))) > >> > >> Just realized that we cannot really call ‘clang-properties’ from here > >> because ‘properties’ is not a thunked field, so this would lead to a > >> top-level circular dependency… You might need to duplicate the info. > > > > We also use the list for zig. > > > > Considering we're only supporting one version for rust duplicating the > > information wouldn't be the worst thing but it'd be better to only have > > it declared in one spot. > > Then it should be declared in a module that’s not in a cycle with its > users (that’s annoying!). Maybe a separate ‘llvm-meta.scm’? How about moving it into (guix cpu) together with the ones from gcc? There are apparently some CPUs that are identical but have different names that we could map together and would allow us to make any changes to them in one place. We've already pretty much done that with the search paths.
Hi, Efraim Flashner <efraim@flashner.co.il> skribis: > On Thu, Mar 07, 2024 at 10:38:06PM +0100, Ludovic Courtès wrote: [...] >> Then it should be declared in a module that’s not in a cycle with its >> users (that’s annoying!). Maybe a separate ‘llvm-meta.scm’? > > How about moving it into (guix cpu) together with the ones from gcc? > There are apparently some CPUs that are identical but have different > names that we could map together and would allow us to make any changes > to them in one place. We've already pretty much done that with the > search paths. To me, the whole point of the ‘compiler-cpu-architectures’ property is that this info can be stored in the compiler package itself rather than in some remote unrelated place (the same goes for search paths). My instinct would be to preserve that, hence the suggestion of a new (gnu packages llvm-meta) or (… llvm-infra) module, something like that. We should also keep in mind that those CPU names are those defined by compilers themselves; they don’t have to match the vendor-chosen name or the name chosen by some other compiler. WDYT? Does that make sense? Ludo’.
On Fri, Mar 08, 2024 at 10:57:03PM +0100, Ludovic Courtès wrote: > Hi, > > Efraim Flashner <efraim@flashner.co.il> skribis: > > > On Thu, Mar 07, 2024 at 10:38:06PM +0100, Ludovic Courtès wrote: > > [...] > > >> Then it should be declared in a module that’s not in a cycle with its > >> users (that’s annoying!). Maybe a separate ‘llvm-meta.scm’? > > > > How about moving it into (guix cpu) together with the ones from gcc? > > There are apparently some CPUs that are identical but have different > > names that we could map together and would allow us to make any changes > > to them in one place. We've already pretty much done that with the > > search paths. > > To me, the whole point of the ‘compiler-cpu-architectures’ property is > that this info can be stored in the compiler package itself rather than > in some remote unrelated place (the same goes for search paths). My > instinct would be to preserve that, hence the suggestion of a new (gnu > packages llvm-meta) or (… llvm-infra) module, something like that. > > We should also keep in mind that those CPU names are those defined by > compilers themselves; they don’t have to match the vendor-chosen name or > the name chosen by some other compiler. > > WDYT? Does that make sense? That makes sense to me. I'm also going to look at moving system->llvm-target to llvm-meta. I think its used with dlang.scm and maybe elsewhere, or could be used at least. All these languages using llvm as a backend means we keep on wanting to use these functions elsewhere.
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 1f129a93bd..68917ee5e8 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -964,7 +964,9 @@ (define-public rust (let ((base-rust rust-1.75)) (package (inherit base-rust) - (properties (alist-delete 'hidden? (package-properties base-rust))) + (properties `(`(append + ,(alist-delete 'hidden? (package-properties base-rust)) + ,@(clang-properties "15")))) (outputs (cons* "rust-src" "tools" (package-outputs base-rust))) (source (origin