I've built Emacs from source on MacOS (12.4, M1) and it works when I execute the binary from /usr/local/bin/emacs
, but I can't open Emacs from Emacs.app.
For example:
mv ~/emacs/nextstep/Emacs.app /Applications/Emacs.app
I then try to open Emacs.app from my Applications folder, but it silently fails.
Here's how I'm building Emacs from source:
$ ./autogen.sh
$ ./configure --with-native-compilation \
--with-ns \
--disable-silent-rules \
--disable-ns-self-contained
$ make
$ make install
I can open emacs no problem when I use the installed binary in /usr/local/bin
:
$ emacs & # good to go!
Here's what I get when trying to run the Emacs binary within Emacs.app:
$ /Applications/Emacs.app/Contents/MacOS/Emacs
Error using execdir /Applications/Emacs.app/Contents/MacOS/:
emacs: dlopen(/Applications/Emacs.app/Contents/MacOS/../native-lisp/29.0.50-6a95966f/preloaded/window-0d1b8b93-33d07edc.eln, 0x0001): tried: '/Applications/Emacs.app/Contents/MacOS/../native-lisp/29.0.50-6a95966f/preloaded/window-0d1b8b93-33d07edc.eln' (no such file)
edit
I found perhaps a related issue: homebrew-emacs-plus#392 and it's associated fix. Perhaps the problem is related to the emacs/native-lisp
directory not being present in the Emacs.app package.
I tried to resolve by simply moving the native-lisp/
directory into my Emacs.app package:
$ mv ~/emacs/nextstep/Emacs.app /Applications/Emacs.app
$ mv ~/emacs/native-lisp/ /Applications/Emacs.app/Contents/
This appeared to fix the issue, in that I was able to use Emacs.app and launch the program. However, after launching the program this way there are a suite of warnings that show up related to native compilation:
libgccjit.so: error: error invoking gcc driver
I think simply moving the native-lisp/ folder into the app package was probably not sufficient.
open /Applications/Emacs.app
; it may print an error that could help figure this out.open ...
, but I did try/Applications/Emacs.app/Contents/MacOS/Emacs
to run the binary included within the App folder and got "Error using execdir". I added the full output to the original post.