From patchwork Sat Nov 11 13:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ekaitz Zarraga X-Patchwork-Id: 19311 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 26A7827BBE2; Sat, 11 Nov 2023 13:10:44 +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,URIBL_BLOCKED autolearn=unavailable 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 6556C27BBE9 for ; Sat, 11 Nov 2023 13:10:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1nkn-0000vZ-9B; Sat, 11 Nov 2023 08:10:26 -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 1r1nkk-0000vI-SU for guix-patches@gnu.org; Sat, 11 Nov 2023 08:10: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 1r1nkk-0007pt-K0 for guix-patches@gnu.org; Sat, 11 Nov 2023 08:10:22 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1nlO-0005rd-FF for guix-patches@gnu.org; Sat, 11 Nov 2023 08:11:02 -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: Sat, 11 Nov 2023 13:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67075 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67075@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.169970821022473 (code B ref -1); Sat, 11 Nov 2023 13:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Nov 2023 13:10:10 +0000 Received: from localhost ([127.0.0.1]:52312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1nkY-0005qO-5B for submit@debbugs.gnu.org; Sat, 11 Nov 2023 08:10:10 -0500 Received: from lists.gnu.org ([2001:470:142::17]:47242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1nkW-0005qA-3N for submit@debbugs.gnu.org; Sat, 11 Nov 2023 08:10:08 -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 1r1njm-0000aR-8v for guix-patches@gnu.org; Sat, 11 Nov 2023 08:09:22 -0500 Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1nji-00078i-RB for guix-patches@gnu.org; Sat, 11 Nov 2023 08:09:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=protonmail2; t=1699708154; x=1699967354; bh=2ss1UVI/muZ7yUSSuA6don2f6qvrj4hYNkFZEEx1hHA=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=ehIletj2oy1UbKepxFfxRaC/q6Ei/HNuDTxCkzF+EkcjQZhFCChKjL3DRb6H3o3f1 QSUCwoMSgkdKhgzL4uVvQZurQGdpSVgRRMHS9k9nlOS9SZ/XbKmxR9YC0XxvxxLPtf 08xXS2SUidHjky1gWFj3Gr/BMKPsW17VCGA0bsIegsCl7UlNthF26mWpPBu3k6BM4E CYLoBujdODaSp7GVYyBzMqnQi/7p7q5hTB1Ka42s8FoBmhEZAmwif8VUORwc440m/G nGtwXYNg301l+lnfvsscYdFY4w36tdvaMK8EDliV93VUczNJOaK1yJjrZs9zP08gdU i7l1nhM32aGuQ== Date: Sat, 11 Nov 2023 13:09:07 +0000 From: Ekaitz Zarraga Message-ID: Feedback-ID: 3263582:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.23; envelope-from=ekaitz@elenq.tech; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From a647a8ee689022cafef4bab05784b32b1c97bee7 Mon Sep 17 00:00:00 2001 Message-ID: From: Ekaitz Zarraga Date: Sat, 11 Nov 2023 14:05:23 +0100 Subject: [PATCH] build: zig-build-system: Add CPU option Zig packages are optimized by default, adding `-Dcpu=baseline` to the build command builds them for an standard cpu that should work in every machine. This change sets that by default but also allows users to choose their cpu by the `#:zig-cpu` argument. * guix/build-system/zig.scm (build): add zig-cpu * guix/build/zig-build-system.scm (zig-build) add zig-cpu Change-Id: Ib4b2124179e7b5492e7c77c64e1f8336832032ea --- guix/build-system/zig.scm | 2 ++ guix/build/zig-build-system.scm | 2 ++ 2 files changed, 4 insertions(+) base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94 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-system.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)) (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=" (or zig-cpu "baseline")) ,@zig-build-flags))) (format #t "running: ~s~%" call) (apply invoke call)))