Subject: Re: bug#50299: The check-tests-true lint check is incorrect for Emacs packages

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 22 Sep 2021 23:41:18 -0400

Hello Maxime,

Maxime Devos <[email-masked]> writes:

> Hi
>
> The attached patch should fix this.
>
> Greetings,
> Maxime.
>
> From c8efd59560509381920cbfe915279bd16077552d Mon Sep 17 00:00:00 2001
> From: Maxime Devos <[email-masked]>
> Date: Tue, 7 Sep 2021 14:25:43 +0200
> Subject: [PATCH] lint: check-tests-true: Allow #:tests? #t for
>  emacs-build-system.
>
> 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.
>
> * guix/lint.scm (check-tests-true): Do not warn if the build system
>   is emacs-build-system.
>
> Fixes: <https://issues.guix.gnu.org/50299>
> Reported-by: Maxim Cournoyer <[email-masked]>
> ---
>  guix/lint.scm  |  5 +++++
>  tests/lint.scm | 10 ++++++++++
>  2 files changed, 15 insertions(+)
>
> diff --git a/guix/lint.scm b/guix/lint.scm
> index 8e80aae938..f708465ed8 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 emacs)
>    #:use-module (guix diagnostics)
>    #:use-module (guix download)
>    #:use-module (guix ftp-client)
> @@ -279,6 +280,10 @@ 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.
> +           (not (eq? emacs-build-system (package-build-system package)))
>             ;; Some packages, e.g. gnutls, set #:tests?
>             ;; differently depending on whether it is being
>             ;; cross-compiled.

Grepping for (tests? #f), I found texlive-build also defaults to #f, so
should be treated the same.

OK to push with such a change.

Thank you!

Maxim