unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Recommend order for package fields?
       [not found] ` <87r1bsqdy8.fsf@nckx>
@ 2021-11-15 16:45   ` zimoun
  2021-11-16 18:54     ` Katherine Cox-Buday
  2021-11-17 11:18     ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: zimoun @ 2021-11-15 16:45 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Guix Devel

Hi,

On Sun, 07 Nov 2021 at 13:40, Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org> wrote:

> So the de-facto ordering of common fields is something like:
>
> name
> version
> source
> build-system
> outputs ; a bit inconsistent, yes, and sometimes put after *inputs
> arguments ; to the build-system
> native-inputs, inputs, propagated-inputs
> metadata: synopsis, description, home-page, properties, license…
>
> There's some minor variation in where to put inputs, but 
> (build-system trivial-build-system) definitely belongs here, above 
> arguments, no matter what.

Does it make sense to add this ordering advice in the manual?  Somewhere
under section “Contributing”.

Especially when there is probably some issues with the semantic, for
instance, compare [1] corner cases:

--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 3.0.7
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (let ((name "OUTER"))
  (package-version
   (package
     (version name)
     (name "name")
     (source #f)
     (build-system #f)
     (synopsis #f)
     (description #f)
     (license #f)
     (home-page #f))))

$1 = "OUTER"
scheme@(guix-user)> (let ((name "OUTER"))
  (package-version
   (package
     (name "INNER")
     (version name)
     (source #f)
     (build-system #f)
     (synopsis #f)
     (description #f)
     (license #f)
     (home-page #f))))
$2 = "INNER"
--8<---------------cut here---------------end--------------->8---

where a record field refers to another defined record field.


If yes, why not add a checker for “guix lint” for warning that?  And
obviously, it could be nice to have an automatic tool for formatting;
something similar as etc/indent-code.el for ordering packages. ;-)

Cheers,
simon


1: <https://yhetil.org/guix/20201204161257.64363a5a@scratchpost.org/>


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

* Re: Recommend order for package fields?
  2021-11-15 16:45   ` Recommend order for package fields? zimoun
@ 2021-11-16 18:54     ` Katherine Cox-Buday
  2021-11-17 11:15       ` Ludovic Courtès
  2021-11-17 11:18     ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Katherine Cox-Buday @ 2021-11-16 18:54 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

zimoun <zimon.toutoune@gmail.com> writes:

> And obviously, it could be nice to have an automatic tool for formatting; > something similar as etc/indent-code.el for ordering packages. ;-)

And cleaning up unused imports too! Does such a thing exist for Guile in general?

-- 
Katherine


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

* Re: Recommend order for package fields?
  2021-11-16 18:54     ` Katherine Cox-Buday
@ 2021-11-17 11:15       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2021-11-17 11:15 UTC (permalink / raw)
  To: Katherine Cox-Buday; +Cc: Guix Devel

Hi,

Katherine Cox-Buday <cox.katherine.e@gmail.com> skribis:

> zimoun <zimon.toutoune@gmail.com> writes:
>
>> And obviously, it could be nice to have an automatic tool for formatting; > something similar as etc/indent-code.el for ordering packages. ;-)
>
> And cleaning up unused imports too! Does such a thing exist for Guile in general?

Unfortunately no.

Ludo’.


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

* Re: Recommend order for package fields?
  2021-11-15 16:45   ` Recommend order for package fields? zimoun
  2021-11-16 18:54     ` Katherine Cox-Buday
@ 2021-11-17 11:18     ` Ludovic Courtès
  2021-11-17 11:40       ` zimoun
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2021-11-17 11:18 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On Sun, 07 Nov 2021 at 13:40, Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org> wrote:
>
>> So the de-facto ordering of common fields is something like:
>>
>> name
>> version
>> source
>> build-system
>> outputs ; a bit inconsistent, yes, and sometimes put after *inputs
>> arguments ; to the build-system
>> native-inputs, inputs, propagated-inputs
>> metadata: synopsis, description, home-page, properties, license…
>>
>> There's some minor variation in where to put inputs, but 
>> (build-system trivial-build-system) definitely belongs here, above 
>> arguments, no matter what.
>
> Does it make sense to add this ordering advice in the manual?  Somewhere
> under section “Contributing”.

I don’t think so; examples in the manual, ‘guix import’, etc. are
already mostly consistent.

> Especially when there is probably some issues with the semantic, for
> instance, compare [1] corner cases:

It’s not a corner case, it’s lexical scoping.  :-)

> If yes, why not add a checker for “guix lint” for warning that?  And
> obviously, it could be nice to have an automatic tool for formatting;
> something similar as etc/indent-code.el for ordering packages. ;-)

I think ‘guix style’ should eventually be improved to replace
etc/indent-code.el.  We could augment it with specific stylers, such as
alphabetically sorting inputs.

Thanks,
Ludo’.


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

* Re: Recommend order for package fields?
  2021-11-17 11:18     ` Ludovic Courtès
