jimeh / emacs-builds

Self-contained Emacs.app builds for macOS, with native-compilation support.
https://github.com/jimeh/emacs-builds/releases
322 stars 7 forks source link

Incorrect path to own Emacs.app in the built output!? #9

Closed plajjan closed 3 years ago

plajjan commented 3 years ago

I've just installed the builds you've published here, tried the latest (2021-05-17) and last known good according to #7 - 2021-05-10 but both fail for me in a similar way when run from a terminal:

kll@mbp13:~$ emacs
Warning: arch-dependent data dir '/Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/Emacs.app/Contents/MacOS/libexec/': No such file or directory
Warning: arch-independent data dir '/Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/Emacs.app/Contents/Resources/etc/': No such file or directory
Warning: Lisp directory '/Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/Emacs.app/Contents/Resources/lisp': No such file or directory
Error: /Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/Emacs.app/Contents/Resources/etc/charsets: No such file or directory
Emacs will not function correctly without the character map files.
Please check your installation!

IIRC /Users/runner is used by GitHub Actions, so is it possible that some path used during the build seeps over into the final build. I naturally do not have this directory. If I create it, like so:

mkdir -p /Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/
sudo ln -s /Applications/Emacs.app /Users/runner/work/emacs-builds/emacs-builds/sources/emacs-mirror-emacs-28bed06/nextstep/

then emacs works just fine!

Is this something wrong on my machine? I only have a single Mac so difficult to test...

jimeh commented 3 years ago

Are you by chance symlinking /Applications/Emacs.app/Contents/MacOS/Emacs to /usr/local/bin/emacs or something similar?

This basically looks like the emacs executable is executed outside of the Emacs.app bundle so it doesn't know where to find stuff, leading it to try falling back on absolute paths used at build-time, rather than relative paths within the Emacs.app.

If that is the case, would you mind trying the alias-based method from the readme of my build script? https://github.com/jimeh/build-emacs-for-macos#use-self-contained-emacsapp-as-emacs-cli-tool

Apologies for the readme here missing CLI setup info, I'll try to find time and add it shortly. I've also got plans for a better solution than the shell alias coming, details are in this issue: https://github.com/jimeh/build-emacs-for-macos/issues/41

jimeh commented 3 years ago

@plajjan Recent builds offers a simpler CLI solution too, details are in the readme for the build script here: https://github.com/jimeh/build-emacs-for-macos#use-emacsapp-as-emacs-cli-tool

And I'll update the readme here for emacs-builds shortly.

For now I'll close this issue, as I haven't heard back from you for some time, and I'm fairly confident that your issue can be solved with the CLI setup instructions I've linked to.

Please feel free to comment/re-open the issue if you're still having problems :)