syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.72k stars 4.9k forks source link

Symbol's value as variable is void: hydra-ivy/keymap #10404

Closed avdv closed 6 years ago

avdv commented 6 years ago

Description :octocat:

After updating the develop branch from c130014f..4fe1600f while using the ivy layer, I get this message on startup.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: Spacemacs fails initialization.

Expected behaviour: :heart: :smile: No error. :smile:

System: Linux, Emacs 25.3.1

Backtrace :paw_prints:

Debugger entered--Lisp error: (void-variable hydra-ivy/keymap)
  (define-key hydra-ivy/keymap [escape] (quote hydra-ivy/keyboard-escape-quit-and-exit))
  ivy/init-ivy-hydra()
  funcall(ivy/init-ivy-hydra)
  (let* ((pkg-name (eieio-oref pkg (quote :name))) (owner (car (eieio-oref pkg (quote :owners))))) (spacemacs-buffer/message (format "%S -> init (%S)..." pkg-name owner)) (funcall (intern (format "%S/init-%S" owner pkg-name))))
  configuration-layer//configure-package([eieio-class-tag--cfgl-package ivy-hydra nil (ivy) nil nil elpa t nil nil nil nil nil])
  mapc(configuration-layer//configure-package ([eieio-class-tag--cfgl-package abbrev nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package ace-link nil (spacemacs-navigation) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package ace-window nil (spacemacs-base) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package adaptive-wrap nil (spacemacs-editing-visual) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package adoc-mode nil (asciidoc) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package aggressive-indent nil (spacemacs-editing) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package anaconda-mode nil (python) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package ansi-colors nil (spacemacs-visual) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package ansible nil (ansible) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package ansible-doc nil (ansible) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package archive-mode nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package auto-compile nil (emacs-lisp) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package auto-dictionary nil (spell-checking) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package auto-highlight-symbol nil (spacemacs-navigation) (ivy) nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package avy nil (spacemacs-editing) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package bookmark nil (spacemacs-base) nil (ivy) built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package browse-at-remote nil (version-control) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package bundler nil (ruby) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package centered-buffer-mode nil (spacemacs-base) nil nil local t nil nil nil nil nil] [eieio-class-tag--cfgl-package centered-cursor-mode nil (spacemacs-navigation) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package chruby nil (ruby) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package clean-aindent-mode nil (spacemacs-editing) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package coffee-mode nil (javascript) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package column-enforce-mode nil (spacemacs-editing-visual) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package compile nil (spacemacs-navigation) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package conf-mode nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package counsel nil (ivy) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package counsel-css nil (html) nil nil (recipe :fetcher github :repo "hlissner/emacs-counsel-css") t nil nil nil nil (ivy)] [eieio-class-tag--cfgl-package counsel-projectile nil (spacemacs-layouts) (ivy) nil elpa t nil nil nil nil (projectile)] [eieio-class-tag--cfgl-package css-mode nil (html) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package csv-mode nil (csv) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package cython-mode nil (python) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package debug nil (emacs-lisp) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package default-helm-config nil (spacemacs-completion) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package default-ivy-config nil (spacemacs-completion) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package default-org-config nil (spacemacs-org) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package define-word nil (spacemacs-language) nil nil elpa (not (bound-and-true-p osx-use-dictionary-app)) nil nil nil nil nil] [eieio-class-tag--cfgl-package desktop nil (spacemacs-visual) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package diff-hl nil (version-control) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package diff-mode nil (version-control) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package dired nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package dired-x nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package doc-view nil (spacemacs-navigation) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package dumb-jump nil (spacemacs-misc) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package eclim nil (java) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package edebug nil (emacs-lisp) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package ediff nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package editorconfig nil (spacemacs-editing) nil nil elpa t nil nil nil nil nil] [eieio-class-tag--cfgl-package eldoc nil (spacemacs-base) nil (java scala python emacs-lisp typescript) built-in t nil nil nil nil nil] [eieio-class-tag--cfgl-package electric-indent-mode nil (spacemacs-base) nil nil built-in t nil nil nil nil nil] ...))
  (let (packages-to-configure) (let ((--dolist-tail-- packages) pkg-name) (while --dolist-tail-- (setq pkg-name (car --dolist-tail--)) (spacemacs-buffer/loading-animation) (let ((pkg (configuration-layer/get-package pkg-name))) (cond ((eieio-oref pkg (quote :lazy-install)) (spacemacs-buffer/message (format "%S ignored since it can be lazily installed." pkg-name))) ((and (eieio-oref pkg ...) (not ...)) (spacemacs-buffer/message (format "%S ignored since it has been excluded." pkg-name))) ((null (eieio-oref pkg ...)) (spacemacs-buffer/message (format "%S ignored since it has no owner layer." pkg-name))) ((not (configuration-layer//package-reqs-used-p pkg)) (spacemacs-buffer/message (format ... pkg-name))) ((not (cfgl-package-enabled-p pkg)) (spacemacs-buffer/message (format "%S is disabled." pkg-name))) (t (let (...) (if dir ...)) (if (memq ... ...) nil (configuration-layer//activate-package pkg-name)) (cond (... ...) (t ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))) (setq packages-to-configure (reverse packages-to-configure)) (mapc (quote configuration-layer//configure-package) packages-to-configure) (mapc (quote configuration-layer//post-configure-package) packages-to-configure))
  configuration-layer//configure-packages-2((abbrev ace-link ace-window adaptive-wrap add-node-modules-path adoc-mode aggressive-indent anaconda-mode ansi-colors ansible ansible-doc archive-mode auto-compile auto-dictionary auto-highlight-symbol avy bookmark bracketed-paste browse-at-remote bundler centered-buffer-mode centered-cursor-mode chruby clean-aindent-mode coffee-mode column-enforce-mode company-emacs-eclim compile conf-mode counsel counsel-css counsel-projectile css-mode csv-mode cython-mode debug default-helm-config default-ivy-config default-org-config define-word desktop diff-hl diff-mode dired dired-x doc-view dockerfile-mode dracula-theme dumb-jump eclim ...))
  configuration-layer//configure-packages((abbrev ace-link ace-window adaptive-wrap add-node-modules-path adoc-mode aggressive-indent anaconda-mode ansi-colors ansible ansible-doc archive-mode async auto-compile auto-dictionary auto-highlight-symbol avy bind-key bind-map bookmark bracketed-paste browse-at-remote bundler centered-buffer-mode centered-cursor-mode chruby clean-aindent-mode coffee-mode column-enforce-mode company-emacs-eclim compile conf-mode counsel counsel-css counsel-projectile css-mode csv-mode cython-mode debug default-helm-config default-ivy-config default-org-config define-word desktop diff-hl diff-mode diminish dired dired-x doc-view ...))
  configuration-layer/load()
  (let ((file-name-handler-alist nil)) (require (quote core-spacemacs)) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-download-tarball) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (if dotspacemacs-enable-server (progn (require (quote server)) (if (server-running-p) nil (server-start)))))
  (if (not (version<= spacemacs-emacs-min-version emacs-version)) (error (concat "Your version of Emacs (%s) is too old. " "Spacemacs requires Emacs version %s or above.") emacs-version spacemacs-emacs-min-version) (let ((file-name-handler-alist nil)) (require (quote core-spacemacs)) (configuration-layer/load-lock-file) (spacemacs/init) (configuration-layer/stable-elpa-download-tarball) (configuration-layer/load) (spacemacs-buffer/display-startup-note) (spacemacs/setup-startup-hook) (if dotspacemacs-enable-server (progn (require (quote server)) (if (server-running-p) nil (server-start))))))
  eval-buffer(#<buffer  *load*> nil "/home/claudio/.emacs.d/init.el" nil t)  ; Reading at buffer position 1438
  load-with-code-conversion("/home/claudio/.emacs.d/init.el" "/home/claudio/.emacs.d/init.el" t t)
  load("/home/claudio/.emacs.d/init" t t)
  #[0 "\205\266

Um, I think I found the issue... I had to use :demand t in layers/+completion/ivy/packages.el to force loading the ivy-hydra package before the define-key call.

Declspeck commented 6 years ago

:demand t fixes this for me too:

 (defun ivy/init-ivy-hydra ()
-  (use-package ivy-hydra)
+  (use-package ivy-hydra
+    :demand t)
   (define-key hydra-ivy/keymap [escape] 'hydra-ivy/keyboard-escape-quit-and-exit))

Likely related to the commit "Defer packages by default using use-package-always-defer"

radziej commented 6 years ago

Can confirm, that :demand t fixes the issue.

duianto commented 6 years ago

ezchi has opened a PR: Fix (void-variable hydra-ivy/keymap) issue #10406

bmag commented 6 years ago

Fixed by https://github.com/syl20bnr/spacemacs/commit/f294d42ae553a1d8cdb30967935e1cf23d16e5c2, please report if there are still issues.