cask / cask

Project management tool for Emacs
http://cask.readthedocs.io
GNU General Public License v3.0
1.27k stars 147 forks source link

exec-path broken? #184

Closed swsnr closed 10 years ago

swsnr commented 10 years ago

In current 0.6 wip:

$ cask exec-path
/Users/swiesner/.cask/bin:/Users/swiesner/.cabal/bin:/Users/swiesner/.opam/system/bin:/Users/swiesner/.gem/ruby/2.0.0/bin:/Users/swiesner/Library/Python/2.7/bin:/Users/swiesner/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/local/Cellar/emacs/HEAD/libexec/emacs/24.3.50/x86_64-apple-darwin13.0.0

Consequently, cask exec can't run commands anymore.

Did you change anything here?

rejeep commented 10 years ago

Yes, this is why I created this bug: https://github.com/cask/epl/issues/18

And reported it to the Emacs devs here: http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-02/msg01244.html

swsnr commented 10 years ago

@rejeep Why is epl-available-packages related to the exec-path of a Cask environment? Presumably the exec-path is computed from the installed packages, as in epl-installed-packages, isn't it?

rejeep commented 10 years ago

It's not possible if the package is a link.

rejeep commented 10 years ago

I think the load-path/exec-path would be fixed with something like this:

(or
 (epl-find-installed-package package)
 (car (epl-find-available-packages package)))

I tried it and the result was as expected, but the tests did not pass, so I never kept it.

This is pretty much the only thing that is blocking v0.6 now.

swsnr commented 10 years ago

@rejeep

It's not possible if the package is a link.

So links don't end up in package-alist after package-initialize?

rejeep commented 10 years ago

So links don't end up in package-alist after package-initialize?

Only if they have a -pkg.el file.

swsnr commented 10 years ago

@rejeep They must have a -pkg.el file, then, and cask link should try to enforce that.

If they don't, and thus don't end up in package-alist, package.el won't consider them when resolving requirements in package-install. As such, package-install might end up installing a linked package again from a package archive.

rejeep commented 10 years ago

Sounds reasonable, but what if it's a Cask project? Should we generate the -pkg.el file then?

swsnr commented 10 years ago

@rejeep Why not?

rejeep commented 10 years ago

Sounds good. I'll fix it as soon as I can.

rejeep commented 10 years ago

@lunaryorn Can you verify that this is fixed please!?

swsnr commented 10 years ago

@rejeep Latest 0.6 wip now gives me:

