[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shall updaters fall back to other updaters?
From: |
zimoun |
Subject: |
Re: Shall updaters fall back to other updaters? |
Date: |
Wed, 06 Jul 2022 18:24:41 +0200 |
Hi,
On mer., 06 juil. 2022 at 16:16, Ludovic Courtès <ludo@gnu.org> wrote:
> Nope! ‘all-modules’ *is* deterministic because it builds upon
> ‘scheme-files’, which is deterministic and documented as such.
Oh indeed! My bad, I have overlooked that ’scheme-files’ uses
’scandir*’ instead of Guile scandir; and this scandir* defined in (guix
syscall) sorts the result.
>> Maybe sorting ’%updaters’ would be enough; something like,
>>
>> (define %updaters
>> ;; The list of publically-known updaters.
>> (delay (sort (fold-module-public-variables (lambda (obj result)
>
> Whether ‘fold-module-public-variables’ is deterministic depends on
> whether ‘module-map’ is deterministic, which in turn depends on
> ‘hash-map->list’, which is not deterministic AFAICS.
>
> So what we could do is replace uses of ‘module-map’ with a variant that
> sorts variables.
>
> That said, the only case where it can influence updater order is when
> several of them are defined in the same module.
Indeed, and that’s the case, no? From [1]:
bioconductor cran
savannah generic-html gnu-ftp sourceforge xorg kernel.org gnu
cran bioconductor
kernel.org sourceforge gnu generic-html gnu-ftp xorg savannah
bioconductor cran
sourceforge generic-html gnu-ftp savannah xorg kernel.org gnu
we see that the updaters are file-sorted (removed here) and only they
appear unsorted when defined in the same module (underlined here).
Well, I count 5 calls to ’module-map’. Do you mean replace all of them
by ’module-map*’ which guarantees a stable order? Or only ’module-map’
defined in ’fold-module-public-variables’ and
’fold-module-public-variables*’?
1:
<9a68beb7-50f0-9998-9daf-2b036a8e9e66@crazy-compilers.com">https://yhetil.org/guix/9a68beb7-50f0-9998-9daf-2b036a8e9e66@crazy-compilers.com>
Cheers,
simon