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

Warning: reference to free variable ‘id’ #6791

Closed
Gusted opened this issue Sep 16, 2022 · 2 comments
Closed

Warning: reference to free variable ‘id’ #6791

Gusted opened this issue Sep 16, 2022 · 2 comments
Labels
is:bug Something isn't working as intended module:core:cli Pertains to the `$ doom` script module:core Relevant to Doom core
Milestone

Comments

@Gusted
Copy link

Gusted commented Sep 16, 2022

What did you expect to happen?

No errors were printed while executing doom upgrade.

What actually happened?

While executing doom upgrade an error was printed:

! No profile manifest found. Generating one...
  > Regenerating it...
  > Synchronizing 1 known profile...
    - Added safe-mode
    ✓ Regenerated profile manifest: ~/.emacs.d/.local/cache/known-profiles.el

    
    In toplevel form:
    init.28.el:21:50: Warning: reference to free variable ‘id’

Describe your attempts to resolve the issue

It seems to be trival to resolve this issue as a user, by just removing that line to avoid any runtime errors. But obviously this has to be solved in the generation code.

Steps to reproduce

  1. Execute doom upgrade and upgrade after safe-mode profile commit(not sure which, before upgrading the latest commit was 29e30e8 and I upgraded to 9121100)
  2. See generation error.

System Information

https://pastebin.com/azzffMBn

@Gusted Gusted added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Sep 16, 2022
@hlissner hlissner added module:core Relevant to Doom core module:core:cli Pertains to the `$ doom` script and removed needs-triage Issue hasn't been assessed yet labels Sep 16, 2022
@hlissner hlissner added this to the core v3.0 milestone Sep 16, 2022
@hlissner
Copy link
Member

This issue should now be resolved. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!

@Gusted
Copy link
Author

Gusted commented Sep 16, 2022

Thanks @hlissner for the fix (and for Doom Emacs 😉)!

Just to make sure, doom sync or doom profiles sync should re-write the init code for the profiles right? After upgrading doom it seems it is still the incorrect code:

-> % cat ~/.emacs.d/profiles/init.28.el 
;; -*- lexical-binding: t; tab-width: 8; -*-
;; Updated: 2022-09-16 18:48:57
;; Generated by 'doom profiles sync' or 'doom sync'.
;; DO NOT EDIT THIS BY HAND!
"3.0.0-pre"
(funcall
 (alist-get
  (intern
   (getenv-internal "DOOMPROFILE"))
  (list
   (cons 'safe-mode
         (lambda nil
           (let nil
             (set 'user-emacs-directory
                  (file-truename user-emacs-directory))))))
  (lambda nil
    (if
        (or noninteractive
            (file-equal-p user-emacs-directory "~/.config/emacs")
            (file-equal-p user-emacs-directory "~/.emacs.d"))
        (user-error "Failed to find profile: %s" id)
      (user-error "To be a bootloader, Doom must be installed in ~/.config/emacs or ~/.emacs.d")))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something isn't working as intended module:core:cli Pertains to the `$ doom` script module:core Relevant to Doom core
Projects
Archived in project
Development

No branches or pull requests

2 participants