From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oGcVAXLtVGG8MAAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 00:49:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cG9COHHtVGHdVAAAB5/wlQ (envelope-from ) for ; Wed, 29 Sep 2021 22:49:21 +0000 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 B697614016 for ; Thu, 30 Sep 2021 00:49:21 +0200 (CEST) Received: from localhost ([::1]:35438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mViO8-0005P6-Nt for larch@yhetil.org; Wed, 29 Sep 2021 18:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mViNq-0005NN-OQ for bug-guix@gnu.org; Wed, 29 Sep 2021 18:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mViNq-0000iT-H9 for bug-guix@gnu.org; Wed, 29 Sep 2021 18:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mViNq-0001Z1-EW for bug-guix@gnu.org; Wed, 29 Sep 2021 18:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50299: [PATCH v3 01/27] lint: check-tests-true: Allow #:tests? #t for some build systems. References: <87mtoxiqkw.fsf@gmail.com> In-Reply-To: <87mtoxiqkw.fsf@gmail.com> Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 29 Sep 2021 22:49:02 +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.16329556875690 (code B ref 50299); Wed, 29 Sep 2021 22:49:02 +0000 Received: (at 50299) by debbugs.gnu.org; 29 Sep 2021 22:48:07 +0000 Received: from localhost ([127.0.0.1]:50799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mViMw-0001Tg-JX for submit@debbugs.gnu.org; Wed, 29 Sep 2021 18:48:07 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:53586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mViMt-0001Sv-9A for 50299@debbugs.gnu.org; Wed, 29 Sep 2021 18:48:04 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id zyo1250090mfAB406yo107; Thu, 30 Sep 2021 00:48:01 +0200 From: Maxime Devos Date: Thu, 30 Sep 2021 00:47:33 +0200 Message-Id: <20210929224759.21803-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1632955682; bh=fbrT45UqBfb+9CFohqaynJ4e/R/M5BP42oN5PMl89O8=; h=From:To:Cc:Subject:Date; b=Zrv6rktynLjP32CL5d36OZLfKYLD+hmbWQgD9qEUc6ZdDHxuQ39SOkPPmnZvBEJV2 /PLC1EwSerJGZ4aVkaYS4YMegQxc4rXA1LWYB62tQKh4X0S0/pFdiVjfK0wYBhPYXY bQDIOnLXkS5ffoMQRORpbBBhIaZt71SlOsNFIawFAuAA03pooTkXwGI1VFqHiuje1f Y4QjTRxVXILfnc8/GUlBUq5xFB0l1tKWLpn4WqNHAeNg22d9bgPi4yt0MeZ3kaATsw GH7701ZTBWoj7WbVDPvbIuTcP9P4LeiUfCrkKvSGo8acLsrttf/I38N4Itdcbh2AJv N9BO7zRVL1B/w== 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632955761; 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=fbrT45UqBfb+9CFohqaynJ4e/R/M5BP42oN5PMl89O8=; b=hsIZ13vNXCan7ieUbK1S7zjx1mRzJChY93VuVZxFCU/3OCEClUjPJOaAblYT9FdgnX83t2 ggL3KMfD5KM3m/RUPcE/lh+rZQfemRApLZX/OxiCGkxHnDk7EoLLnJyRiOR50RiKXGoSVK USq3ywPz9WU9124dXx/TDDVPQC0QoA6HnDjWfwbIJqNhf+UUEo2QRHmiy3XDGWLfZa5yhg r8GC4NsHFX1pkljmJQ01yfbuU5AqMF118ityDmevJLVd8uFYUHDnyagwncL9lmjbrpP623 Ksj4A5hJ+6JoNYSNUHkcptK0+4wHUnHY4xe6H9tG02dSJw7lPOYnUfkXrU8pCA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632955761; a=rsa-sha256; cv=none; b=XEoN6blPLBVL0d6kqWmdZboSJ8mkTdmlNxrIDCH8jssOV1ARk7Z8/Ez3Ixs2qk52FGpghJ RPG8wp9ko7pq96a+EcdDa0Z1MHaSsZNCAqS/cRErlSUkP0ExL8ULTSBmABbHzVXlqpLrGD aBAKxz2lTgNEmdGSF+mYxSA4t5a7OmdZhteDD9R65rqpt+v958a4+URCsiSOWDrGbREbYu CIGqZelyDuNZr3GhKWwQdn+n1X0hFxkFih0yadmYIDeh4d9jLgnJxO7l12F9k0RhGxZ4ZQ LSMNIhIyZkpDmhH5LSNSY9uWgiioXVtG8lVNLfMfTS1FhJtmjnvfHG+6WQUTUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Zrv6rkty; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 3.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=Zrv6rkty; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: B697614016 X-Spam-Score: 3.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: zif3tTXqC/AC 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 527fda165a..534da85b96 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) @@ -278,6 +279,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 0f51b9ef79..391ebadfc4 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) @@ -324,6 +326,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: 808f9ffbd3106da4c92d2367b118b98196c9e81e prerequisite-patch-id: 7fdac44e8681baaf419cbf8da78cdebb8b9f9757 prerequisite-patch-id: 1f7f1597b9c85b2b1f9db1044d193bcf6ec8650e prerequisite-patch-id: 588ca94b9c4603424094a9cc2854c4f9bc83c7e4 prerequisite-patch-id: 82b4951463e8979d1c4cd15e1ca6a36308b21b51 prerequisite-patch-id: 75cdb9eb6b038adfb605253163b94efd51e0276c -- 2.33.0