syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

Fresh Spacemacs Emacs-plus install package refresh: GPG "Doing vfork Bad CPU type in executable" #16285

Closed noelweichbrodt closed 4 months ago

noelweichbrodt commented 4 months ago

Emacs Debugger:

Debugger entered--Lisp error: (file-error "Doing vfork" "Bad CPU type in executable")
  call-process("/usr/local/bin/gpg" nil (t nil) nil "--with-colons" "--list-config")
  epg-config--make-gpg-configuration("/usr/local/bin/gpg")
  epg-find-configuration(OpenPGP)
  package-check-signature()
  package-refresh-contents()
…

$PATH:

/opt/homebrew/bin/gpg:/opt/homebrew/opt/node@20/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands

I'm assuming this is an Mac Intel -> Apple Silicon upgrade problem.

I've blown away my emacs.d, as well as my .spacemacs, so both are fresh. I do have gpg installed through brew with the correct architecture (arm64), so:

$ which gpg
/opt/homebrew/bin/gpg

But obviously that isn't what emacs is using. The /usr/local/bin in $PATH is coming from MacOS default /etc/paths, so I assume that's necessary? Unclear how to proceed—haven't found anyone else with this emacs/GPG issue!

noelweichbrodt commented 4 months ago

From #14803, I found .spacemacs.env. Editing that to remove /usr/local/bin from the Spacemacs env resulted in using the correct gpg, resolving my issue.