From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QDv1B8b/UGVT2AAAG6o9tA:P1 (envelope-from ) for ; Sun, 12 Nov 2023 17:39:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QDv1B8b/UGVT2AAAG6o9tA (envelope-from ) for ; Sun, 12 Nov 2023 17:39:34 +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 93B34671D0 for ; Sun, 12 Nov 2023 17:39:33 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elenq.tech header.s=protonmail2 header.b=dZWdc+Ne; dmarc=fail reason="SPF not aligned (relaxed)" header.from=elenq.tech (policy=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699807174; 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=/yn+fT+AGtcxCxhBKIempQKWWvzefIpAFi+ziXlwj5g=; b=p4IrfwzP7Y2iNInESHrmx+J5v0w6zVDvAFN8FCVlAcZWaelbbXRI6k4w2YRbzsIcks616w F7hwN78HHD441WGKKE9Ce7BZVzio2SkHi4o/CtjhmGDchzIG3hAL3XBgWsTBzdMuyPtmC6 oZ78LxbsXCIMbSCGBogqVP4Mr0LboyZkH2SV4ZSrMdy9lm5PFGdCKBYp1CXdKmvT85FNLB wtIglpQD0O9q/gI0qljCbqLd/SPYFTlH1sEiGhmtmN3gj8ynHi9u2S7l3ZMMM8vYZQjpK9 4dhxr+11rDnditxYrfQeuFScsjm1KQzFzXRpJ563UQ+eEcOoPaMkrKJoc3FFKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elenq.tech header.s=protonmail2 header.b=dZWdc+Ne; dmarc=fail reason="SPF not aligned (relaxed)" header.from=elenq.tech (policy=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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699807174; a=rsa-sha256; cv=none; b=U0PyJfFwPldOOXlvixkcBsCe9QtxLGvB3oTumrCYI9ZfdwZcJ2Ja4nlzyRnk99Xe2zZqvY QH7EY2657BTTvFoMparpyRUvsIXfOxRBkCdVLzgDLWVUPkG6GV72LgUDB8u//ZeokgVEuq PlIpyvlwcgP7GqtqA4VRuxPAoz0xKWyIpDu19X/Eab2bI1RNRBk6U4tuYzTtACoSHpMoXU PPqpuzDafKr+zmu0n+DLchqMMrcWqU7fecgtDEhSr9u19KICQ/1vtB+TDbHjnjzRBH83c7 h1R3xvbi5ZSNf86+vakSD8jiLTFWEnjPzDUGiciUICua/cjxMec7lPWRsyAEOw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2DUa-0001pZ-Ok; Sun, 12 Nov 2023 11:39:24 -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 1r2DUY-0001pQ-HL for guix-patches@gnu.org; Sun, 12 Nov 2023 11:39:22 -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 ) id 1r2DUX-000732-B7 for guix-patches@gnu.org; Sun, 12 Nov 2023 11:39:21 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2DVB-0002m8-Uh for guix-patches@gnu.org; Sun, 12 Nov 2023 11:40:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67075] [PATCH] build: zig-build-system: Add CPU option Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Nov 2023 16:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67075 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Efraim Flashner Cc: 67075@debbugs.gnu.org Received: via spool by 67075-submit@debbugs.gnu.org id=B67075.169980716410613 (code B ref 67075); Sun, 12 Nov 2023 16:40:01 +0000 Received: (at 67075) by debbugs.gnu.org; 12 Nov 2023 16:39:24 +0000 Received: from localhost ([127.0.0.1]:56833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2DUa-0002l5-32 for submit@debbugs.gnu.org; Sun, 12 Nov 2023 11:39:24 -0500 Received: from mail-40136.proton.ch ([185.70.40.136]:58375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2DUU-0002kp-El for 67075@debbugs.gnu.org; Sun, 12 Nov 2023 11:39:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail2; t=1699807109; x=1700066309; bh=/yn+fT+AGtcxCxhBKIempQKWWvzefIpAFi+ziXlwj5g=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=dZWdc+NeGAJrFpI8zx9hzNd+EJF4aevfux85vvvSZFxKPfA5f/UrVBX6EgQE0ZOc4 kCSsh+afezNW/AvKHcmitasWtY+Ou2WbNar+zqfhtZi3RIgLWPLyhIrN5JfqzBmuBR CySkIVL//YWCz6wZ7pX7KblsB08HNQvPhcU67ERHmHyHDd4ttMBkhztxHsjOFcEbR0 L7R+wFtLD3t0ffbNSOOO94CP1c9i31F/aufycZrJ4RvCwk48F4cjJOtrDDPKBT+uFY MkEF8dboQktH/tWWHiPyoy8XOqhHAr1IfdCrBVXArHkJYk037p06t9N4SuVAzpM3u/ NYE4LtR1KUldQ== Date: Sun, 12 Nov 2023 16:38:10 +0000 From: Ekaitz Zarraga Message-ID: <9H9-d5-fHPyPl1K4orVOGtBJD1l-IkO3i_PliKpymBR4abn8CwidP7hNlaqafHnHBu54egehC0wYtVc-R4azbkd1sjEMPITj9dbUHl8W6dM=@elenq.tech> In-Reply-To: References: Feedback-ID: 3263582:user:proton 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.90 X-Spam-Score: 2.90 X-Migadu-Queue-Id: 93B34671D0 X-Migadu-Scanner: mx10.migadu.com X-TUID: UkFyj0H8bslN Hi Efraim, On Sunday, November 12th, 2023 at 15:38, Efraim Flashner wrote: > What are the values that the compiler can take for this flag? Also, > this seems like something that can be addressed with the tuning > mechanism, so we can run 'guix build foo --tune' and it'll do The Right > Thing=E2=84=A2. It's not that simple. I talked with Andrew Kelley and he told me the values are obtained from LLVM and they have some patching. I checked the list and= =20 they are similar to those we use in the -march field: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#x86-Options The full list is accessible in `zig targets` and it's very extensive. I don't know if we can just rely on that mechanism... > Alternatively, if we do go this route, you still need to update the > documentation. That's very true. I will. > On Sat, Nov 11, 2023 at 01:09:07PM +0000, Ekaitz Zarraga wrote: >=20 > > From a647a8ee689022cafef4bab05784b32b1c97bee7 Mon Sep 17 00:00:00 2001 > > Message-ID: a647a8ee689022cafef4bab05784b32b1c97bee7.1699708101.git.eka= itz@elenq.tech > > From: Ekaitz Zarraga ekaitz@elenq.tech > > Date: Sat, 11 Nov 2023 14:05:23 +0100 > > Subject: [PATCH] build: zig-build-system: Add CPU option > >=20 > > Zig packages are optimized by default, adding `-Dcpu=3Dbaseline` to the > > build command builds them for an standard cpu that should work in every > > machine. > >=20 > > This change sets that by default but also allows users to choose their > > cpu by the `#:zig-cpu` argument. > >=20 > > * guix/build-system/zig.scm (build): add zig-cpu > > * guix/build/zig-build-system.scm (zig-build) add zig-cpu > >=20 > > Change-Id: Ib4b2124179e7b5492e7c77c64e1f8336832032ea > > --- > > guix/build-system/zig.scm | 2 ++ > > guix/build/zig-build-system.scm | 2 ++ > > 2 files changed, 4 insertions(+) > >=20 > > diff --git a/guix/build-system/zig.scm b/guix/build-system/zig.scm > > index 16b8a712cc..f90e76104e 100644 > > --- a/guix/build-system/zig.scm > > +++ b/guix/build-system/zig.scm > > @@ -47,6 +47,7 @@ (define* (zig-build name inputs > > source > > (tests? #t) > > (test-target #f) > > + (zig-cpu #f) > > (zig-build-flags ''()) > > (zig-test-flags ''()) > > (zig-release-type #f) > > @@ -67,6 +68,7 @@ (define* (zig-build name inputs > > #:source #+source > > #:system #$system > > #:test-target #$test-target > > + #:zig-cpu #$zig-cpu > > #:zig-build-flags #$zig-build-flags > > #:zig-test-flags #$zig-test-flags > > #:zig-release-type #$zig-release-type > > diff --git a/guix/build/zig-build-system.scm b/guix/build/zig-build-sys= tem.scm > > index d414ebfb17..99a81314d4 100644 > > --- a/guix/build/zig-build-system.scm > > +++ b/guix/build/zig-build-system.scm > > @@ -44,6 +44,7 @@ (define* (set-zig-global-cache-dir #:rest args) > > (setenv "ZIG_GLOBAL_CACHE_DIR" global-cache-dir)) > >=20 > > (define* (build #:key > > + zig-cpu > > zig-build-flags > > zig-release-type ;; "safe", "fast" or "small" empty for a > > ;; debug build" > > @@ -59,6 +60,7 @@ (define* (build #:key > > ,@(if zig-release-type > > (list (string-append "-Drelease-" zig-release-type)) > > '()) > > + ,(string-append "-Dcpu=3D" (or zig-cpu "baseline")) > > ,@zig-build-flags))) > > (format #t "running: ~s~%" call) > > (apply invoke call))) > >=20 > > base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94 > > -- > > 2.41.0 >=20 >=20 > -- > Efraim Flashner efraim@flashner.co.il =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 >=20 > GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 > Confidentiality cannot be guaranteed on emails sent or received unencrypt= ed