guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling guix is too slow?


From: Alex Kost
Subject: Re: compiling guix is too slow?
Date: Sun, 02 Jul 2017 23:38:26 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Alex Vong (2017-06-29 12:28 +0800) wrote:

> "Feng Shu" <address@hidden> writes:
>
>> Now I have found that 'guix pull' is too slow,
>> I need 3 hours to compile guix, is it possible to speed it ?
>
> Maybe you can try building from git instead? I used to run
> '$ guix pull && guix package --upgrade', but it gets slower as the
> number of packages of guix increases. So now I use
> '$ git pull && make -j`nproc` && ./pre-inst-env guix package --upgrade'.
> You can read the manual[0] for more info.
>
> If you use emacs-guix, you need to tell emacs-guix the location of your
> git repository as well. I am unware of how others do it. Here is how I
> do it:
>
>   (require 'guix-autoloads)

I always recommend avoid such "hard" requiring, it is better to use
(require 'foo nil t) instead.  With (require 'foo), your emacs config
will be really fragile: once 'foo' feature will disappear (renamed or
'foo' package will be uninstalled, etc.), Emacs will fail loading your
config!  So I would use (require 'guix-autoloads nil t) instead.

>   (guix-prettify-global-mode)

For the same reason, I never call functions from external packages in my
emacs config: what if this function disappear one day? (I don't mean I'm
going to remove it).  If I need to load something on Emacs start, I add
it to 'after-init-hook'.  If it is going to fail, at least it will fail
after your config will be fully loaded.

>   (setq-default guix-current-profile
>                 (file-chase-links "~/.guix-profile" 1))

Hm, I don't think this is needed.  Doesn't Emacs-Guix work with the
default 'guix-current-profile' setting?

>   (require 'guix-build-config)
>   (let ((guix-src-dir (expand-file-name "~/scm/guix/")))
>     (setq-default guix-config-image-directory guix-src-dir)
>     (setq-default guix-config-guix-scheme-compiled-directory guix-src-dir))

I have never had a need to set these variables.  Setting image directory
is definitely not needed (if the default value doesn't work for you,
it's a bug).

As for the directory with Guix compiled files, although you can set it,
it is not really intended for customizing.  Do you have
"~/.config/guix/latest" point to "~/scm/guix"?  Or do you add
"~/scm/guix" to GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH?  Or do you
add it to 'geiser-guile-load-path'?  If anything of this is true, then
you don't need to set that variable.

-- 
Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]