On Mon, Nov 23, 2020 at 04:03:26PM +0100, Ludovic Courtès wrote: > Do you think we could arrange > to build all the languages in a single ‘haunt build’ run, would that > help?
What kept me from doing a single `haunt build` run are two things. The lesser is that, when not using .guix.scm, running `haunt build` builds only the current locale when testing, which is quick. Only when building all languages via .guix.scm it becomes slow. But the real reason for using multiple haunt invocations is that the website i18n runs as a macro when loading a Scheme file. That is, if a Scheme file contains (G_ `(a (@ (href ,(guix-url "contribute/"))) "Git repositories")) then the G_ macro will use gettext with the currently set locale to change it to, for example `(a (@ (href ,(guix-url "contribute/"))) "repositorios Git") All this runs at macro expansion time before procedure calls like guix-url unlike regular gettext. That is, it runs when Haunt first processes the G_. If the same invocation of Haunt is to process the G_ for multiple translations, it would somehow have to unload and macro expand the code a second time. Anyway, I am not sure the `haunt build` runs are the culprit. If it is a problem with spinning disks only, maybe .guix.scm can be made to copy less from the same disk to the same disk but copy more from disk to a file system in RAM and from a file system in RAM to disk. > I haven’t tried profiling yet, but I can take a look. > > Ludo’. It is funny, when I try to profile via cd ~/src/guix-artwork/website guix install -p haunt-profile guile-syntax-highlight guile-commonmark haunt LC_ALL=en_US.utf8 \ GUILE_LOAD_PATH=haunt-profile/share/guile/site/3.0:$GUILE_LOAD_PATH \ /gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/bin/guile scheme@(guile-user)> ,profile ((@ (haunt ui) haunt-main) "haunt" "build") it crashes, but only when using ,profile. I will investigate tomorrow. Regards, Florian