@ 2021-11-17 11:40       ` zimoun
  2021-11-19 14:51         ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: zimoun @ 2021-11-17 11:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix Devel

Hi,

On Wed, 17 Nov 2021 at 12:18, Ludovic Courtès <ludo@gnu.org> wrote:

> I don’t think so; examples in the manual, ‘guix import’, etc. are
> already mostly consistent.

From my point of view, an explicit recommendation is always better
than an implicit one.  If it is already consistent and defacto
ordering, it costs nothing to write down such as a recommendation and
it helps, IMHO.

(On a side note, IMHO, similar issues with packages sorted or not
depending on the phase of the Moon, mostly, or with inputs sorted or
not depending on the phase of the Moon, mostly. ;-))


> > Especially when there is probably some issues with the semantic, for
> > instance, compare [1] corner cases:
>
> It’s not a corner case, it’s lexical scoping.  :-)

Thanks for explaining. :-)  Let rephrase: compare different behaviours
[1] depending on lexical scope which is odd in the framework of
"declarative".  Anyway, your point is: it is a feature, not an issue,
IIUC.


> > If yes, why not add a checker for “guix lint” for warning that?  And
> > obviously, it could be nice to have an automatic tool for formatting;
> > something similar as etc/indent-code.el for ordering packages. ;-)
>
> I think ‘guix style’ should eventually be improved to replace
> etc/indent-code.el.  We could augment it with specific stylers, such as
> alphabetically sorting inputs.

Ah yes I have forgotten about "guix style".  :-)


Cheers,
simon


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

* Re: Recommend order for package fields?
  2021-11-17 11:40       ` zimoun
@ 2021-11-19 14:51         ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2021-11-19 14:51 UTC (permalink / raw)
  To: zimoun; +Cc: Guix Devel

Hi!

zimoun <zimon.toutoune@gmail.com> skribis:

> Thanks for explaining. :-)  Let rephrase: compare different behaviours
> [1] depending on lexical scope which is odd in the framework of
> "declarative".  Anyway, your point is: it is a feature, not an issue,
> IIUC.

Exactly.  :-)

We’re verrrry far from having the kind of inconsistency I observed in
Nixpkgs back when I contributed.  And I think the difference mostly lies
in how people work together; it’s a social issue.

Ludo’.


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

end of thread, other threads:[~2021-11-19 14:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3add15b77522d6e9ebd715a19d966666@selfhosted.xyz>
     [not found] ` <87r1bsqdy8.fsf@nckx>
2021-11-15 16:45   ` Recommend order for package fields? zimoun
2021-11-16 18:54     ` Katherine Cox-Buday
2021-11-17 11:15       ` Ludovic Courtès
2021-11-17 11:18     ` Ludovic Courtès
2021-11-17 11:40       ` zimoun
2021-11-19 14:51         ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).