From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8NzTIsbtUWFNJgAAgWs5BA (envelope-from ) for ; Mon, 27 Sep 2021 18:13:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aClfHsbtUWFGPwAAbx9fmQ (envelope-from ) for ; Mon, 27 Sep 2021 16:13:58 +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 3078893B1 for ; Mon, 27 Sep 2021 18:13:58 +0200 (CEST) Received: from localhost ([::1]:39262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUsr8-00015K-1l for larch@yhetil.org; Mon, 27 Sep 2021 11:47:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUspN-0007jx-VP for bug-guix@gnu.org; Mon, 27 Sep 2021 11:46:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUspN-0006sU-NP for bug-guix@gnu.org; Mon, 27 Sep 2021 11:46:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUspN-000407-Ke for bug-guix@gnu.org; Mon, 27 Sep 2021 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50299: [PATCH v2 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: Mon, 27 Sep 2021 15:46:01 +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: Maxim Cournoyer Received: via spool by 50299-submit@debbugs.gnu.org id=B50299.163275755415255 (code B ref 50299); Mon, 27 Sep 2021 15:46:01 +0000 Received: (at 50299) by debbugs.gnu.org; 27 Sep 2021 15:45:54 +0000 Received: from localhost ([127.0.0.1]:42462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUsp9-0003xN-Na for submit@debbugs.gnu.org; Mon, 27 Sep 2021 11:45:50 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:41726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUsp6-0003wt-6d for 50299@debbugs.gnu.org; Mon, 27 Sep 2021 11:45:44 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id z3li2500H0mfAB4013limQ; Mon, 27 Sep 2021 17:45:42 +0200 From: Maxime Devos Date: Mon, 27 Sep 2021 17:45:11 +0200 Message-Id: <20210927154537.28227-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=1632757543; bh=Pq7fp/vw8+lxdVfbIZxBSUnRbeW+sEON5p7IGv/bvj0=; h=From:To:Cc:Subject:Date; b=KXGDIPPcGnGPJblAH3yt//Yq5+QmT93h3N+uv9aTE1RjRK4ud1lnenVTUNBOGuNTS +6TCrydIlZtciGy2XL+2EXr3Yp+Ymn4W0dEzLz7PMHPVRoG8fyQLA/mPVMxg70OzCJ QeN59EpsyMijElJLCRpLzvXG3oo5Ta2rj0sRcGrEIWBq72g1aD9248F4J8YEJ+LE2D etJa9Zc//5zDjW2gASS4YDDfzM0lxyEL70AC6CEBla/TaLQPX2b1NiSVQkFEcg69la cNRDwl4oPeDRdEVk1m1UJn5xq98XR2QX4XZLUBQgVGpBZt0E+tGZlyfAA9WNwPzJVl 2Y9qHZCNwgyLQ== 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: 50299@debbugs.gnu.org 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=1632759238; 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=Pq7fp/vw8+lxdVfbIZxBSUnRbeW+sEON5p7IGv/bvj0=; b=VrbLkydhwiab/xq31B8pbMCqSp7DvXx+2NvtAGW9lDIrp7tVTH3ln/vy0Q9GzsItUzBA/8 SpM6Cq1DW4PLNFq6Lsf0HIXr3S72NRRqEy+XfIbjU/9CxgfVPj57aahY8nvR+QryrddUbB JYPo3FTVXCiG+UuENnDvQqrCa18Y6qXavZxIURs7aU3rC79eIUFLWK1k7F/tr8gsnBGbHW 1UqH+Figk2i3tkuFlhFIKdWod9iTw88V0zYaVTAu0T8VNLhqGk9dFlzyXjBHC89GZ4hagW Sasby8biNPCrlE62MqlofUZljJT5z9LtnJoLIFPfis4/8EVRCjkZdOHeUsmGYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632759238; a=rsa-sha256; cv=none; b=V+1ddkvQav93BKAiSfGQwdpSKV4XEiZvrnOhrXMiXkTccwxLdvSbfbaEGKxLWz/SM6i1hW s4maQ40kuSd02DYoj15MFKpoCqjjev1R1EjNPF3zgQKEVxNCT1oX3b9TBEn+CUzm/kZIKx vaGlSmylHxY0d3rSb8KheQeIdKsRjlPVpxaIcfvYDW5Aitqhr1NW19g0kUezvd0qjIWGfW yCmqGh5W1qeq5Vp+TCEwUa4JqsOpmr+5RbKO/I30pZRave1sHrhQ7rzCJqX6OBILw9ODzi cKiY8W+T9gft+TlPxwBZvNZrOK57rHs2PBM9xjlK2po9TXH6Yn90qxzA9wwJgA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=KXGDIPPc; 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: 4.71 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=KXGDIPPc; 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: 3078893B1 X-Spam-Score: 4.71 X-Migadu-Scanner: scn1.migadu.com X-TUID: YqiBGku/Womp 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 | 20 ++++++++++++++++++++ 2 files changed, 31 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..7b04dc98d4 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -35,6 +35,7 @@ #:use-module (guix tests http) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system emacs) #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (guix lint) @@ -324,6 +325,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 emacs-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