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 ms0.migadu.com with LMTPS id eIiqCUAQImIGLAEAgWs5BA (envelope-from ) for ; Fri, 04 Mar 2022 14:12:32 +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 OHcTBkAQImJ20QAAauVa8A (envelope-from ) for ; Fri, 04 Mar 2022 14:12:32 +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 EDBBB40C79 for ; Fri, 4 Mar 2022 14:12:31 +0100 (CET) Received: from localhost ([::1]:42062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ7jT-0005A6-5A for larch@yhetil.org; Fri, 04 Mar 2022 08:12:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ7iJ-0004LG-6L for bug-guix@gnu.org; Fri, 04 Mar 2022 08:11:19 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ7i5-0005Tr-0Y for bug-guix@gnu.org; Fri, 04 Mar 2022 08:11:18 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nQ7i4-0007Sx-Rl for bug-guix@gnu.org; Fri, 04 Mar 2022 08:11:04 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#50299: [PATCH v5 01/24] 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, 04 Mar 2022 13:11: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.164639941428486 (code B ref 50299); Fri, 04 Mar 2022 13:11:04 +0000 Received: (at 50299) by debbugs.gnu.org; 4 Mar 2022 13:10:14 +0000 Received: from localhost ([127.0.0.1]:44775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQ7hF-0007PH-IX for submit@debbugs.gnu.org; Fri, 04 Mar 2022 08:10:13 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:42682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQ7Yj-00079p-S6 for 50299@debbugs.gnu.org; Fri, 04 Mar 2022 08:01:28 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id 2D1P2700M4UW6Th01D1QiM; Fri, 04 Mar 2022 14:01:24 +0100 From: Maxime Devos Date: Fri, 4 Mar 2022 13:00:56 +0000 Message-Id: <20220304130119.14858-2-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220304130119.14858-1-maximedevos@telenet.be> References: <20220304130119.14858-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=r22; t=1646398884; bh=7i9QSV2aE3IFpHZ7vNTAoCI6fet4Kic+0x1zoQrPGOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DXk8z+qv0ccZyYAdL+9Ib3W+Bq6ft2nzDdgBJrka4CMtp+roGA9fCjvZD22oXYcPg DFmotSXCHtJx+kkrIjkjwIs1AqWIhvu4CXlUkDO918pcOAtCwYPDPJOxWrG1wXtYNx E31phsasNz3Z6sw9sa4mSe2jJHPS/Xo/BuwQo97n7tkg/W/XnVxKiz48ZcO9ZQXUDa CG1Kos50280QkeRbaZsX6sAxc9CAJTR9dAk0FDT83oOpbDFW0C4lik8cbE0uv1Hteo NhbR/Ru7/vh17/8NDiveW7sSpNsWQ+IlzpFUbhbEyDrE5jLHAdhzfN8u/37306n/yV MGxjkrm7H9YMg== 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=1646399552; 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=7i9QSV2aE3IFpHZ7vNTAoCI6fet4Kic+0x1zoQrPGOo=; b=HREPjeixihLa2loDXk3cImq7NT/OMwz+tkE23aKLenhOURK796MfH4/H4lu7hBthbB51hE FaCOevapI3qCeauKOCwR4VQMue5YVt+11+HBbMMbthMPfAuEFPajn9+46jG4iILDxC39Uj mdpmwcD/LTWKMEgYRjoK4R8mF3ev6DF7CKZteayJqqPJYHGTcb48DqfGSi8Qvk4Hfgpc3D qxOPWP1MxNT4D//ImQ8LidHxwIW0mes/uPoyQ6q8LJ+iG0Rmm+CHLBdbwdu4653BKlUX8l DEshezWDPz+XSt1WJqx8057OQJpD8DkBFanHcByVEIIxCRnlXy+BQar8fh5JdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646399552; a=rsa-sha256; cv=none; b=ul2KE/beKYR0TZNBb4IG4x4UMF9kX4k7VzUm6wcREo4GLDrlHcNd522exh4lziWniNKUI8 TmNGX5+4mLXBpXFfzZRsaKHyEFt0LpD9j463f3TDCNOrsPy+Y/+nbln0ENyzLfmI4pbyF4 Gebmp7IXSviXtPozoEJlvXnLRWouETjjTg50VxElcJj2NF5dZDs0pRMWMWm+kNFEHkIp5r foYCF16adnH8+uYKtoR2Am36xog7ZNIDHf9BibA8K+oTM6ul8dt0vK4ORFU9TMv7vvuqHf XBm/6rGWqGq04/ZkwUlVHwqg0FBAotikxpNN17c4P+hJ14Ct94EMGL7xq0J40g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=DXk8z+qv; 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: 7.24 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=DXk8z+qv; 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: EDBBB40C79 X-Spam-Score: 7.24 X-Migadu-Scanner: scn1.migadu.com X-TUID: pj0AuKITFZnV 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 3ca7a0b608..e535eb8158 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 base-commit: 29091731a0c6cb649cdfd72297575fe2bb2a9591 -- 2.30.2