Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid package compile #421

Open
fkrause98 opened this issue Apr 27, 2023 · 6 comments
Open

Avoid package compile #421

fkrause98 opened this issue Apr 27, 2023 · 6 comments

Comments

@fkrause98
Copy link

fkrause98 commented Apr 27, 2023

Hi!

First of all, sorry if this has been asked before or I've missed it but:

Is there a way to avoid building doom every time I use home-manager?

I'm trying to manage doom+emacs through nix-doom-emacs but every time I run home-manager switch to update my config, Doom has to recompile packages which can take 5-10 minutes. Even if I can disable native-comp, doom's setup still runs.

@thiagokokada
Copy link

See #303.

@fkrause98
Copy link
Author

fkrause98 commented Apr 28, 2023

Thanks for the quick answer!

I've added the doomPackageDir option with a path as its value, but now I'm getting this error:

❯ home-manager switch
building '/nix/store/g2w54b87pr4sxnczv0c5p1r6war111zb-emacs-straight-packages.json.drv'...
installing
[nix-doom-emacs] Advising doom to keep it alive...
Loading /nix/store/kzdm8lvjahr81wdbh18f4sbw4f41yl1x-doom-src/bin/doom...
Installing Doom Emacs!

- Skipping /nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-straight/ (already exists)
  - Creating /nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-straight/init.el
  x There was an unexpected runtime error
    Message: File error
    Details: ("Opening output file" "Permission denied" "/nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-straight/init.el")
    Backtrace:
      (write-region nil nil "/nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-str...
      (save-current-buffer (set-buffer temp-buffer) (write-region nil nil te...
      (prog1 (save-current-buffer (set-buffer temp-buffer) (insert-file-cont...
      (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (...
      (let ((temp-file (doom-path doom-user-dir filename)) (temp-buffer (gen...
      (if (let ((p (let ((file filename)) (and (stringp file) (let ((default...
      (let* ((template file) (filename (if template (car-safe (prog1 templat...
      ((closure ((yes\?) (context . #s(doom-cli-context (25675 55223 213684 ...
      (mapc (closure ((yes\?) (context . #s(doom-cli-context (25675 55223 21...
      (let ((doom-print-indent (+ (if t doom-print-indent-increment 0) doom-...
      (if (eq config\? :no) (doom-print (doom-print--format (doom-print--cla...
      (let ((default-directory doom-emacs-dir) (yes\? (progn (or (progn (and...
    ! Wrote extended backtrace to /private/tmp/nix-build-emacs-straight-packages.json.drv-0/tmp.CteB72t6MK/local/logs/cli.doom.230428142703.5905.error
Opening output file: Permission denied, /nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-straight/init.el
error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/6m0wa7bv3p47b40qab7szbl2jd9lb4sw-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:302:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/6m0wa7bv3p47b40qab7szbl2jd9lb4sw-nixpkgs/nixpkgs/pkgs/build-support/trivial-builders.nix:87:14:

           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: builder for '/nix/store/g2w54b87pr4sxnczv0c5p1r6war111zb-emacs-straight-packages.json.drv' failed with exit code 255;
       last 10 log lines:
       >       (let ((temp-file (doom-path doom-user-dir filename)) (temp-buffer (gen...
       >       (if (let ((p (let ((file filename)) (and (stringp file) (let ((default...
       >       (let* ((template file) (filename (if template (car-safe (prog1 templat...
       >       ((closure ((yes\?) (context . #s(doom-cli-context (25675 55223 213684 ...
       >       (mapc (closure ((yes\?) (context . #s(doom-cli-context (25675 55223 21...
       >       (let ((doom-print-indent (+ (if t doom-print-indent-increment 0) doom-...
       >       (if (eq config\? :no) (doom-print (doom-print--format (doom-print--cla...
       >       (let ((default-directory doom-emacs-dir) (yes\? (progn (or (progn (and...
       >     ! Wrote extended backtrace to /private/tmp/nix-build-emacs-straight-packages.json.drv-0/tmp.CteB72t6MK/local/logs/cli.doom.230428142703.5905.error
       > Opening output file: Permission denied, /nix/store/93hkbiav0lc59az5nbciwmbgaz7iawxg-straight/init.el
       For full logs, run 'nix-store -l /nix/store/g2w54b87pr4sxnczv0c5p1r6war111zb-emacs-straight-packages.json.drv'.

Any clues? :)

@pehdfms
Copy link

pehdfms commented Aug 29, 2023

for @fkrause98 and anyone else facing the same issue, the latest comment by quinn-dougherty in #303 clued me into the fact that your doomPackageDir must contain init.el, packages.el and an empty config.el file
perhaps a clearer assertion could be added to check for these files?

@quinn-dougherty
Copy link

quinn-dougherty commented Oct 24, 2023

(this is no longer working on my machine) (edit: false positive)

@quinn-dougherty
Copy link

quinn-dougherty commented Oct 24, 2023

it'd be really great if building straight-emacs-env could parallelize. I have one CPU on 100% and all the others on 1% through most of it

@ckiee
Copy link
Member

ckiee commented Nov 19, 2023

Let's merge this newer issue into #324. I'll respond to @quinn-dougherty there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants