From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IOYmLawwfWM2HgEAbAwnHQ (envelope-from ) for ; Tue, 22 Nov 2022 21:27:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2BsgLawwfWOiPAEAauVa8A (envelope-from ) for ; Tue, 22 Nov 2022 21:27:24 +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 838FC103F4 for ; Tue, 22 Nov 2022 21:27:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxZrE-0004rO-EC; Tue, 22 Nov 2022 15:27:04 -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 1oxZrB-0004qv-W2 for guix-patches@gnu.org; Tue, 22 Nov 2022 15:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxZrB-0006DC-Mt for guix-patches@gnu.org; Tue, 22 Nov 2022 15:27:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxZrB-0001VM-IF for guix-patches@gnu.org; Tue, 22 Nov 2022 15:27:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59487] [PATCH 1/2] build-system/dune: Automatically deduce test-target in most cases. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Nov 2022 20:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59487 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: raingloom Cc: 59487@debbugs.gnu.org Received: via spool by 59487-submit@debbugs.gnu.org id=B59487.16691487805732 (code B ref 59487); Tue, 22 Nov 2022 20:27:01 +0000 Received: (at 59487) by debbugs.gnu.org; 22 Nov 2022 20:26:20 +0000 Received: from localhost ([127.0.0.1]:52633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxZqV-0001UO-SI for submit@debbugs.gnu.org; Tue, 22 Nov 2022 15:26:20 -0500 Received: from lepiller.eu ([89.234.186.109]:54476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxZqS-0001UE-Ti for 59487@debbugs.gnu.org; Tue, 22 Nov 2022 15:26:18 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 519d7252; Tue, 22 Nov 2022 20:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=A1oFgBtUjuTX Ir6POGLsXAa41NDbG5W0+0T3cqV3iII=; b=LXH5zYKZk2jVAF0X7yIUYHgfdBEE N9kOd1X/w6mOEVayuhSlnqkHkxVHD60dQIgLZ4UOgMZs6p/wpzWoN1vHu8nKHjwe eTxXz1mxiCUGaRKJm1msqud85/vLXjeAivKjndepXL4jV2SXxEhtBbIoMiqNKvaW 5VRma3yQ7ytX12zTdiM87unbf0+BBJuwS1O5hWhSYmj9rOCvzqU0yiz4SkrAO1Qw wZqpxidTcP/4k7I5nr/Q71qsFkZH4aU8U2M9kRFn/69RDhHkZCbf5RQXiikUGdi/ imRLer2SBWKe99LqDs329lx7orFD7nq1QmCadkpHQIGCQe0V47o0bya8WA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 847fbce1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 22 Nov 2022 20:26:14 +0000 (UTC) Date: Tue, 22 Nov 2022 21:26:13 +0100 From: Julien Lepiller Message-ID: <20221122212613.7acbdd05@sybil.lepiller.eu> In-Reply-To: <20221122194712.31515-1-raingloom@riseup.net> References: <20221122194712.31515-1-raingloom@riseup.net> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.30; x86_64-pc-linux-gnu) 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669148844; 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=MlQpgAPm1e7H/3gt2B9ySAI8n+Y0s0+E14p1R9wdXXY=; b=cYHtxoWPF+m9SHSUzSVs/4sGm5W83Sj4QBrThdUi918ryl96P1wOc7YinWXOPjm2ITLnZ8 AIiwNLGRy4xhGQXXlEXir36i4+HmKGUvqbly/chXyM3/9ILDloTEIw04qzIYaOpTRgQbvc x0I0FEOmcTk0GJXB//kRtztAg5dJYzEl6T/g1/6ksgLJsPKtKa+CY4NkOq8ZsJgH0o0MM0 gnuPO9kEZEkiyK5k/8tEarNnsiACb6oXUJVwWwDFgAxCV2zFwb4bHkad+5NLQ6rL7mwu/T nOcYj1cfpdTesSTk1OEXNf6D9n6XwP7CwlzjnsBByUBVaWIwJ4zOJAujo4N3/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669148844; a=rsa-sha256; cv=none; b=pwRAbueW8/xUwgmDb2NWes6ciIxJ2QrC3bHEjF9LCwjZHiabB1dbIX42siqU5km15v1ywx e4mFDS7DFqAshD618mk3q6VtD8/WUXkRtavirtNmewzBkU14rUlGfx1VISSEfQAv3lgCzz edNuJWY6J76qbPyrS5Pe3fbqqgMI4z4LxZLpFIfHBPq9YrTty54wa4Y3ivb9UzocGjGMcE PTuBkOaSbJd3sJ4S81dZgR206rc8WJEUSVN7RAA8K8HYi4MrovEqSZdbTOiXccGZvcwsbZ IlOTFv0NuoPEJG1BlI5uchQ5Qh3T6CfYDgU/0MKdQc42VCbBdBtay4FTex2p0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=LXH5zYKZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (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" X-Migadu-Spam-Score: 5.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=LXH5zYKZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (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" X-Migadu-Queue-Id: 838FC103F4 X-Spam-Score: 5.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: RrUWErbU0xYe Hi! This LGTM, but maybe put test-target inside the cond too, so we can remove the or? I've looked at how opam does things, and this seems to be the norm: ["dune" "runtest" "-p" name "-j" jobs] Maybe this would work better: (apply invoke program "runtest" (append (if test-target (list test-target) '()) ...)) WDYT? Le Tue, 22 Nov 2022 20:47:11 +0100, raingloom a =C3=A9crit : > guix/build-system/dune.scm (dune-build): tests? defaults to #f. > guix/build/dune-build-system.scm (check): Missing test-target is > auto-detected. --- > guix/build-system/dune.scm | 2 +- > guix/build/dune-build-system.scm | 9 +++++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) >=20 > diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm > index 12100fd8e8..b531d3c337 100644 > --- a/guix/build-system/dune.scm > +++ b/guix/build-system/dune.scm > @@ -107,7 +107,7 @@ (define* (dune-build name inputs > (dune-release-flags ''()) > (tests? #t) > (test-flags ''()) > - (test-target "test") > + (test-target #f) > (install-target "install") > (validate-runpath? #t) > (patch-shebangs? #t) > diff --git a/guix/build/dune-build-system.scm > b/guix/build/dune-build-system.scm index e9ccc71057..8a3725a4e9 100644 > --- a/guix/build/dune-build-system.scm > +++ b/guix/build/dune-build-system.scm > @@ -42,12 +42,17 @@ (define* (build #:key (build-flags '()) (jbuild? > #f) build-flags))) > #t) > =20 > -(define* (check #:key (test-flags '()) (test-target "test") tests? > +(define* (check #:key (test-flags '()) (test-target #f) tests? > (jbuild? #f) (package #f) (dune-release-flags '()) > #:allow-other-keys) > "Test the given package." > (when tests? > - (let ((program (if jbuild? "jbuilder" "dune"))) > + (let ((program (if jbuild? "jbuilder" "dune")) > + (test-target (or test-target > + (cond > + ((file-exists? "tests") "tests") > + ((file-exists? "test") "test") > + (else "."))))) > (apply invoke program "runtest" test-target > (append (if package (list "-p" package) > dune-release-flags)