Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tzz opened this issue Oct 2, 2024 · 5 comments
Open

Comments

@tzz
Copy link

tzz commented Oct 2, 2024

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
Copy link
Author

tzz commented Oct 4, 2024

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.

@harisonkhlil
Copy link

I have made the same error after upgrade to macOS 15

@rbugajewski
Copy link

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).

@harisonkhlil
Copy link

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>.

@stottm
Copy link

stottm commented Oct 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants