d12frosted / homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
MIT License
2.35k stars 181 forks source link

[General]: libgccjit error "no such file or directory: 'HOST=mymacbook'" #736

Open tzz opened 1 week ago

tzz commented 1 week ago

Issue description

I recently upgraded to Mac OS 14.7 on this machine (actual hostname replaced with mymacbook below).

After the upgrade I started to get the errors at the end. I've ensured that gcc, libgccjit, and emacs-plus have been uninstalled and installed again.

I've verified that (getenv "PATH") is correct so I don't think it's #720 (and I'm on Sonoma anyway).

❯ grep -A 1 PATH $(brew --cellar emacs-plus@30)/30.0.91/Emacs.app/Contents/Info.plist
        <key>PATH</key>
        <string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/local/bin:/opt/local/sbin:/Developer/usr/bin:/usr/local/go/bin:/Users/tzlatanov/golang/bin:/Users/tzlatanov/bin</string>

and in Emacs-plus

(getenv "PATH")
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/local/bin:/opt/local/sbin:/Developer/usr/bin:/usr/local/go/bin:/Users/tzlatanov/golang/bin:/Users/tzlatanov/bin

The only way I've been able to start Emacs-plus has been by setting this in early-init.el:

(setq comp-dry-run t)

So this seems like perhaps an error in the way comp.el does the compilation invocation but I haven't been able to find the issue. I hope you'll have some clue. Thank you for your kind time and help.

Sample compilation errors during startup and after:

clang: error: no such file or directory: 'HOST=mymacbook'
clang: error: no input files
libgccjit.so: error: error invoking gcc driver
Internal native compiler error: \"failed to compile\", \"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\", \"error invoking gcc driver\"

Error: native-ice (\"failed to compile\" \"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\" \"error invoking gcc driver\")
  comp--compile-ctxt-to-file0(\"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\")
  comp--compile-ctxt-to-file(\"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\")
  comp--final1()
  load-with-code-conversion(\"/private/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-POyYUH.el\" \"/private/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-POyYUH.el\" nil t)
  command-line-1((\"-l\" \"/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-POyYUH.el\"))
  command-line()
  normal-top-level()
")
Waiting for process to die...done
Error running timer ‘aggressive-indent--indent-if-changed’: (native-compiler-error (lambda (arg26 &rest arg27) (let ((f #'message)) (apply f arg26 arg27))) "Compiling /Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln...
clang: error: no such file or directory: 'HOST=mymacbook'
clang: error: no input files
libgccjit.so: error: error invoking gcc driver
Internal native compiler error: \"failed to compile\", \"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\", \"error invoking gcc driver\"

Error: native-ice (\"failed to compile\" \"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\" \"error invoking gcc driver\")
  comp--compile-ctxt-to-file0(\"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\")
  comp--compile-ctxt-to-file(\"/Users/tzlatanov/.emacs.d/eln-cache/30.0.91-f2803088/subr--trampoline-6d657373616765_message_0.eln\")
  comp--final1()
  load-with-code-conversion(\"/private/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-EL8oaX.el\" \"/private/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-EL8oaX.el\" nil t)
  command-line-1((\"-l\" \"/var/folders/n5/hh437wl93_gby5_k0s33cc_00000gq/T/emacs-int-comp-subr--trampoline-6d657373616765_message_0-EL8oaX.el\"))
  command-line()
  normal-top-level()
")
Waiting for process to die...done
tzz commented 1 week ago

This looks like an upstream issue, the MacPorts build of emacs-app-devel has the same problem on my machine. I have not been able to find if it's an Emacs or libgccjit issue.