Hi, On mer., 06 juil. 2022 at 16:16, Ludovic Courtès <l...@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: <https://yhetil.org/guix/9a68beb7-50f0-9998-9daf-2b036a8e9...@crazy-compilers.com> Cheers, simon