Subject: bug#64544: Issue with usage of (server-start) on MacOS

From: [email-masked]
Date: Sun, 9 Jul 2023 12:20:20 -0500

I have not tested on other systems, but this is my personal laptop, Intel x86-64, MacOS Ventura 13.4.1.

I built Emacs last night at commit 9c282fa. Previously, this was an issue on my build on 4/27/23.

Notably, this is different than the other socket error mentioned at: https://www.emacswiki.org/emacs/EmacsClient#h5o-28, and the solution doesn’t apply.

Steps to reproduce:
$ ./configure —with-native-compilation=aot —without-pop

Placed bundle in ‘/Applications', with aliases (.zshrc):
alias emacsclient='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient'
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs’

Note that: 
$ emacs —daemon
$ emacsclient -c -a ‘'

does work and the server can be killed off with:

$ emacsclient -e ‘(kill-emacs)’

The issue:
.emacs.d with a single file inside (init.el) with:
(server-start)

$ emacsclient -c -a ‘'
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient: can't find socket; have you started the server?
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient: To start the server in Emacs, type "M-x server-start".
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient: error starting emacs daemon
Error: Could not start the Emacs daemon

Running:
$ emacs
‘M-x server-start <RET>’ followed by ‘C-x C-c’ 
$ emacsclient -a ‘’ -c

results in the same error, but running:

$ emacs
‘M-x server-start <RET>’ (not followed by ‘C-x C-c’)
$ emacsclient -c -a ‘'
Waiting for Emacs…

attaches successfully. This was all done under the same environment, with the same HOME.