From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ANjQAQd6wGOG2AAAbAwnHQ (envelope-from ) for ; Thu, 12 Jan 2023 22:22:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ABrGAQd6wGN7AwEAauVa8A (envelope-from ) for ; Thu, 12 Jan 2023 22:22:15 +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 71CE02C941 for ; Thu, 12 Jan 2023 22:22:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pG51U-0002eu-61; Thu, 12 Jan 2023 16:22: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 1pG51R-0002eZ-SI for guix-patches@gnu.org; Thu, 12 Jan 2023 16:22:06 -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 1pG51O-0003uf-Oy for guix-patches@gnu.org; Thu, 12 Jan 2023 16:22:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pG51O-0002oR-9j for guix-patches@gnu.org; Thu, 12 Jan 2023 16:22:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59487] [PATCH v2 1/2] build-system/dune: Automatically deduce test-target in most cases. Resent-From: Csepp Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Jan 2023 21:22:02 +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: pukkamustard Cc: julien@lepiller.eu, Csepp , 59487@debbugs.gnu.org Received: via spool by 59487-submit@debbugs.gnu.org id=B59487.167355850910792 (code B ref 59487); Thu, 12 Jan 2023 21:22:02 +0000 Received: (at 59487) by debbugs.gnu.org; 12 Jan 2023 21:21:49 +0000 Received: from localhost ([127.0.0.1]:48702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG51A-0002o0-RC for submit@debbugs.gnu.org; Thu, 12 Jan 2023 16:21:49 -0500 Received: from mx1.riseup.net ([198.252.153.129]:56670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG517-0002ni-QM for 59487@debbugs.gnu.org; Thu, 12 Jan 2023 16:21:46 -0500 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4NtHYJ0ymCzDrb2; Thu, 12 Jan 2023 21:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1673558500; bh=CrvWnh98ajcc0U/cyPmpiUAEkeYJLsO9aVq+cPcfvgc=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=EJmqK4IDzY7ZCRje4tPrWNdyoT+jyQoM5Eo9IebYveaGhAh2SctgyEwPgdvim4PJs BxIR+w8dJ4RdDMixdrl5BpqeNnWc2uXVqxcE+I4RXJ15faHRPS/FPKpiVUIWtIQih7 MnImt6xzhOum7FREdUdO2/cdm/dzDomvIeQqMIyM= X-Riseup-User-ID: 36EBEB7E04B14F52E90EAA1030C3F09F4088019FD552B34C4E01075D3CA78D93 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4NtHYH1W6gz1yPb; Thu, 12 Jan 2023 21:21:39 +0000 (UTC) References: <20230111174003.2227-1-raingloom@riseup.net> <86r0vzwxpb.fsf@posteo.net> <86mt6npmmb.fsf@riseup.net> From: Csepp Date: Thu, 12 Jan 2023 22:20:24 +0100 In-reply-to: <86mt6npmmb.fsf@riseup.net> Message-ID: <86fscfphy8.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673558534; a=rsa-sha256; cv=none; b=nOdVt7u3IyomJlTCwMCuMylx6fuYADmXeXcs8RNYvm794Ub4E2NXl3QRhX95yR+lIyZMq1 N3ntcqnkmQmW1+XnWsuMZo8gEzTk2ZUK9v12/6MbO81vT+zXOlgFI2BGS9y/wlB3gFztN3 yenMRqLdqw8nmvo2TJUZe4PiAtC74er+tc1Uk1W9jhRqaLp0frv9mSD2T22W1dwVjJYoHm p+RSJ/FNpo6ZpyrA9vUlYuCdsHA9pwl23zrs6TkowuMuh0SkbLzuDh29kl6wDH4hoCt5vX 7/wZ5OVHgv+L7PzT5ZrBa7/19ZaRBdj9NyYSR70AGJbFFemzO0v49SLfNLhhqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=EJmqK4ID; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673558534; 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: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=zqdZWKMzseKg2jqmLTj/uxrulNUUXNENKBa+71IdDP4=; b=sSuSwp5+ijU+5WRCsykkDmOt/WCjb5eSg+VHZddekGzysi23rj7Aft7oACKZMt78AIatWi qUXAZv+VWloprIYM4MqbDbaXw44KLJycYZrB35GNEwsIVg+h3kMwEYxC+zUkn/vajJ7Ftn RJYF6fwFQYnv8iDQsDmSZQwzAf8LYny4j2gIHEP7FL2a7RQ5j8fuCW/LK329vNMdjTDLc1 DkFTRA09CXnwo434qTcUclWKO4FEkG/0yVK1Ao4SBtbOzupUXi4nIwAPdTlrZ7QYh2Yuti 3HWaBMQufFuuEVRaS1jFCDIVPrZ9527PepoiAgfO+oQ0aZ9wB+cHiovAwy0kyw== X-Migadu-Spam-Score: -0.60 X-Spam-Score: -0.60 X-Migadu-Queue-Id: 71CE02C941 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=EJmqK4ID; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) X-TUID: LA0kXwEObjpv Csepp writes: > pukkamustard writes: > >> Thanks for this! I think it is a valuable improvement. >> >> Csepp writes: >> >>> From: raingloom >>> >>> guix/build-system/dune.scm (dune-build): tests? defaults to #f. >> >> This should be: "test-target defaults to #f". >> >>> + (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" >>> + (append (if test-target (list test-target) '()) >>> + (if package (list "-p" package) >>> dune-release-flags) >>> test-flags)))) >>> #t) >> >> I think what Julien ment (and I agree) is that you can completely drop >> the checks for the files/directories "tests" or "test" to exist. >> >> In your patch, if test-target is #f and "test" or "tests" do not exist, >> then the we will run: >> >> `dune runtest -p package .` >> >> but we could (and maybe should) run just: >> >> `dune runtest -p package` >> >> In fact, we should run this even if the "test" or "tests" directories >> exist (otherwise we might miss running some tests placed in other >> directories). >> >> So this would be enough: >> >>> + (let ((program (if jbuild? "jbuilder" "dune"))) >>> + (apply invoke program "runtest" >>> + (append (if test-target (list test-target) '()) >>> + (if package (list "-p" package) >>> dune-release-flags) >>> test-flags))) >> >> Thinking of this, maybe we can drop the `test-target` argument >> completely. wdyt? >> >> -pukkamustard > > Hmm, makes sense. I'll test what complete removal does. Well ocaml-ppxlib fails and I should be working my MirageOS thesis stuff, so I'll leave this up to you. Or I'll get back to it once I figure out how cross-toolchains are supposed to work.