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

EMACS="emacs-24.3" cask does not work #260

Closed
abo-abo opened this issue Nov 22, 2014 · 16 comments
Closed

EMACS="emacs-24.3" cask does not work #260

abo-abo opened this issue Nov 22, 2014 · 16 comments

Comments

@abo-abo
Copy link

abo-abo commented Nov 22, 2014

Hi,

I'd like to use Cask to run tests for different Emacs versions.
I'm using currently 25.0.50.1, but I want to run the tests also for 24.3.

After calling cask, all dependencies are properly installed in
./.cask/25.0.50.1 and test running works.

Now I want to install the dependencies for 24.3:

EMACS="emacs-24.3" cask

I would expect it to create ./.cask/24.3 and install the
dependencies there. However nothing happens.

@swsnr
Copy link
Contributor

swsnr commented Nov 22, 2014

Do you actually have an emacs-24.3 executable on your system?

@abo-abo
Copy link
Author

abo-abo commented Nov 22, 2014

Yes, of course. That's the reason I'm trying to learn Cask: the byte
code isn't compatible between emacs-24.3 and my current emacs
(25.0.50.1).

@swsnr
Copy link
Contributor

swsnr commented Nov 22, 2014

What is your system then? I've never seen any that actually adds executables for minor versions of Emacs. Even Debian just adds emacs-24 to /usr/bin/.

@abo-abo
Copy link
Author

abo-abo commented Nov 22, 2014

I'm on Ubuntu 13.10. The versions of Emacs that I've got are in
/usr/local/bin/emacs and /usr/local/bin/emacs-24.3. Both
installed from source.

@abo-abo
Copy link
Author

abo-abo commented Nov 23, 2014

Solved by changing cask python script:

emacs = ENVB.get(b'EMACS') if b'INSIDE_EMACS' not in ENVB else None

to

emacs = ENVB.get(b'EMACS')

Can you explain why the check for INSIDE_EMACS is necessary? It's probably best to remove it.

@swsnr
Copy link
Contributor

swsnr commented Nov 23, 2014

@abo-abo It's necessary, because some Emacs modes (e.g. Shell Mode, Compile Mode, etc.) set $EMACS automatically to some strange values (e.g. "t"). We use $INSIDE_EMACS to guard against these invalid $EMACS values.

Why is $INSIDE_EMACS set for you?

@abo-abo
Copy link
Author

abo-abo commented Nov 23, 2014

Why is $INSIDE_EMACS set for you?

I'm using ansi-term from inside Emacs.

@phillord
Copy link
Collaborator

I've just hit a related problem. Running cask from a command line with "emacs-24.5" works, but running it from Make fails (it just uses the default emacs, which is 24.3 on my ubuntu which is incompatible with my package anyway). The same is true running M-x compile (I've found that EMACS=t strangeness also). Or inside M-x shell.

I am wondering whether there needs to be a way of running Emacs either by name (emacs-24.5) or full path which is not dependent on an env var? Why not

cask --emacs=emacs-24.5 exec ert-runner

@swsnr
Copy link
Contributor

swsnr commented May 16, 2015

@phillord You need to export EMACS to Cask commands in a Makefile, either with export EMACS at top-level, or with EMACS=$(EMACS) cask … inside rules.

But an option like this would be a good idea, for sure.

@phillord
Copy link
Collaborator

I tried EMACS=$(EMACS) cask in my makefile, with
EMACS?= emacs-24.5. But, I was running this inside M-x compile, so I ended up running EMACS=t cask.

All pretty frustrating. In the end I tried uninstalling my system installed emacs (24.3) but now cask is complaining that it can't find emacs.

I've had related problems with running emacs from git -- I get a different Emacs at commit, from that at the command line.

Anyway, I will leave it there as we seem to be in agreement! Fantastic tool.

@abo-abo
Copy link
Author

abo-abo commented May 17, 2015

@phillord This works for me:

emacs ?= emacs

cask:
    $(shell EMACS=$(emacs) $(CASK) --verbose --debug)

@phillord
Copy link
Collaborator

Hmmm, not sure how "shell" is supposed to help here. Still I tried.

From the command line I get:

[phillord@hydron:...rd/emacs/lentic]$ make just-test
.........................  Ran 25 tests in 0.537 seconds
make: .........................: Command not found
make: *** [just-test] Error 127

From M-x compile I get:

-*- mode: compilation; default-directory: "~/emacs/lentic/" -*-
Compilation started at Sun May 17 13:28:03

make just-test
cask load-path: error: Emacs does not exist at emacs.  Did you install Emacs?
cask path: error: Emacs does not exist at emacs.  Did you install Emacs?
cask exec: error: [Errno 2] No such file or directory
make: `just-test' is up to date.

Compilation finished at Sun May 17 13:28:03

I am not sure I understand the Command not found from the command line. But, same make file, same command, different result inside Emacs and outside.

The environment is just not very stable as far as I can see!

@abo-abo
Copy link
Author

abo-abo commented May 17, 2015

@phillord It should work in emacs-snapshot, that code was updated recently.

See my Makefile for a different approach that uses cask only to install packages, not for cask exec.

@phillord
Copy link
Collaborator

Will try snapshot, but unfortunately I wanted to test in a release version! I may try your lispy makefile, though, as a workaround. Thanks!

@rejeep
Copy link
Member

rejeep commented May 19, 2015

I agree that adding a --emacs or --emacs-bin, etc... would be a good idea. If any of you guys are interested in making a pull request, I would be happy to merge it!

@phillord
Copy link
Collaborator

Sent my first version of this in.

#295

Let me know if you want anything adding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants