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

:loader :path packages keep trying to get installed #40

Closed
ivan-m opened this issue Mar 14, 2017 · 12 comments
Closed

:loader :path packages keep trying to get installed #40

ivan-m opened this issue Mar 14, 2017 · 12 comments

Comments

@ivan-m
Copy link

ivan-m commented Mar 14, 2017

I have a few files that I've picked up along the way that aren't available via package.el. Previously I had just either autoloaded or require'd them.

I'm now trying to load them up using req-package but it doesn't seem to work; for example if I have this in my config:

(req-package hs-lint
  :loader :path
  :commands hs-lint)

But when I try and launch Emacs I get the following backtrace:

Debugger entered--Lisp error: (error "Package ‘hs-lint-’ is unavailable")
  signal(error ("Package ‘hs-lint-’ is unavailable"))
  error("Package `%s-%s' is unavailable" hs-lint "")
  package-compute-transaction(nil ((hs-lint)))
  package-install(hs-lint)
  use-package-ensure-elpa(hs-lint t)
  use-package-ensure-elpa(hs-lint)
  (progn (quote "/Users/ivan/.emacs.d/site-lisp/hs-lint.el") (use-package-ensure-elpa (quote hs-lint)) (if (fboundp (quote hs-lint)) nil (autoload (function hs-lint) "hs-lint" nil t)) (condition-case err (progn) ((debug error) (ignore (display-warning (quote use-package) (format "%s %s: %s" "hs-lint" ":init" (error-message-string err)) :error)))) (eval-after-load (quote hs-lint) (function (lambda nil (progn (condition-case err (progn (req-package-handle-loading ... ...) (req-package-loaded ...)) ((debug error) (ignore ...))) t)))))
  eval((progn (quote "/Users/ivan/.emacs.d/site-lisp/hs-lint.el") (use-package-ensure-elpa (quote hs-lint)) (if (fboundp (quote hs-lint)) nil (autoload (function hs-lint) "hs-lint" nil t)) (condition-case err (progn) ((debug error) (ignore (display-warning (quote use-package) (format "%s %s: %s" "hs-lint" ":init" (error-message-string err)) :error)))) (eval-after-load (quote hs-lint) (function (lambda nil (progn (condition-case err (progn (req-package-handle-loading ... ...) (req-package-loaded ...)) ((debug error) (ignore ...))) t))))))
  req-package-eval-form((use-package hs-lint :init (progn) :config (progn (req-package-handle-loading (quote (hs-lint nil)) (lambda nil (progn))) (req-package-loaded (quote (hs-lint nil)))) :preface (message "Load Path: %s" load-path) (req-package-providers-present-path (quote hs-lint)) :commands hs-lint))
  #[nil "\301�!\207" [EVAL req-package-eval-form] 2]()
  req-package-handle-loading((hs-lint nil) #[nil "\301�!\207" [EVAL req-package-eval-form] 2])
  req-package-eval((hs-lint nil))
  #[(key value) "\302�	\303#\303\232\205��\304�\305	#\210\306�!\207" [key req-package-deps-left gethash 0 puthash -1 req-package-eval] 4]((hs-lint nil) 0)
  maphash(#[(key value) "\302�	\303#\303\232\205��\304�\305	#\210\306�!\207" [key req-package-deps-left gethash 0 puthash -1 req-package-eval] 4] #s(hash-table size 200 test equal rehash-size 1.5 rehash-threshold 0.8 data ((exec-path-from-shell nil) -1 (diminish nil) -1 (bind-key nil) -1 (alect-themes nil) -1 (tramp nil) -1 (recentf nil) -1 (notifications nil) -1 (lorem-ipsum nil) -1 (rainbow-delimiters nil) -1 (whitespace nil) -1 (flycheck nil) -1 (flycheck-color-mode-line nil) -1 (flyspell nil) -1 (auto-highlight-symbol nil) -1 (subword nil) -1 (mmm-mode nil) -1 (company nil) -1 (goto-chg nil) -1 (paredit nil) -1 (paredit-menu (paredit)) -1 (hydra nil) -1 (org nil) -1 (csv-mode (org)) 1 (ispell nil) -1 (rw-hunspell (ispell rw-language-and-country-codes rw-ispell)) 2 (font-utils nil) -1 (unicode-fonts (font-utils)) -1 (ascii-art-to-unicode nil) -1 (paren nil) -1 (saveplace nil) -1 (sql nil) -1 (image-file nil) -1 (delsel nil) -1 (unkillable-scratch nil) -1 (man nil) -1 (woman (faces)) 1 (compile nil) -1 (bury-successful-compilation nil) -1 (ediff nil) -1 (darcsum nil) -1 (helm nil) -1 (graphviz-dot-mode nil) -1 (nix-mode nil) -1 (nixos-options nil) -1 (yaml-mode nil) -1 (zoom-frm nil) -1 (auctex nil) -1 (auctex (reftex)) 1 (latex (auctex flyspell)) 1 (auctex (org)) 1 ...)))
  req-package-finish()
  eval-buffer(#<buffer  *load*> nil "/Users/ivan/.emacs.d/init.el" nil t)  ; Reading at buffer position 2046
  load-with-code-conversion("/Users/ivan/.emacs.d/init.el" "/Users/ivan/.emacs.d/init.el" t t)
  load("/Users/ivan/.emacs.d/init" t t)
  #[0 "�\205\266�	\306=\203��\307�\310Q\202?�	\311=\204��\307�\312Q\202?�\313\307\314\315#\203*�\316\202?�\313\307\314\317#\203>�\320\321\322!D\nB�\323\202?�\316\324�\325�\324\211#\210�\324=\203e�\326\327\330\307�\331Q!\"\325�\324\211#\210�\324=\203d���\210�\203\247�\332�!\333\232\203\247�\334�!\211\335P\336�!\203\201�\211\202\214�\336�!\203\213��\202\214�\314\262��\203\245�\337��\"\203\243�\340\341��#\210\342\343!\210��\266�\f?\205\264�\314�\325\344\324\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "`_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
  command-line()
  normal-top-level()
@ivan-m
Copy link
Author

ivan-m commented Mar 15, 2017

I tried to add in :pin manual, which didn't seem to affect it.

ivan-m added a commit to ivan-m/.emacs.d that referenced this issue Mar 15, 2017
Couldn't seem to use req-package with local packages (align-col,
mmm-pandoc and hs-lint) and how built-ins is used differs from what
the source of req-package actually requires... *shrug*

For more on these issues, see:

emacsorphanage/req-package#40
emacsorphanage/req-package#41
@ivan-m
Copy link
Author

ivan-m commented Mar 15, 2017

Related: jwiegley/use-package#320

Should req-package set :ensure nil when :loader :path is used?

@ivan-m
Copy link
Author

ivan-m commented Mar 15, 2017

Also jwiegley/use-package#190 (and I do have (setq use-package-always-ensure t)).

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

Hi. Regarding always-ensure this should not be used with req-package. req-package has a providers system, which is more feature rich than the one we have in use-package.

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

Investigating your load path related issue.

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

Ok. So, I believe this is how you should use :path loader
2017-03-15-132540_1275x1599_scrot

(req-package test-foo
  :loader :path
  :load-path "/home/edvorg/Documents"
  :config (message "test %s" test-foo-value))

@ivan-m
Copy link
Author

ivan-m commented Mar 15, 2017

Oh, it can't pick it up from the existing load-path? I might stick with autoloads for them then.

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

I think this might be a good way for further improvement ;)

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

Actually I'm looking at this function now @ivan-m . And I think the we support what you want, but there is possibly some bug there

(defun req-package--load-path (package)
  (append (ht-get req-package-paths package nil) load-path))

Here we merge the system load-path with the provided one. Need to check, why it doesn't work for you.

@edvorg edvorg reopened this Mar 15, 2017
@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

Yes, it actually works @ivan-m . You don't even have to specify :loader :path, because req-package will walk through all the providers and check if any one has your package. just make sure that you put provide call in your path located files and setup your load-path before requiring any packages.
2017-03-15-141843_1274x1599_scrot
Could you please confirm if it works for you now?

@edvorg
Copy link
Collaborator

edvorg commented Mar 15, 2017

The bar.el file contents from example above

(defconst bar-var 9)

(provide 'bar)

@ivan-m
Copy link
Author

ivan-m commented Mar 16, 2017

That seems to do it, thanks!

@ivan-m ivan-m closed this as completed Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants