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

"unbound variable" errors #44

Open
lafrenierejm opened this issue May 16, 2021 · 13 comments
Open

"unbound variable" errors #44

lafrenierejm opened this issue May 16, 2021 · 13 comments

Comments

@lafrenierejm
Copy link

First, thank you for the package! When it's all working it's a joy to use. Unfortunately, right now I am encountering an error.

If I execute M-x guix-package-by-name immediately after starting a fresh Emacs instance, I get the following error (as copied from *Messages*):

guix-geiser-eval: Error in evaluating guile expression: While executing meta-command:
error: %max-returned-list-size: unbound variable

Attempting to run the same command again in the same Emacs instance gives me a slightly different error:

guix-geiser-eval: Error in evaluating guile expression: While executing meta-command:
error: package-names*: unbound variable

This is with emacs 27.2 and emacs-guix 0.5.2-4.8ce6d21 installed via Guix on Guix System. Nothing in my Emacs config should be relevant except the use-package declarations to load the packages:

(use-package geiser-guile)

(use-package guix)
@TheCatster
Copy link

I have the same exact issue, except I am running Emacs 28.05 native-comp (but also on Guix System). I've tried playing with different ideas but still have those two errors.

@oatmealm
Copy link

Same here on any command. Emacs 28.x native-comp.

if: Error in evaluating guile expression: While executing meta-command:
error: package-names*: unbound variable

@TheCatster
Copy link

If it’s occurring for the author on version 27, I think we can rule out native comp as the root of the cause. Could this have to do somehow with Guix 1.3.0?

@IaH0nii3Re
Copy link

building emacs-guix in my own guix channel with emacs-geiser version 0.16 emacs-geiser-guile version 0.17 solved the problem
in GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0). I have submitted patches to guix, but they have not been accepted yet.

@oatmealm
Copy link

Hi. Would appreciate if you could share your setup. I've just picked up Guix couple of days ago and still trying to wrap my head around. Thought guix.el would be very helpful at this stage.

@IaH0nii3Re
Copy link

Use it at your own risk. Add to channels.scm file.

    (cons*
     (channel
      (name 'rrr)
      (url "https://git.sr.ht/~akagi/rrr")
      (introduction
       (make-channel-introduction
        "794d6e5eb362bfcf81ada12b6a49a0cd55c8e031"
        (openpgp-fingerprint
         "FF72 877C 4F21 FC4D 467D  20C4 DCCB 5255 2098 B6C1"))))
     %default-channels)

After successful guix pull try to install guix.el with guix package -i emacs-rrr-guix

@gcentauri
Copy link

just bumped into this problem. i'm running guix on top of my os. i have geiser, guile, emacs-guix all installed via guix. geiser 0.16 geiser-guile 0.17 guix-0.5.2-4.8ce6d21

any other thoughts?

@gcentauri
Copy link

FWIW i managed to get it working after making sure i had installed guile and guix in my profile, logged out and logged back in to ensure the GUILE_LOAD_PATH was being set in my environment. i'm still having an issue where (require 'guix) isn't loading any of the functions until i manually load the autoloads file.

@IaH0nii3Re
Copy link

IaH0nii3Re commented Jul 26, 2021

FWIW i managed to get it working after making sure i had installed guile and guix in my profile, logged out and logged back in to ensure the GUILE_LOAD_PATH was being set in my environment. i'm still having an issue where (require 'guix) isn't loading any of the functions until i manually load the autoloads file.

Paste this into your Emacs init file:

(require 'guix-emacs)

(add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp")

(guix-emacs-autoload-packages)

@gcentauri
Copy link

Paste this into your Emacs init file:

(require 'guix-emacs)

(add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp")

(guix-emacs-autoload-packages)

i don't have emacs installed via guix. i suppose i can just do that :P

@gcentauri
Copy link

gcentauri commented Jul 27, 2021

Ah, I found the missing piece. I was installing from the git repo with straight and needed this:

Now all you need, is to add ‘elisp’ directory to the Emacs
‘load-path’ and to load the generated autoloads. This can be done by
adding the following code into your Emacs init file.

     (add-to-list 'load-path "/path/to/emacs-guix/elisp")
     (require 'guix-autoloads nil t)

@declantsien
Copy link

I have the exactly same issue when using guix.el on Guix System.
Fixed it by removing these lines from my emacs init.el

(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/nonguix")
  (add-to-list 'geiser-guile-load-path "~/src/guix"))

I assume geiser-guile-load-path should buffer/dir local?

@Leirda01
Copy link

Leirda01 commented Mar 1, 2023

I had the same issue both on Guix System and foreign Guix, and removing the explicit additions to geiser-guile-load-path indeed fixed it.

I then wondered as to why I did this in the first place, and found the answer lying in the Guix documentation about the perfect setup.

My assumption is that Geiser uses the GUILE_LOAD_PATH environment variable unless geiser-guile-load-path is set, in which case it only uses the latter.

The GUILE_LOAD_PATH directory contains various Guix related scheme files defining the modules that guix.el needs. ~/src/guix (it usually contains the Guix source repository) doesn't directly exposes those files, explaining the errors.

Furthermore, the Guix source repository already have an .dir-locals file that set guile-geiser-load-path for the current project.

But as it is already handled in this file, I don't see why we should manually configure geiser-guile-load-path, and I think that a proper solution would be to remove this notice in the Guix upstream documentation.

We could also update the emacs-guix documentation to explain this, suggesting one of the following if manually setting geiser-guile-load-path is ever required:

  • also add /run/current-system/profile/share/guile/site/3.0 (somewhat fragile: what about guile updates?) or
  • include the GUILE_LOAD_PATH environment variable in geiser-guile-load-path (probably better but don't know for sure).

What do you think?

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

7 participants