From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WDL3LYjUq2G9dQEAgWs5BA (envelope-from ) for ; Sat, 04 Dec 2021 21:50:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GDeMKYjUq2HgdQAAbx9fmQ (envelope-from ) for ; Sat, 04 Dec 2021 20:50:16 +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 E015C27346 for ; Sat, 4 Dec 2021 21:50:15 +0100 (CET) Received: from localhost ([::1]:37180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbz4-0005s8-U5 for larch@yhetil.org; Sat, 04 Dec 2021 15:50:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbys-0005rh-Oe for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbys-0001ji-Gk for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbys-0003bu-GE for guix-patches@gnu.org; Sat, 04 Dec 2021 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 03/10] ci: Add extra jobs for tunable packages. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50: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: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098813775 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:48 +0000 Received: from localhost ([127.0.0.1]:55207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003a6-M4 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbya-0003Z7-LR for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:44 -0500 Received: from [2001:470:142:3::e] (port=45330 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyV-0001gG-C9; Sat, 04 Dec 2021 15:49:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=GmYZGhsNWuuYJ92529+5w06qr4Nz6NLSf1JI/E3T04g=; b=Klhukl3dQ/nOJKgaXa9k ZBSE3yCI2EWtuIDxqUO1LNZwFuE/DtWUXFmtmq42gV2UMZbz+McKq0OFlSMPF/SQKA4LkUEKafPG4 PnNHfvZZVgReHyX32k22uUQK7GOvPd58ugK7liaO6PvFPsZnG98yzwT8naxYv0ciRTl94ZOm/p0DG lGvj+gYYzUkqmrOR+PfYSmjvk25auic2Xec9VhaO17z+i1wDEtvfo+E1Hcodg2unlsf8/LFlbWsiU XVLD0sSiT2INiET5vRz2QW4kArN6eZtanuQR2OIbDOk75de/pLeH9olPsJk3a7OGj8gm+AcqCbgpX lc/eqfqOZBosEQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyV-00059z-8i; Sat, 04 Dec 2021 15:49:39 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:17 +0100 Message-Id: <20211204204924.15581-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 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: 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=1638651016; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=GmYZGhsNWuuYJ92529+5w06qr4Nz6NLSf1JI/E3T04g=; b=Ybae6VPjOuRPgZ/JB5jXwv9ltUdeTar9129l98i7YReFQ8AzoUxWXCIvvpW/xY4IN3W5n9 xpAwFp0m3vZA8NklvER03SSY05FWriBRJL8IPRvuSqebI7nsOdcNGZ0l/yYVetrYk1htlR p4FL51vGdNg7wU8UIR33UxiKgIdPBbneI6J+WE7cPclEa/SNiYHxN5GSouR3QHsYGcmwKl 96LbsDzEL/3CfP1b6ZMncSg7V4Z/MN83RBQKOvgFjvMaGotfcgoWDUE8tNFtN4OECbQH1J jANTyWUCXF1T8v0qiJbPHSast0N7J+2Q+Dqd8d1G39qV3Nt+u+MhQpGoULA9UQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638651016; a=rsa-sha256; cv=none; b=K0NnAuPVD2v4xyrlk+axq2GpKn52hfai2rYRt9EIbrIFtvqNecVvNn2/ITHN7FsxxR4jp2 Gqi7RK0XY4TA6iktA6uqK/tsyuKqpWs2H2bp8ahCCzHJnkCEO1U0dSPuN9W+n79o2BbQEF MTIKO5FFBAkWZXsn949rb5hwMUqCqfbH+F6spHkcWSio1JiNoKx/bVV4PTLPIJkFlg+fcI Z7yOshqPUAUaUsXWrRmHe8P5xslvdh6P/aSuSamNuZ7vFj4xivC4OwKoyE+aIiQ1didByY 4w3ciFCMZuDqFM8K27XU8RUumeEE4LkhXlNJueZ1k4rWpiTSh5zbvVr+DukxpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Klhukl3d; dmarc=pass (policy=none) header.from=gnu.org; 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.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Klhukl3d; dmarc=pass (policy=none) header.from=gnu.org; 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: E015C27346 X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: b+BnRfdbgEdH This allows us to provide substitutes for tuned package variants. * gnu/ci.scm (package-job): Add #:suffix and honor it. (package->job): Add #:suffix and honor it. (%x86-64-micro-architectures): New variable. (tuned-package-jobs): New procedure. (cuirass-jobs): Add jobs for tunable packages. --- gnu/ci.scm | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index e1011355db..2f56554d93 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -28,6 +28,7 @@ (define-module (gnu ci) #:use-module (guix grafts) #:use-module (guix profiles) #:use-module (guix packages) + #:autoload (guix transformations) (tunable-package? tuned-package) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) @@ -108,9 +109,9 @@ (define* (derivation->job name drv (#:timeout . ,timeout))) (define* (package-job store job-name package system - #:key cross? target) + #:key cross? target (suffix "")) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (let ((job-name (string-append job-name "." system))) + (let ((job-name (string-append job-name "." system suffix))) (parameterize ((%graft? #f)) (let* ((drv (if cross? (package-cross-derivation store package target system @@ -395,21 +396,39 @@ (define package->job (((_ inputs _ ...) ...) inputs)))) (%final-inputs))))) - (lambda (store package system) + (lambda* (store package system #:key (suffix "")) "Return a job for PACKAGE on SYSTEM, or #f if this combination is not -valid." +valid. Append SUFFIX to the job name." (cond ((member package base-packages) (package-job store (string-append "base." (job-name package)) - package system)) + package system #:suffix suffix)) ((supported-package? package system) (let ((drv (package-derivation store package system #:graft? #f))) (and (substitutable-derivation? drv) (package-job store (job-name package) - package system)))) + package system #:suffix suffix)))) (else #f))))) +(define %x86-64-micro-architectures + ;; Micro-architectures for which we build tuned variants. + '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) + +(define (tuned-package-jobs store package system) + "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." + (filter-map (lambda (micro-architecture) + (define suffix + (string-append "." micro-architecture)) + + (package->job store + (tuned-package package micro-architecture) + system + #:suffix suffix)) + (match system + ("x86_64-linux" %x86-64-micro-architectures) + (_ '())))) + (define (all-packages) "Return the list of packages to build." (define (adjust package result) @@ -527,10 +546,16 @@ (define source ('all ;; Build everything, including replacements. (let ((all (all-packages)) - (job (lambda (package) - (package->job store package system)))) + (jobs (lambda (package) + (match (package->job store package system) + (#f '()) + (main-job + (cons main-job + (if (tunable-package? package) + (tuned-package-jobs store package system) + '()))))))) (append - (filter-map job all) + (append-map jobs all) (cross-jobs store system)))) ('core ;; Build core packages only. -- 2.33.0