homebrew-emacs-plus icon indicating copy to clipboard operation
homebrew-emacs-plus copied to clipboard

[General]: On Sequoia 15.1 (Intel) Emacs.app does not run and has permissions errors

Open matthemsteger opened this issue 1 year ago • 18 comments


Working workaround: https://github.com/d12frosted/homebrew-emacs-plus/issues/742#issuecomment-2449092291


Issue description

I can run emacs from the terminal emacs and get the GUI.

When I click it through Launchpad I get: The application “Dock” does not have permission to open “(null).” and when I double click on Finder /Applications/Emacs.app, I get The application “Finder” does not have permission to open “Emacs.”

I use osascript -e 'tell application "Finder" to make alias file to posix file "/usr/local/opt/emacs-plus@29/Emacs.app" at POSIX file "/Applications" with properties {name:"Emacs.app"}' and that has worked up until now.

I recently reinstalled emacs (many times) due to the libgccjit issue in homebrew. Emacs seems to work fine, its just Emacs.app that doesnt work. While troubleshooting that issue (which ended up being an issue with libgccjit on Sequoia for Intel), I uninstalled gcc, libgccjit and emacs.

I tried:

sudo chmod -R u+rwX /usr/local/opt/emacs-plus@29/Emacs.app 

That did not change anything.

xattr -rd com.apple.quarantine /usr/local/opt/emacs-plus@29/Emacs.app  

That did not change anything.

I dont see anything in the security and permissions, and nothing I am doing is any different from the many other times I have upgraded.

The output of open -a /Applications/Emacs.app is:

_LSOpenURLsWithCompletionHandler() failed for the application /Applications/Emacs.app with error -54.
spctl --assess -vvvv /Applications/Emacs.app
/Applications/Emacs.app: accepted
source=no usable signature
override=security disabled

Any troubleshooting tips here? Has anyone seen this before?

My install: brew install emacs-plus@29 --with-native-comp --with-mailutils --with-poll --with-savchenkovaleriy-big-sur-icon

matthemsteger avatar Oct 29 '24 20:10 matthemsteger

I've run into the same issues on a 2020 MacBook Pro (Intel). I've tried emacs-plus@30, but ran into the same permission issues.

FWIW, you can still open emacs if you invoke from the command line:

/usr/local/Cellar/emacs-plus@29/29.4/Emacs.app/Contents/MacOS/Emacs

Additionally, Finder has no problems opening Emacs.app from the version installed via emacsforosx.com.

sww avatar Oct 29 '24 21:10 sww

Same issue here after upgrading to macOS 15.1, 2019 Macbook Pro (Intel), but it works fine on Mac mini with Apple Silicon chips

lululau avatar Oct 30 '24 02:10 lululau

Same issue on MacOS 15.1 Intel Mac

vtomilin avatar Oct 30 '24 13:10 vtomilin

I saw it too: https://github.com/d12frosted/homebrew-emacs-plus/discussions/741

jchonig avatar Oct 30 '24 18:10 jchonig

I had the same issue after upgrading to 15.1 on an Intel Mac along with an Xcode command line tools update. I was able to work for a few days by running it in daemon mode but today I finally found a fix to let the standalone app launch from the GUI:

sudo codesign --force --deep --sign - /usr/local/opt/emacs-plus@29/Emacs.app

After doing codesign I was able to launch Emacs normally from Finder, the Dock, etc.

jester7 avatar Oct 31 '24 06:10 jester7

just to explain a few deleted comments @corrosive4354 was advertising some irrelevant site and spamming

d12frosted avatar Oct 31 '24 06:10 d12frosted

@jester7 thanks for sharing a workaround; let me pin it

d12frosted avatar Oct 31 '24 06:10 d12frosted

I just wanted to report back that @jester7 workaround works perfectly. Thanks!

matthemsteger avatar Oct 31 '24 16:10 matthemsteger

The below worked for me, note --strip-disallowed-xattrs:

codesign --force --deep --sign - -v --strip-disallowed-xattrs /usr/local/Cellar/emacs-plus@29/29.4/Emacs.app

vtomilin avatar Nov 09 '24 13:11 vtomilin

I had the same issue after upgrading to 15.1 on an Intel Mac along with an Xcode command line tools update. I was able to work for a few days by running it in daemon mode but today I finally found a fix to let the standalone app launch from the GUI:

