GNU bug report logs - #52316
Package example from cookbook has bugs

Previous Next

Package: guix;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Sun, 5 Dec 2021 19:19:02 UTC

Severity: normal

To reply to this bug, email your comments to 52316 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#52316; Package guix. (Sun, 05 Dec 2021 19:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 05 Dec 2021 19:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: bug-guix <at> gnu.org
Subject: Package example from cookbook has bugs
Date: Sun, 05 Dec 2021 19:18:17 +0000
Hi guix,

The example at
https://guix.gnu.org/cookbook/en/html_node/Extended-example.html has
two bugs:

#:tests? is unconditionally set to #true. This is bad for cross-
compilation and --without-tests=PACKAGE reasons, and would be flagged
by the linter.

In the new 'check' phase, libgit2_clar is invoked unconditionally. This
would be flagged by the linter.

Also, not exactly a bug, but still bad practice: the web page suggests:

#:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))
                   "CC=gcc")

however, hardcoding gcc is bad for cross-compilation reasons. It should
use (cc-for-target) instead.

Greetings,
Maxime





Information forwarded to bug-guix <at> gnu.org:
bug#52316; Package guix. (Mon, 06 Dec 2021 14:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 52316 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>, 52316 <at> debbugs.gnu.org
Subject: Re: bug#52316: Package example from cookbook has bugs
Date: Mon, 06 Dec 2021 15:30:11 +0100
Hi Maxime,

On Sun, 05 Dec 2021 at 19:18, Maxime Devos <maximedevos <at> telenet.be> wrote:

> The example at
> https://guix.gnu.org/cookbook/en/html_node/Extended-example.html has
> two bugs:
>
> #:tests? is unconditionally set to #true. This is bad for cross-
> compilation and --without-tests=PACKAGE reasons, and would be flagged
> by the linter.

For cross-compilation, yes.  For ’--without-tests’, it is not an issue,
IMHO, or why is it?

> In the new 'check' phase, libgit2_clar is invoked unconditionally. This
> would be flagged by the linter.

Since it is an example showing non-trivial things, maybe it can be
pedagogical to have something half good, if and only if, “guix lint”
reports the half bad.  And add an explanation.  WDYT?


> Also, not exactly a bug, but still bad practice: the web page suggests:
>
> #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))
>                    "CC=gcc")
>
> however, hardcoding gcc is bad for cross-compilation reasons. It should
> use (cc-for-target) instead.

I agree.

Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#52316; Package guix. (Mon, 06 Dec 2021 15:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 52316 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: zimoun <zimon.toutoune <at> gmail.com>, 52316 <at> debbugs.gnu.org
Subject: Re: bug#52316: Package example from cookbook has bugs
Date: Mon, 06 Dec 2021 15:10:59 +0000
Hi,

zimoun schreef op ma 06-12-2021 om 15:30 [+0100]:
> [....]
> > #:tests? is unconditionally set to #true. This is bad for cross-
> > compilation and --without-tests=PACKAGE reasons, and would be
> > flagged
> > by the linter.
> 
> For cross-compilation, yes.  For ’--without-tests’, it is not an
> issue,
> IMHO, or why is it?

I was mistaken, unconditional #true is unproblematic for --without-
tests, because --without-tests replaces the #true by #false IIUC.

> > In the new 'check' phase, libgit2_clar is invoked unconditionally.
> > This
> > would be flagged by the linter.
> 
> Since it is an example showing non-trivial things, maybe it can be
> pedagogical to have something half good, if and only if, “guix lint”
> reports the half bad.  And add an explanation.  WDYT?

I don't know what would be best from a pedagogical perspective: showing
the right code directly (showing more non-trivial things and not
showing any bugs, but possibly showing too much at once), or writing 
the half-right code (with a short comment telling there's a bug that
will be explained later).

The second thing doesn't seem bad to me, but IANAP (I am not a
pedagogue).

Greetings,
Maxime





This bug report was last modified 2 years and 356 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.