I'm trying to contrib to a project and installed cask and did cask install
and now I have a .cask folder with the deps. Now in emacs how do I evaluate a .require
of one of those deps? Is there a linking step that must be done to point the resolution to the .cask folder?
1 Answer
If the package has its dependencies properly declared,cask install should do all the setup that is necessary. Cask then builds the load-path automatically for you so that (require ...) statements resolve when you invoke cask exec.
Interactively evaluation / development of a package with cask-installed dependencies seems to be a shortcoming of Cask. Four options that come to mind:
- Not rely on the cask dependency management at all during your interactive development and install the dependencies manually via
package-install
or your favorite package management tool. Be sure to run your tests in an isolated environment usingcask exec
though. - Have cask build your load-path at startup and invoke
cask emacs
from inside the target package directory. - Adjust your load path to include the target package's dependencies under
.cask
. - Write a helper to inspect target package dependencies and install them using
package-install
or your favorite package management tool.
cask install
should do all the setup that is necessary. Cask then builds theload-path
automatically for you so that(require ...)
statements resolve when you invokecask exec
. You may need to further illustrate your circumstances, to clarify how things are not as you expect. Are you interactively working on the package within emacs? You might try starting emacs usingcask emacs
from within the package directory to have the desired load-path or reading though github.com/cask/cask/issues/360.cask install
and I see the .cask folder. I open up the test and try to eval the(require 'buttercup)
expression and it just sayscannot open load file: no such file or directory, buttercup
. This is mainly so I can develop with the proper indentation as that is attached to the defs of buttercup. Otherwise the indentation is the standard lisp for function calls which aligns arguments.package-install
(ex:M-x package-install buttercup
). You will probably discover though that buttercup is not written with an interactive use of buttercup in mind. I would recommend usingcask exec
(ex:cask exec buttercup -L .
) to invoke buttercup so you can be confident that dependencies for your tests are properly expressed for cask.