sudo codesign --force --deep --sign - /usr/local/opt/emacs-plus@29/Emacs.app

After doing codesign I was able to launch Emacs normally from Finder, the Dock, etc.

I have installed emacs@30, doing codesign resulted this sudo codesign --force --deep --sign - /usr/local/opt/emacs-plus@30/Emacs.app

output: /usr/local/opt/emacs-plus@30/Emacs.app: resource fork, Finder information, or similar detritus not allowed

ankitsharma07 avatar Jan 04 '25 18:01 ankitsharma07

I had the same issue after upgrading to 15.1 on an Intel Mac along with an Xcode command line tools update. I was able to work for a few days by running it in daemon mode but today I finally found a fix to let the standalone app launch from the GUI: sudo codesign --force --deep --sign - /usr/local/opt/emacs-plus@29/Emacs.app After doing codesign I was able to launch Emacs normally from Finder, the Dock, etc.

I have installed emacs@30, doing codesign resulted this sudo codesign --force --deep --sign - /usr/local/opt/emacs-plus@30/Emacs.app

output: /usr/local/opt/emacs-plus@30/Emacs.app: resource fork, Finder information, or similar detritus not allowed

Removing extra attributes and then code signing solved this xattr -c /usr/local/Cellar/emacs-plus@30/30.0.93/Emacs.app/

ankitsharma07 avatar Jan 04 '25 19:01 ankitsharma07

I'm afraid the the codesign solution above does not work for me with the release version of 30.1:

 % sudo codesign --force --deep --sign - /usr/local/Cellar/emacs-plus@30/30.1/Emacs.app 
The following argument was not expected: --deep
Run with --help for more information.

rhstanton avatar Feb 24 '25 17:02 rhstanton

@rhstanton very far from laptop, but looking at the error, it's not related to the new Emacs version but rather to codedign tool/macos version

d12frosted avatar Feb 24 '25 17:02 d12frosted

I'm sure it is! But somehow I managed to get 30.0.93 working, so I must have found a solution some time. I wish I'd written it down... Or maybe the options to codesign have changed since then, or I've upgraded my OS.

rhstanton avatar Feb 24 '25 17:02 rhstanton

In case this is helpful, I tried it without --deep and got the following error instead:

% sudo codesign --force --sign /usr/local/Cellar/emacs-plus@30/30.1/Emacs.app 
libc++abi: terminating due to uncaught exception of type std::runtime_error: Only ad-hoc identities supported, requested: '/usr/local/Cellar/emacs-plus@30/30.1/Emacs.app'
zsh: abort      sudo codesign --force --sign /usr/local/Cellar/emacs-plus@30/30.1/Emacs.app

rhstanton avatar Feb 24 '25 17:02 rhstanton

I ran the exact command @rhstanton posted and it worked for me; I'm on a 2020 Intel Macbook Pro, on macOS 15.3.1. However, it looks like the --deep option has been deprecated since macOS 13 (as noted in codesign's man page). I'm not quite sure what the workaround for that is, though.

I don't know if it matters, but here's the version of xcode-select I'm using:

$ xcode-select --version
xcode-select version 2409.

sww avatar Feb 24 '25 17:02 sww

My machine reports the same version of xcode-select

rhstanton avatar Feb 24 '25 17:02 rhstanton

The following works for me (thanks, ChatGPT!):

sudo find /usr/local/Cellar/emacs-plus@30/30.1/Emacs.app -type f -perm +111 -exec sudo codesign --force --sign - {} \;

rhstanton avatar Feb 24 '25 18:02 rhstanton

None of the above have worked for me; xcode-select --version == 2410, Sequoia 15.6

stradicat avatar Aug 20 '25 01:08 stradicat

Sequoia 15.6.1, xcode-select --version of 2410, I had no trouble.

Details:

    codesign --force --deep --sign - Emacs.app

The difficulty for me was locating the application, which I did by searching my install directory for Emacs.app. It was in:

     cd var/macports/software/emacs-app/emacs-app-30.2_1+nativecomp+rsvg+treesitter.darwin_24.x86_64/Applications/MacPorts/

Note: my MacPorts is installed in /opt/local. If your install location is different you will need to start there. Also, the directory I wrote includes the full name of the package, so it will change slightly with later versions.

maueroats avatar Sep 15 '25 02:09 maueroats