From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0IC3Ltz1zmF1kQAAgWs5BA (envelope-from ) for ; Fri, 31 Dec 2021 13:21:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sI4NLNz1zmFJFwEA9RJhRA (envelope-from ) for ; Fri, 31 Dec 2021 13:21:48 +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 112AF310F9 for ; Fri, 31 Dec 2021 13:21:48 +0100 (CET) Received: from localhost ([::1]:47986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3Gup-0005iz-9M for larch@yhetil.org; Fri, 31 Dec 2021 07:21:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3GpJ-0007tA-5U for bug-guix@gnu.org; Fri, 31 Dec 2021 07:16:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3GpI-0004LS-OO for bug-guix@gnu.org; Fri, 31 Dec 2021 07:16:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n3GpI-0001yX-L3 for bug-guix@gnu.org; Fri, 31 Dec 2021 07:16:04 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#50299: [PATCH v4 01/25] lint: check-tests-true: Allow #:tests? #t for some build systems. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 31 Dec 2021 12:16:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50299 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 50299@debbugs.gnu.org Received: via spool by 50299-submit@debbugs.gnu.org id=B50299.16409529317387 (code B ref 50299); Fri, 31 Dec 2021 12:16:04 +0000 Received: (at 50299) by debbugs.gnu.org; 31 Dec 2021 12:15:31 +0000 Received: from localhost ([127.0.0.1]:55296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3Gol-0001uy-0j for submit@debbugs.gnu.org; Fri, 31 Dec 2021 07:15:31 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:35756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3God-0001rp-4z for 50299@debbugs.gnu.org; Fri, 31 Dec 2021 07:15:25 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id d0FM260074UW6Th010FMKe; Fri, 31 Dec 2021 13:15:21 +0100 From: Maxime Devos Date: Fri, 31 Dec 2021 12:14:43 +0000 Message-Id: <20211231121507.70323-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211231121507.70323-1-maximedevos@telenet.be> References: <20211231121507.70323-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1640952921; bh=FM31V3ymizPUpgKQMIPETV5Kj5tkxtEWRXn98Bv6a/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Cn4nevKi6hTh9pCxsqW5euLBe+cYVjEgECcHU+szTBk5UyaRFnbFZ+YzXOfDO+E8D uYjOsuinh/n0IHcj8bkD0BiXTBGjoOGiA7nbWPzNwsP17rpkgKUeEVJf47gJQ8rRk3 Z7m+3A8GTCCnNbgSp2w3HoMDtMJFqrHRHut+t4XigXfMj4+P3jFxC9/UqlUwJeI69c KSr8Zhx8TqsTM8vGMbqCGecXD4fneKBcVSqP+9pz4xkoirtkbTzlcNc2Fa6u4YOfD7 yZHhvQeGdTFkAybKTbjIwpMh5DgqzwKZl1MuESiNMPp/UnZn5ifZzRNYW4W3Iefsiw 0cMj6pa8hiwDw== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Cournoyer Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" 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=1640953308; 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=FM31V3ymizPUpgKQMIPETV5Kj5tkxtEWRXn98Bv6a/I=; b=EmoL2KjXOWkkf0ByqQ6bZazTSgDqpzqxhUNcHIV4AhCHv5OT6uMfEzQkaDFAcUMio63hCQ FQZ/fE9MV6sdkkY4D4+xmkFIM/pIM3WtfTQhD7QE2q/XqmEY5GHLI0UuBmSf4L8s4b6/QP opwLXH2p0x4WygcKnzv6o0hLdo2QG/SxUV08OcvY7PE0f4Jyc/dlVsPTFJ9lsaQzjH9PlX oELDsZ1T5v9sG+d8e/BHem1mtj9emiEX9WMPcKsGSxHtpPcq4LvH9YvQXFIJ3Q5MOgIytQ DU06sqY3wt8d7wo1qWEbOBDmJL8p8Cdpi4DqLHfxkFG8titVHjAJGEjOyCy2pw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640953308; a=rsa-sha256; cv=none; b=ZcquKGsN4m1bY71MyS+yQfq8evL9LlzuLDVm33WpXk5IN8WkpZH1ijc/yzrvIoFTSwBixz rmkIZ/hb83BJx77sStw7dlsa28AfkYQkalRzru62PzZsJsfSdmJDChedlplsdZV3+mJb66 U/tfT40QjFGQzhCDyJZ1f5zXZBjYSLuCnom9cbUWxC8ygc/QGzJaLyfa3D2YO4BgwSNcvU ft3Rb4+vnaygORFrRYf8Bq7BQxSc4S5qKcslONVQ+K7O+KiF7YocihnV5Vwx18Sx9Ym7ns 1P1mMSudxDZ7cJDBdlVQqzKBihxpKzOon754Ige4NOGdrWPbdm5tgsbhhUjKXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Cn4nevKi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.58 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Cn4nevKi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 112AF310F9 X-Spam-Score: -0.58 X-Migadu-Scanner: scn1.migadu.com X-TUID: qz8eZs6gW1TO emacs-build-system sets #:tests? #f by default, so the linter shouldn't warn if #:tests? #t is set for packages using emacs-build-system. Likewise for texlive-build-system * guix/lint.scm (check-tests-true): Do not warn if the build system is emacs-build-system or texlive-build-system. * tests/lint.scm ("tests-true: #:tests? #t acceptable for emacs packages") ("tests-true: #:tests? #t acceptable for texlive packages"): New tests. Fixes: Reported-by: Maxim Cournoyer --- guix/lint.scm | 11 +++++++++++ tests/lint.scm | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/guix/lint.scm b/guix/lint.scm index 379bd0e80b..8655f3aea7 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -34,6 +34,7 @@ #:use-module (guix store) #:autoload (guix base16) (bytevector->base16-string) #:use-module (guix base32) + #:use-module (guix build-system) #:use-module (guix diagnostics) #:use-module (guix download) #:use-module (guix ftp-client) @@ -279,6 +280,16 @@ superfluous when building natively and incorrect when cross-compiling." (eq? tests? #t)) (package-arguments package))) (if (and (tests-explicitly-enabled?) + ;; emacs-build-system sets #:tests? #f by default, therefore + ;; writing #:tests? #t in package definitions using + ;; emacs-build-system is reasonable. Likewise for + ;; texlive-build-system. + ;; + ;; Compare the name of the build system instead of the build system + ;; itself to avoid loading unnecessary modules when only a few + ;; modules are linted. + (not (memq (build-system-name (package-build-system package)) + '(emacs texlive))) ;; Some packages, e.g. gnutls, set #:tests? ;; differently depending on whether it is being ;; cross-compiled. diff --git a/tests/lint.scm b/tests/lint.scm index 76c2a70b3a..6bb24370da 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -35,6 +35,8 @@ #:use-module (guix tests http) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system texlive) + #:use-module (guix build-system emacs) #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (guix lint) @@ -338,6 +340,25 @@ `(#:tests? ,(not (%current-target-system))))))) (check-tests-true pkg))) +;; The emacs-build-system sets #:tests? #f by default. +(test-equal "tests-true: #:tests? #t acceptable for emacs packages" + '() + (let ((pkg (dummy-package "x" + (build-system emacs-build-system) + (arguments + `(#:tests? #t))))) + (check-tests-true pkg))) + +;; Likewise, though the 'check' phase is deleted by default, +;; so #:tests? #t won't be useful by itself. +(test-equal "tests-true: #:tests? #t acceptable for texlive packages" + '() + (let ((pkg (dummy-package "x" + (build-system texlive-build-system) + (arguments + `(#:tests? #t))))) + (check-tests-true pkg))) + (test-equal "inputs: pkg-config is probably a native input" "'pkg-config' should probably be a native input" (single-lint-warning-message -- 2.30.2