[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42289: recursive import does not dort alphabetically
From: |
Julien Lepiller |
Subject: |
bug#42289: recursive import does not dort alphabetically |
Date: |
Thu, 16 Jul 2020 07:41:58 -0400 |
User-agent: |
K-9 Mail for Android |
Le 16 juillet 2020 07:35:23 GMT-04:00, zimoun <zimon.toutoune@gmail.com> a
écrit :
>Dear Hartmut,
>
>On Wed, 15 Jul 2020 at 21:10, Hartmut Goebel
><h.goebel@crazy-compilers.com> wrote
>
>> Many modules are sorted and some packages even contain a comment
>asking
>> for being sorted. So I had the impression this is good practice.
>
>I am not sure by the "many". :-)
>Even gnu/packages/crate-io.scm which explicitly asks:
>
>;;; Please: Try to add new module packages in alphabetic order.
>
>and it is not really sorted. :-)
>
> cat crates-io.scm | grep 'define-public' | sort --check
> sort: -:6: disorder: (define-public rust-afl-0.5
>
>
>> Also scanning through the file is easier for humans if packages are
>> sorted - depends on personal work style.
>
>It appears to me as a "good practise" too. On the other hand,
>personally I always scan the packages with "ag" (inside Emacs).
>
>
>However, it is not the point since your initial request is about
>alphabetical sort of "guix import"; which seems better than arbitrary
>order (dependency order). Whatever if gnu/packages/foo.scm is sorted
>or
>not.
The advantage of dependency-sorting is that it makes it easier to add packages
one by one without breaking anything. If they are alphabetically sorted, which
package do you add first? What if the first one depends on another imported
package? Your first commit will be broken because of a reference to an
unexisting package.
>
>If "guix import" returns an alphanumerical sorted list, it is easier
>and
>it does not bother the unsorted modules since the packages are new.
>
>All the best,
>simon