nix-community / nix-doom-emacs

doom-emacs packaged for Nix [maintainers=@thiagokokada]
MIT License
218 stars 43 forks source link

`$out/bin/doom` fails to run #29

Open JonathanLorimer opened 2 years ago

JonathanLorimer commented 2 years ago

I got doom emacs building with nix, but now I am getting this error. I am having trouble tracing it, but it makes me think I probably have a doom directory misconfigured such that its trying to write out to the nix store.

My doom emacs is here but I just copy and pasted from test/doom.d

# -*- lisp-interaction -*-
# vim: set ft=lisp:

(file-error "Creating directory")

(signal file-error ("Creating directory" "Read-only file system" "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/nix"))

(files--ensure-directory "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/nix")

(make-directory "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs//nix/store/l6qbn762za1c8pgbp79jx7jms4jv5xzp-straight-emacs-env/" parents)

(apply make-directory ("/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs//nix/store/l6qbn762za1c8pgbp79jx7jms4jv5xzp-straight-emacs-env/" parents))

((closure ((args parents) (fn . make-directory) t) (&rest pre-args) (apply fn (append pre-args args))) "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs//nix/store/l6qbn762za1c8pgbp79jx7jms4jv5xzp-straight-emacs-env/")

(mapc (closure ((args parents) (fn . make-directory) t) (&rest pre-args) (apply fn (append pre-args args))) ("/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs//nix/store/l6qbn762za1c8pgbp79jx7jms4jv5xzp-straight-emacs-env/" "~/.local/doom/" "~/.cache/doom/"))

(load-with-code-conversion "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/core/core-cli.el" "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/core/core-cli.el" nil t)

(require core-cli)

(load-with-code-conversion "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/bin/doom" "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/bin/doom" nil t)

(command-line-1 ("-scriptload" "/nix/store/p9vqsv0jmqk6zx96f3vk9zb2k7i5pkl4-doom-emacs/bin/doom" "--"))

(command-line)

(normal-top-level)
ckiee commented 2 years ago

Yeah, the doom CLI doesn't work yet. I only recently added it to the final binary and I started writing a fix but it's still sitting somewhere in my local WIP branches. You probably want emacs or systemctl --user start emacs. (if you enabled the daemon)

Regardless, some of the other binaries do work and the doom CLI is quite useless when operating under Nix since it mostly just manages package updates, etc.

JonathanLorimer commented 2 years ago

Ahhh, got it, thanks!

dwarfmaster commented 2 years ago

I feel like this issue should stay open until it is fixed, if only to have a point of reference when encountering this issue. While I agree the doom CLI is mostly useless, doom doctor is still interesting even with this integration.

ckiee commented 2 years ago

Fair, as you wish :P

thiagokokada commented 2 years ago

I feel like this issue should stay open until it is fixed, if only to have a point of reference when encountering this issue. While I agree the doom CLI is mostly useless, doom doctor is still interesting even with this integration.

doom doctor is working for me in the latest version. It will fail to check the Doom Emacs installation itself, however it seems to check most of the other things successfully:

$ doom doctor
The doctor will see you now...

> Checking your Emacs version...
  x Emacs development version detected (29.0.50)
    Doom supports this version, but you are using a development version of
    Emacs!  Be prepared for possibly weekly breakages that

        - you will have to investigate yourself.  might appear, or be
        - solved, on any Emacs update.  might depend subtly on upstream
        - packages updates.

    You might need to unpin packages to get a fix for a specific commit of
    Emacs,  and you should be ready to downgrade Emacs if something is
    just not fixable.
> Checking for Doom's prerequisites...
> Checking for Emacs config conflicts...
> Checking for great Emacs features...
> Checking for private config conflicts...
> Checking for stale elc files...
> Checking for problematic git global settings...
> Checking Doom Emacs...
  x There was an unexpected runtime error
    Message: Failed to run "git"; see buffer *straight-process*
    Backtrace:
      (error "Failed to run %S; see buffer %s" "git" "*straight-process*")
      (if success (let ((output (concat stdout stderr))) (if straight--process-trim (string-trim output) output)) (error "Failed to run %S; see buffer %s" program straight-process-buffer))
      (let* ((result (apply #'straight--process-run program args)) (exit (car result)) (invoked (numberp exit)) (success (and invoked (= 0 exit))) (failure (not success)) (stdout (nth 1 result)) (stderr (nth 2 result))) (ignore result exit i...
      (straight--process-output "git" "branch" "-r")
      (let* ((process-environment (append (list "LC_ALL=C") process-environment)) (default-directory (if local-repo (let ((d (straight--repos-dir local-repo))) (if (file-directory-p d) d default-directory)) default-directory)) (branch-list (...
      (straight-vc-git--default-remote-branch "origin" "melpa")
      (or branch (straight-vc-git--default-remote-branch remote local-repo))
      (let* ((straight--default-directory nil) (default-directory repo-dir) (branch (or branch (straight-vc-git--default-remote-branch remote local-repo)))) (if fork-repo (progn (let ((url (straight-vc-git--encode-url upstream-repo upstream-...
      (progn (straight-vc-git--clone-internal :depth depth :remote remote :url url :repo-dir repo-dir :branch branch :commit commit) (let* ((straight--default-directory nil) (default-directory repo-dir) (branch (or branch (straight-vc-git--d...
      (unwind-protect (progn (straight-vc-git--clone-internal :depth depth :remote remote :url url :repo-dir repo-dir :branch branch :commit commit) (let* ((straight--default-directory nil) (default-directory repo-dir) (branch (or branch (st...
      (let ((success nil) (repo-dir (straight--repos-dir local-repo)) (url (straight-vc-git--encode-url repo host protocol)) (depth (or depth straight-vc-git-default-clone-depth))) (unwind-protect (progn (straight-vc-git--clone-internal :dep...
      (let ((package (plist-get --recipe-- ':package)) (local-repo (plist-get --recipe-- ':local-repo)) (branch (let* ((fork (and t (plist-get --recipe-- :fork)))) (if fork (cond ((plist-member fork ':branch) (plist-get fork ':branch)) ((pli...
! Attempt to load DOOM failed
    (Setting current directory No such file or directory /nix/store/7prf6lkphg1k17p35hqf0frdw0j44szs-straight-emacs-env/straight/repos/melpa/)

There are 1 warnings!
There are 1 errors!