From patchwork Thu Nov 25 01:24:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 34797 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 8B16F27BBEA; Thu, 25 Nov 2021 01:26:01 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 16CFC27BBE9 for ; Thu, 25 Nov 2021 01:26:01 +0000 (GMT) Received: from localhost ([::1]:38466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mq3WS-00069h-A7 for patchwork@mira.cbaines.net; Wed, 24 Nov 2021 20:26:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mq3VX-0005k8-Ri for guix-patches@gnu.org; Wed, 24 Nov 2021 20:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mq3VX-0001vL-EO for guix-patches@gnu.org; Wed, 24 Nov 2021 20:25:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mq3VX-0007tf-At for guix-patches@gnu.org; Wed, 24 Nov 2021 20:25:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52078] [PATCH v2 3/3] build: julia-build-system: Allow parallel tests for package. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Nov 2021 01:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52078 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52078@debbugs.gnu.org Cc: maxim.cournoyer@gmail.com, zimoun Received: via spool by 52078-submit@debbugs.gnu.org id=B52078.163780350130330 (code B ref 52078); Thu, 25 Nov 2021 01:25:03 +0000 Received: (at 52078) by debbugs.gnu.org; 25 Nov 2021 01:25:01 +0000 Received: from localhost ([127.0.0.1]:55344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mq3VU-0007t3-Vs for submit@debbugs.gnu.org; Wed, 24 Nov 2021 20:25:01 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:40813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mq3VS-0007sV-SY for 52078@debbugs.gnu.org; Wed, 24 Nov 2021 20:24:59 -0500 Received: by mail-wr1-f44.google.com with SMTP id r8so7838641wra.7 for <52078@debbugs.gnu.org>; Wed, 24 Nov 2021 17:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pz3KhshWLUICdhSK3E3AfXkgcII0hYjKSEn97U6OTnE=; b=qESnTDSDZabWELzz95I8d7Ht2fSx7ZfIx8ThTGxW5rqL1vA4iip3IjCGj1BiiT12gQ qLwHJy8Yqqcx8nk8KmCLWbnNKiAikR0B7idB/GbQrPezKE02DpEstpB821VgW2PyhhA6 OewKYu+nUU85uDlUwJJEMYabjtHF1pZJNr/EdqJWCTfCRNhnl4RlWC1wXT956A9H2TBq 36RHvAVGhBc4AeAH9MQPtBLywcap0KmrLOxhpbhsTzEa0TlKdt82zsxPk/heb6x0beEs 8+5Peur4hHHQEVd+qwCXGe5KxsK6UfKm4m9uL3A8jF6DTPuz0cdnFt3i/HgzP/yVhlaI ETYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pz3KhshWLUICdhSK3E3AfXkgcII0hYjKSEn97U6OTnE=; b=1L4a1gm4mEHFM8Rrg8AKcZO098Cw42ltXsCVBw/bCBo8vxJpqjTwvIhnPzDmqB5KXT JBrwyuKm5d7245HNqoJ4npPTeyWlHpKA87gx5iuQsq2s2O2DtahSk+OkIX2w27jhwRiZ 0dAIQKOXK+/qFrJ3GszM8LUVunwQ9MQHgkiFaJ3vGSzL/5ZCcPk+0t3BTNIsektCtN5y tsj1il9j+bO4S/F48SbHN5b+P7G8+ZbHCNqi2dksfo1H9a87DtAggHUmnirnIJuAXb7l BvMuURHdBS5CuQLPvLhVZ39WzpmMJ6ghHehcE7t/N3aidanTrj0W+MW3FD0gwXOtNn4t MCAw== X-Gm-Message-State: AOAM530BxoH4o0wFUWjQh2R1WGIG7a00OFCiei+w2hF8rN/F3a4sSGaT j2AVUlUYl4iuCgPX+Mdy63qElQpGr5o= X-Google-Smtp-Source: ABdhPJxNx8yNf81l5AH54+LinEOe7Y1r7R2algcdkcw9H5fDQyGkp04mAsrHDL2n20JJIImcsa6BHg== X-Received: by 2002:adf:f209:: with SMTP id p9mr1984112wro.191.1637803493289; Wed, 24 Nov 2021 17:24:53 -0800 (PST) Received: from localhost.localdomain ([193.48.40.110]) by smtp.gmail.com with ESMTPSA id p27sm1214691wmi.28.2021.11.24.17.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 17:24:53 -0800 (PST) From: zimoun Date: Thu, 25 Nov 2021 02:24:43 +0100 Message-Id: <20211125012443.21840-3-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211125012443.21840-1-zimon.toutoune@gmail.com> References: <20211125012443.21840-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches The tests are defined by the script 'test/runtests.jl' from packages and the parallelism depends on the implementation of this script. Therefore, 'julia' is launched using local worker processes accordingly with 'parallel?'. * guix/build/julia-build-system.scm (check): Set JULIA_CPU_THREADS, add options '--procs'. * guix/build-system/julia.scm (julia-build): Add 'parallel-tests?'. --- guix/build-system/julia.scm | 3 +++ guix/build/julia-build-system.scm | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/guix/build-system/julia.scm b/guix/build-system/julia.scm index 2998663df1..6261f8a55a 100644 --- a/guix/build-system/julia.scm +++ b/guix/build-system/julia.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019 Nicolò Balzarotti ;;; Copyright © 2021 Ludovic Courtès ;;; Copyright © 2021 Jean-Baptiste Volatier +;;; Copyright © 2021 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -79,6 +80,7 @@ (define private-keywords (define* (julia-build name inputs #:key source (tests? #t) + (parallel-tests? #t) (phases '%standard-phases) (outputs '("out")) (search-paths '()) @@ -98,6 +100,7 @@ (define builder #:source #+source #:system #$system #:tests? #$tests? + #:parallel-tests? #$parallel-tests? #:phases #$phases #:outputs #$(outputs->gexp outputs) #:search-paths '#$(sexp->gexp diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-system.scm index 41c69665c6..f0dc419c17 100644 --- a/guix/build/julia-build-system.scm +++ b/guix/build/julia-build-system.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2020 Nicolò Balzarotti ;;; Copyright © 2021 Jean-Baptiste Volatier +;;; Copyright © 2021 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -103,11 +104,15 @@ (define* (precompile #:key source inputs outputs julia-package-name #t) (define* (check #:key tests? source inputs outputs julia-package-name + parallel-tests? #:allow-other-keys) (when tests? (let* ((out (assoc-ref outputs "out")) (package (or julia-package-name (project.toml->name "Project.toml"))) - (builddir (string-append out "/share/julia/"))) + (builddir (string-append out "/share/julia/")) + (jobs (if parallel-tests? + (number->string (parallel-job-count)) + "1"))) ;; With a patch, SOURCE_DATE_EPOCH is honored (setenv "SOURCE_DATE_EPOCH" "1") (setenv "JULIA_DEPOT_PATH" builddir) @@ -115,8 +120,10 @@ (define* (check #:key tests? source inputs outputs julia-package-name (string-append builddir "loadpath/" ":" (or (getenv "JULIA_LOAD_PATH") ""))) + (setenv "JULIA_CPU_THREADS" jobs) (setenv "HOME" "/tmp") (invoke "julia" "--depwarn=yes" + (string-append "--procs=" jobs) (string-append builddir "loadpath/" package "/test/runtests.jl")))) #t)