$ cask update --debug --verbose
Contacting host: elpa.gnu.org:80
Saving file /Users/swiesner/dotfiles/emacs/.cask/.cask/24.3.50.1/elpa/archives/gnu/archive-contents...
Wrote /Users/swiesner/dotfiles/emacs/.cask/.cask/24.3.50.1/elpa/archives/gnu/archive-contents
Contacting host: melpa.milkbox.net:80
Saving file /Users/swiesner/dotfiles/emacs/.cask/.cask/24.3.50.1/elpa/archives/melpa/archive-contents...
Wrote /Users/swiesner/dotfiles/emacs/.cask/.cask/24.3.50.1/elpa/archives/melpa/archive-contents
Debugger entered--Lisp error: (error "cask-dependency-name accessing a non-cask-dependency")
  signal(error ("cask-dependency-name accessing a non-cask-dependency"))
  error("%s accessing a non-%s" cask-dependency-name cask-dependency)
  (or (and (vectorp (nth 0 data)) (>= (length (nth 0 data)) 8) (memq (aref (nth 0 data) 0) cl-struct-cask-dependency-tags)) (error "%s accessing a non-%s" (quote cask-dependency-name) (quote cask-dependency)))
  (progn (or (and (vectorp (nth 0 data)) (>= (length (nth 0 data)) 8) (memq (aref (nth 0 data) 0) cl-struct-cask-dependency-tags)) (error "%s accessing a non-%s" (quote cask-dependency-name) (quote cask-dependency))) (aref (nth 0 data) 1))
  (let* ((data (cdr err)) (dependency (progn (or (and (vectorp (nth 0 data)) (>= (length ...) 8) (memq (aref ... 0) cl-struct-cask-dependency-tags)) (error "%s accessing a non-%s" (quote cask-dependency-name) (quote cask-dependency))) (aref (nth 0 data) 1))) (message (error-message-string (nth 1 data))) (output (nth 2 data))) (if dependency (error "Dependency %s failed to install: %s\nOutput:\n%s" dependency message output) (error "Package installation failed: %s\nOutput:\n%s" message output)))
  (condition-case err (progn (let ((upgrades (cask-update (cask-cli--bundle)))) (if upgrades (progn (princ "Updated packages:\n") (-each upgrades (quote cask-cli--print-upgrade)))))) (cask-missing-dependencies (let ((missing-dependencies (cdr err))) (error "Some dependencies were not available: %s" (s-join ", " (-map (function symbol-name) (-map (function cask-dependency-name) missing-dependencies)))))) (cask-failed-initialization (let* ((data (cdr err)) (message (error-message-string (nth 0 data))) (output (nth 1 data))) (error "Package initialization failed: %s\nOutput:\n%s" message output))) (cask-failed-installation (let* ((data (cdr err)) (dependency (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (aref (nth 0 data) 1))) (message (error-message-string (nth 1 data))) (output (nth 2 data))) (if dependency (error "Dependency %s failed to install: %s\nOutput:\n%s" dependency message output) (error "Package installation failed: %s\nOutput:\n%s" message output)))))
  cask-cli/update()
  commander--handle-command(("update"))
  commander-parse(("update" "--verbose" "--debug"))
  (if commander-parsing-done nil (commander-parse (or commander-args (cdr command-line-args-left))))
  (progn (setq commander-default-config nil) (setq commander-options nil) (setq commander-commands nil) (setq commander-name nil) (setq commander-description nil) (setq commander-default-command nil) (setq commander-no-command nil) (setq commander-parsing-done nil) (-each (quote ((name "cask") (description "Emacs dependency management made easy") (default "install") (command "pkg-file" cask-cli/pkg-file) (command "install" cask-cli/install) (command "update" cask-cli/update) (command "upgrade" cask-cli/upgrade-cask) (command "upgrade-cask" cask-cli/upgrade-cask) (command "exec [*]" cask-cli/exec) (command "init" cask-cli/init) (command "version" cask-cli/version) (command "list" cask-cli/list) (command "info" cask-cli/info) (command "help [command]" cask-cli/help) (command "load-path" cask-cli/load-path) (command "exec-path" cask-cli/exec-path) (command "path" cask-cli/exec-path) (command "package-directory" cask-cli/package-directory) (command "outdated" cask-cli/outdated) (command "files" cask-cli/files) (command "build" cask-cli/build) (command "clean-elc" cask-cli/clean-elc) (command "link [*]" cask-cli/link) (command "package [target-dir]" cask-cli/package) (option "--version" cask-cli/cask-version) (option "-h [command], --help [command]" cask-cli/help) (option "--dev" cask-cli/dev) (option "--debug" cask-cli/debug) (option "--path <path>" cask-cli/set-path) (option "--verbose" cask-cli/verbose))) (function (lambda (form) (cond ((eql (car form) (quote option)) (progn (let* ... ...))) ((eql (car form) (quote command)) (progn (let* ... ...))) ((eql (car form) (quote parse)) (progn (let* ... ... ...))) ((eql (car form) (quote name)) (progn (let* ... ...))) ((eql (car form) (quote description)) (progn (let* ... ...))) ((eql (car form) (quote config)) (progn (let* ... ...))) ((eql (car form) (quote default)) (progn (let* ... ...))) (t (error "Unknown directive: %S" form)))))) (if commander-parsing-done nil (commander-parse (or commander-args (cdr command-line-args-left)))))
  eval-buffer(#<buffer  *load*> nil "/Users/swiesner/dotfiles/emacs/.cask/cask-cli.el" nil t)  ; Reading at buffer position 11956
  load-with-code-conversion("/Users/swiesner/dotfiles/emacs/.cask/cask-cli.el" "/Users/swiesner/dotfiles/emacs/.cask/cask-cli.el" nil t)
  load("/Users/swiesner/dotfiles/emacs/.cask/cask-cli.el" nil t t)
  command-line-1(("-scriptload" "/Users/swiesner/dotfiles/emacs/.cask/cask-cli.el" "--" "update" "--verbose" "--debug"))
  command-line()
  normal-top-level()

Sorry, I don't have time to debug this right now. Got a major exam tomorrow morning.

rejeep commented 10 years ago

@lunaryorn There are still some issues with Snapshot. Emacs 23 and 24 stable seems to work now.

The exec-path issue should work for you now, right?

swsnr commented 10 years ago

@rejeep Yep, it does. Sorry, forgot to say that. Didn't test with links, though.

rejeep commented 10 years ago

You can try the update again, I've pushed a fix, I hope.

I've also found another issue in Snapshot, which seems like a bug in package.el. I've reported it. Seems like they've introduced a few bugs in Snapshot... It should however work in most cases, but the tests fail.

rejeep commented 10 years ago

@lunaryorn Is this fixed? Can I close it?

swsnr commented 10 years ago

@rejeep Yep, works now.