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

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

Open tzz opened this issue 1 year ago • 4 comments

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 avatar Oct 02 '24 23:10 tzz

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.

tzz avatar Oct 04 '24 17:10 tzz

I have made the same error after upgrade to macOS 15

harisonkhlil avatar Oct 13 '24 12:10 harisonkhlil

I had also the same issue after upgrading to Sequoia, but in my case it is related to #720, and the messages go away when I start Emacs from Terminal.app (or via the integrated scripts that also launch Emacs from the shell, but leave another window open).

rbugajewski avatar Oct 14 '24 09:10 rbugajewski

No, I can't build with 'native-comp'

brew install emacs-plus@30 --with-xwidgets --with-native-comp --with-modern-black-gnu-head-icon
checking for lcms2... yes
checking for library containing inflateEnd... -lz
checking for dladdr... yes
checking for dlfunc... no
checking for gcc_jit_context_acquire in -lgccjit... yes
checking for libgccjit.h... yes
configure: error: The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.
The test program can be found here:
<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
You can try compiling it yourself to investigate the issues.
Please report the issue to your distribution if libgccjit was installed
through that.
You can find the instructions on how to compile and install libgccjit from
source on this site:
<https://gcc.gnu.org/wiki/JIT>.

harisonkhlil avatar Oct 16 '24 15:10 harisonkhlil

If you add the exec-path-from-shell package it will fix it for now. Eventually the bug will be fixed upstream and you can remove exec-path-from-shell. I can confirm it's still a problem on macOS Sequoia 15.1 official release version.

stottm avatar Oct 29 '24 16:10 stottm

I have the same error after upgrading to Sequoia 15.1.

exec-path-from-shell doesn't fix the issue. Only (setq comp-dry-run t) shuts up the constant errors.

tzz avatar Nov 19 '24 23:11 tzz

It's really frustrating that I can't trace what the heck is spewing these errors. It feels like somewhere the invocation of clang went from a shell exec to a direct exec.

clang: error: no such file or directory: 'HOST=mymacbook'

But I don't know where to report this or how to bisect it.

tzz avatar Nov 19 '24 23:11 tzz

I have "resolved" this for myself, no more errors, with this against the latest Emacs, in early-init.el:

(setq
 native-comp-enable-subr-trampolines nil
 native-comp-jit-compilation nil
 )

I hope this helps others. I think it's still a valid issue but feel free to close it if it doesn't concern anyone else.

tzz avatar Jan 26 '25 17:01 tzz

Holy ... @tzz ! I've spent more time on this issue - trying all the sym-linking, reinstalling, &c, to no avail, and your simple lines seem to work! Thank you.

  • Sequoia 15.2 (M1)
  • emacs-plus@31

cena avatar Jan 28 '25 14:01 cena

Seems unrelated to Emacs+.

d12frosted avatar Feb 14 '25 10:02 d12frosted