all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#52316: Package example from cookbook has bugs
@ 2021-12-05 19:18 Maxime Devos
  2021-12-06 14:30 ` zimoun
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Devos @ 2021-12-05 19:18 UTC (permalink / raw)
  To: 52316

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52316: Package example from cookbook has bugs
  2021-12-05 19:18 bug#52316: Package example from cookbook has bugs Maxime Devos
@ 2021-12-06 14:30 ` zimoun
  2021-12-06 15:10   ` Maxime Devos
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2021-12-06 14:30 UTC (permalink / raw)
  To: Maxime Devos, 52316

Hi Maxime,

On Sun, 05 Dec 2021 at 19:18, Maxime Devos <maximedevos@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52316: Package example from cookbook has bugs
  2021-12-06 14:30 ` zimoun
@ 2021-12-06 15:10   ` Maxime Devos
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Devos @ 2021-12-06 15:10 UTC (permalink / raw)
  To: zimoun, 52316

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-06 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-05 19:18 bug#52316: Package example from cookbook has bugs Maxime Devos
2021-12-06 14:30 ` zimoun
2021-12-06 15:10   ` Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.