-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
brew install emacs-plus@29 --with-native-comp is failing #455
Comments
% brew config |
For me the
|
Same issue here. I tried reinstalling libgccjit and removing the contents of
|
I had no
|
I tried your suggestion but ran into the same error, libgccjit is listed as a dependency of emacs-plus@29 so it got reinstalled. |
Yeah, it should be installed. I just thought that maybe something is not linked properly 🤷 Cause for me |
Works with Could you try the following?
|
|
Just wanted to add, I really appreciate you looking at this and the work you've put into sharing this brew recipe. You're awesome! |
it seems to me that the compiler does not look for lgccjit under /usr/local/lib/gcc/11 when compiling emacs... I don't know what the defaults are and if anything has changed here with the upgrade of gcc and libgccjit. In any case, it no longer works with me since then. I tried to compile the hello world example from the libgccjit docs and it only compiles when specifying the libpath via |
@gwbrck interesting 🤔 Here is the code responsible for making sure required homebrew-emacs-plus/Formula/emacs-plus@29.rb Lines 102 to 115 in edb5b25
I guess two things may go "wrong":
I would appreciate if someone debugs it. One of the ways is to clone this repo, add some print statements and run p "gcc_ver = #{gcc_ver}"
p "HOMEBREW_PREFIX = #{HOMEBREW_PREFIX}"
p "gcc_lib = #{gcc_lib}" And I will also try to reproduce it on a different machine. |
mhhh maybe my suspicion was wrong. This looks alright: But still: "checking for gcc_jit_context_acquire in -lgccjit... no |
Thanks for checking. I checked provided build logs again and noticed these lines related to
Turns out, Emacs has a special
I suspect that this fails here. So can someone with failing build share the output of the following command?
I suspect that either |
ok I played arround a little. When I revert this commit edb5b25 everything works again. EDIT Sorry just saw your answer... |
@gwbrck 🤔 That commit has introduced environment change from superenv to standard ( |
the output you asked for:
|
@gwbrck thanks! Indeed, it lacks
|
Found an interesting thing in the if Hardware::CPU.arm?
# Branch from the Darwin maintainer of GCC with Apple Silicon support,
# located at https://github.com/iains/gcc-darwin-arm64 and
# backported with his help to gcc-11 branch. Too big for a patch.
url "https://github.com/fxcoudert/gcc/archive/refs/tags/gcc-11.2.0-arm-20211124.tar.gz"
sha256 "d7f8af7a0d9159db2ee3c59ffb335025a3d42547784bee321d58f2b4712ca5fd"
version "11.3.0"
else
url "https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-11.3.0/gcc-11.3.0.tar.xz"
sha256 "b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39"
end Notice the link for M1, it has url "https://github.com/fxcoudert/gcc/archive/refs/tags/gcc-11.2.0-arm-20211124.tar.gz" I am complete noob when it comes to all those I will need to inspect bottles of 11.3 and 11.2 to understand if it's really the case. Also I need to understand why env change breaks the build on non M1 machines. Few questions that I hope to answer in the next few days. Thanks everyone for the help with debugging this. I hope to provide a solution soon. |
@gwbrck I am still curious, why it works with But before I dive into this, let me comment on Now, with homebrew-emacs-plus/Formula/emacs-plus@29.rb Lines 106 to 109 in edb5b25
Which kind of means that these lines are redundant if the 'figuring out' part works. But it doesn't because Now, if we switch to
Now... some might say that the obvious solution is to revert edb5b25, but I am not so sure, because it fixes native compilation feature usage for some users. So instead I will search for a better solution. Like, ideally I don't want to use |
I would be grateful if someone could validate if #457 fixes this issue for |
It's still failing for me. I have tried reinstalling libgccjit; tried installing libgccjit with --HEAD flag; tried removing it completely; tried reinstalling xcode command line tools. Nothing helped. I still can't install emacs-plus@29 with native comp. Monterey on 2019 Mac (Intel chip). |
How do you run |
I mean, since it's merged already I don't have to do that anymore, but I'm still curious. I'm reinstalling libgccjit at the moment, once it's done, I'll try installing emacs-plus@29 again. |
@agzam actually idk. But I don't think so. |
@d12frosted you said that you wanted to do something similar for emacs@28. Fyi I never had problems installing emacs@28 --with-native-comp.
|
@gwbrck ah right, I didn't enable standard env on 28 🤦 so no need. |
Woohoo, finally writing this in Emacs. I was very annoyed that I had to lose an entire day of work because of this issue, but I'm very grateful you could address it quickly enough so I didn't have to go back to using non-native. It's fantastic that we have "rebels" who won't submit to any status quo and would go to extraordinary lengths to figure out things that work on their terms. Thank you @d12frosted. |
Hi, I'm still having trouble with emacs-plus@29 - maybe I haven't fetched all the right changes? It may be because this machine is still running macOS 11.6.5 (for now...). Seems like I've got the new inference patch from #457 (thanks!) but it doesn't apply properly.
|
I have the same problem on my M1 macbook. I had to comment out that patch- then it works fine. |
Haha. The same fix I did was applied in Emacs master now - emacs-mirror/emacs@faa29fa. So removing my patch. Looks like my speculation was correct. |
Okay, removed my fix. Hope it works for everyone now. |
@d12frosted Thanks for the effort! |
@d12frosted thanks!!! Can confirm - still works for me! |
Ok, seems like the issue is resolved, my hack is not needed anymore. And standard env seems to be working (it just landed in the unfortunate time of new gcc release with a breaking change for Emacs Thanks everyone for reporting the issue, for helping with debug and for checking them fixes 💯 Glad that everyone can come back to using Emacs in the way they meant to 🎉 |
Thank you so much! ❤️ |
Seems like this is broken again 😞 With
|
@cdlm can you please provide output of |
$ brew ls -v libgccjit
/opt/homebrew/Cellar/libgccjit/11.3.0_1/INSTALL_RECEIPT.json
/opt/homebrew/Cellar/libgccjit/11.3.0_1/.brew/libgccjit.rb
/opt/homebrew/Cellar/libgccjit/11.3.0_1/ChangeLog
/opt/homebrew/Cellar/libgccjit/11.3.0_1/include/libgccjit++.h
/opt/homebrew/Cellar/libgccjit/11.3.0_1/include/libgccjit.h
/opt/homebrew/Cellar/libgccjit/11.3.0_1/README
/opt/homebrew/Cellar/libgccjit/11.3.0_1/COPYING.LIB
/opt/homebrew/Cellar/libgccjit/11.3.0_1/COPYING
/opt/homebrew/Cellar/libgccjit/11.3.0_1/COPYING.RUNTIME
/opt/homebrew/Cellar/libgccjit/11.3.0_1/NEWS
/opt/homebrew/Cellar/libgccjit/11.3.0_1/lib/gcc/11/libgccjit.dylib
/opt/homebrew/Cellar/libgccjit/11.3.0_1/lib/gcc/11/libgccjit.0.dylib
/opt/homebrew/Cellar/libgccjit/11.3.0_1/share/info/libgccjit.info |
Just FYI, I can reproduce this too. Edit: I removed Emacs 28, removed Edit 2: After attempting to install Emacs 29 one more time, it worked! (Emacs 28 was already installed, not sure if this changes things). I don't understand what changed, but it worked 🤷 Ah, I used |
Yup… just tried after a few edit: and then it failed again… I'm starting to suspect there's some kind of interaction between |
Problem started after a
brew update/upgrade
. The update/upgrade updated gcc and libgccjit to 11.3.0 and the build of emacs-plus@29 was successful. But starting up emacs-plus@29 failed with error message missing libgccjit.so. Subsequently with brew uninstall/install the failure is during ./configure of emacs-plus@29.Here is the present state of the problem:
brew install emacs-plus@29 --with-native-comp
Running
brew update --preinstall
...==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
hut vcluster
==> Updated Formulae
Updated 7 formulae.
==> Downloading https://ghcr.io/v2/homebrew/core/libgccjit/manifests/11.3.0
Already downloaded: /Users/basab.maulik/Library/Caches/Homebrew/downloads/871b114625dff6a9f75b38649df5a014e260dc952386cfbd3d2bc0f6943f263b--libgccjit-11.3.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libgccjit/blobs/sha256:4cce8e0cf231b7d52cb17cdd45af65d340bac1a8b6b2d76c15bab4544f1c778f
Already downloaded: /Users/basab.maulik/Library/Caches/Homebrew/downloads/964e7187fde9558e672c0eb2f98960273476fbf2347ef1f3859a5c9e4bef2bb5--libgccjit--11.3.0.big_sur.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/manifests/11.3.0
Already downloaded: /Users/basab.maulik/Library/Caches/Homebrew/downloads/0967de7d049f61e00cf839bbf696fe9669c869f232e4bde07094dcb2df99ab90--gcc-11.3.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/gcc/blobs/sha256:fcbb2d595a2b3a74b6c2877979242f77d87c21f4fbc52916fa7d7fbf531ae661
Already downloaded: /Users/basab.maulik/Library/Caches/Homebrew/downloads/b4252910024416372e76abcd21ea9de6e82b4fe3ac3d90c858d63e929aabdd4b--gcc--11.3.0.big_sur.bottle.tar.gz
==> Cloning https://github.com/emacs-mirror/emacs.git
Updating /Users/basab.maulik/Library/Caches/Homebrew/emacs-plus@29--git
From https://github.com/emacs-mirror/emacs
b568a41a5e..8c2ea3a708 master -> origin/master
==> Checking out branch master
Already on 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
HEAD is now at 8c2ea3a708 Avoid change to desktop file format
==> Installing emacs-plus@29 from d12frosted/emacs-plus
==> Installing dependencies for d12frosted/emacs-plus/emacs-plus@29: libgccjit and gcc
==> Installing d12frosted/emacs-plus/emacs-plus@29 dependency: libgccjit
==> Pouring libgccjit--11.3.0.big_sur.bottle.tar.gz
🍺 /usr/local/Cellar/libgccjit/11.3.0: 13 files, 36.4MB
==> Installing d12frosted/emacs-plus/emacs-plus@29 dependency: gcc
==> Pouring gcc--11.3.0.big_sur.bottle.tar.gz
🍺 /usr/local/Cellar/gcc/11.3.0: 2,162 files, 460.7MB
==> Installing d12frosted/emacs-plus/emacs-plus@29 --with-native-comp
==> Patching
==> Applying fix-window-role.patch
patching file src/nsterm.m
Hunk #1 succeeded at 8747 (offset -21 lines).
==> Applying system-appearance.patch
patching file src/frame.h
patching file src/nsfns.m
Hunk #1 succeeded at 1319 (offset 63 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 1924 (offset 35 lines).
Hunk #2 succeeded at 5459 (offset 64 lines).
Hunk #3 succeeded at 5705 (offset 64 lines).
Hunk #4 succeeded at 5755 (offset 64 lines).
Hunk #5 succeeded at 5981 (offset 64 lines).
Hunk #6 succeeded at 9080 (offset 178 lines).
Hunk #7 succeeded at 10236 (offset 178 lines).
==> ./autogen.sh
==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus@29/29.0.50/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus@29/29.0
Last 15 lines from /Users/basab.maulik/Library/Logs/Homebrew/emacs-plus@29/02.configure:
checking for jansson >= 2.7... yes
checking for sys/inotify.h... no
checking for libkqueue... no
checking for library containing kqueue... none required
checking for jpeglib 6b or later... -ljpeg
checking for lcms2... yes
checking for library containing inflateEnd... -lz
checking for dladdr... yes
checking for dlfunc... no
usage: dirname path
checking for gcc_jit_context_acquire in -lgccjit... no
configure: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/d12frosted/homebrew-emacs-plus/issues
The text was updated successfully, but these errors were encountered: