-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Installation fails with libgccjit (and possibly gcc) 12.1.0 recent release #485
Comments
I suspect that the libgccjit update breaks something in the emacs-plus formula. For now, I'll try to downgrade libgccjit and attempt rebuilding. |
I just came across this error. Will be looking for your update on downgrading libgccjit. |
Seems to be related to gcc updating to 12.1.0 too in Homebrew/homebrew-core#106755. I'll try downgrading libgccjit, but I suspect I'll also have to downgrade gcc too, which will probably be challenging 😬. |
@slidesecurity here's how to downgrade: I didn't attempt to not downgrade gcc - I'm betting that gcc 12.1.0 breaks stuff in libgccjit 11.3.0_1 so I opted to downgrade both, re-install emacs-plus, then pin all 3 formulae for now.
Generalized answer at https://stackoverflow.com/a/73254186/6310633 (feel free to upvote 😁) |
@jidicula Johanan, you just saved hours of frustration for so many people. Thank you for being so awesome! |
@jidicula You are a life saver. I followed your steps and I have Emacs running again. Infinite thanks! |
Thanks a lot. I had to run |
Wow. I just have to say that I am happy to be part of this community 🤗 You folks rock! @jidicula thanks for sharing your workaround 💯 @bkmit sent a PR that is now in master. It should fix emacs-plus@28 with native comp. Please give it a try and let me know if it doesn't work. On my side I am upgrading my local machine to be able to test |
See #492 for similar fix for |
I am pinning this issue untill we fix compilation with I will close once I get enough confirmations that it works for both versions. Please use this issue to report anything related to libgccjit discovery. I am closing all other duplicates. |
#492 is merged. In order to test it, performa a combination of |
Just tried. Failed once and then built on second try of edit: just for fun I tried a couple more times and got two more fails and one build |
Testing installation of emacs-plus@29.
Despite linkage error, emacs seems to be working fine. |
Same for me.
|
Thanks for testing. Frankly I am disapointed by flakiness and amount of errors related to native compilation. Will check the linkage error in the evening. Just curious of it's M1 or Intel. Seems like Intel to me. |
@d12frosted I'm on Intel |
It works on Apple Silicon here. |
@roman-rudakov that's what I though. I am on M1 and it works for me like it works for @ngn999. Will try to get my hands on an intel mac to fix linking there as well. |
➕ Intel. |
Flakiness on M1 here 😅 |
I have an Intel Mac. I unpinned gcc, libgccjit and uninstalled emacs-plus 28. Then, reinstall, libgccjit, xz and install emacs-plus with your favorite flags. For the moment everything is working fine so far. |
I uninstalled my previous emacs-plus@28 and installed newer version using: When I opened emacs, the buffer
However, I'm not seeing the functions being native compiled:
My config, running on M1:
|
It looks like I just got bad luck and got hit by this issue https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-10/msg01805.html Fix is already on master, will try again later, as I'm currently building Emacs from source (no emacs-plus) |
hi all, i was able to get emacs 29 with native comp built on an M1 mac running Ventura with the following: Clean up existing installation and build artifactsbrew uninstall emacs-plus@29
rm -rf ~/Library/Caches/Homebrew/emacs-plus@29--git Install latest libgccjit and symlinkNote: this is using libgccjit version 12 at the time of writing. brew install -s libgccjit
cd (brew --prefix)/lib
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.dylib ./
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.0.dylib ./ Install emacs-plusset -x LIBRARY_PATH (brew --prefix)/lib
brew install emacs-plus@29 --with-native-comp --with-xwidgets --with-imagemagick --with-poll --with-no-frame-refocus --with-modern-sjrmanning-icon --verbose |
I confirm the above steps also worked for me on a M1 Mac running Ventura. |
This worked for me. I had to add ignore-dependencies to keep awk from being installed since I use gnu awk instead. brew uninstall \
--ignore-dependencies \
libgccjit \
gcc \
emacs-plus
brew install \
--ignore-dependencies \
--build-from-source \
libgccjit \
gcc
cd "$(brew --prefix)/lib"
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.dylib ./
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.0.dylib ./
cd -
LIBRARY_PATH="$(brew --prefix)/lib" \
HOMEBREW_NO_INSTALL_CLEANUP=1 \
brew install \
--ignore-dependencies \
emacs-plus@29 \
--with-native-comp \
--with-xwidgets \
--with-imagemagick \
--with-mailutils \
--with-poll \
--with-no-frame-refocus \
--with-spacemacs-icon I'm not sold on the |
Ended up downgrading to 28 for a while and just tried again. Failing install using the most recent approach (symlinking libgccjit & install with LIBRARY_PATH set): The install hangs while cloning for about 30 minutes at which point I just cancelled.
|
@sm0b0 might be your internet connection. Try to manually clone https://github.com/emacs-mirror/emacs.git and see if it works. |
I'll try that, but not sure when - already reinstalled 28 (with native comp is still working there 👍). That also seems to indicate that it's not an internet problem, but who knows. |
The method @andrew-hm gave recently in #485 (comment) above worked for me yesterday on an M1 mac ( |
TLDR: check for libgccjit simlinks of So I was running into this problem, but i'm on MacOS
looking in the logs in Removing unecessary Looking in So one
on lines 126 and 127, and
|
Thu 22 Dec 2022 10:22:52 GMT With the upgrade to
Results in:
HTH. |
If you have migrated to an Apple silicon machine (like me), you are likely to have brought your homebrew install from its previous location (under /usr/local). Under Apple silicon, homebrew is installed under /opt. I resolved the libgccjit issue by reinstalling homebrew to the proper location - (from https://docs.brew.sh/Common-Issues, copied here for convenience).
After everything was reinstalled, I did the following:
then,
lastly, running, |
Update from me: |
I followed @jgrey4296's tip but with the paths modified for the M1 macOS Homebrew install location (
brew reinstall gcc libgccjit
brew unlink -v libgccjit
brew link -v libgccjit
cd $(brew --prefix)/lib
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.dylib ./
ln -s ../Cellar/libgccjit/12.2.0/lib/gcc/12/libgccjit.0.dylib ./
ENV.append "CPATH", "#{HOMEBREW_PREFIX}/include"
ENV.append "LIBRARY_PATH", "#{HOMEBREW_PREFIX}/lib"
brew install emacs-plus@28 --verbose --with-elrumo2-icon --with-mailutils --with-xwidgets --with-native-comp --with-imagemagick --with-no-frame-refocus and it built! @d12frosted Does this mean there's something broken with the edit: draft PR for the additional symlink step in the libgccjit formula Homebrew/homebrew-core#119176 |
Actually, I think it may be more straightforward to just modify the formulae here with something like: ENV.append "CPATH", "#{HOMEBREW_PREFIX}/include" if build.with? "native-comp"
ENV.append "LIBRARY_PATH", "#{HOMEBREW_PREFIX}/lib/gcc/current" if build.with? "native-comp" rather than modifying the homebrew-core libgccjit formula to add an extra linkage step. I also just did a re-read of this thread and realized that @rprimus already found this solution 🙂 |
@jidicula PR is welcome :) |
When installed with Homebrew, libgccjit 12 writes header files to the Homebrew `include` directory and DLLs to Homebrew's `lib/gcc/current` directory. If these locations are not added to CPATH and LIBRARY_PATH, respectively, the Emacs build toolchain is unable to locate libgccjit, leading to the build failure described in d12frosted#485. This change appends those libgccjit paths to CPATH and LIBRARY_PATH for all Emacs versions that support the native compilation build flag. Resolves: d12frosted#485
Since this PR addresses the breakage with native compilation build flags, we can now re-enable this flag in the CI build matrix to verify the fix. Related to d12frosted#485
When installed with Homebrew, libgccjit 12 writes header files to the Homebrew `include` directory and DLLs to Homebrew's `lib/gcc/current` directory. If these locations are not added to CPATH and LIBRARY_PATH, respectively, the Emacs build toolchain is unable to locate libgccjit, leading to the build failure described in #485. This change appends those libgccjit paths to CPATH and LIBRARY_PATH for all Emacs versions that support the native compilation build flag. Resolves: #485
Since this PR addresses the breakage with native compilation build flags, we can now re-enable this flag in the CI build matrix to verify the fix. Related to #485
Thanks to @jidicula we have a fix in master. Please do |
I am on a new Ventura machine Macbook Air M1, and am not able ti get my smooth emacs flow...
Any help appreciated! |
My problem is that my init is not being properly read, it spits problems everywhere of the type Wrong type arguments: markerp, nil, when with my Catalina installation there were any errors. I have to comment lines like (setq lpr-switches '("-Myprinter-Canon")) because it would spit out that error. |
Shouldn’t there be a ❯ echo $(brew --prefix)
/opt/homebrew
❯ echo (brew --prefix)
zsh: unknown file attribute: b |
Please make sure to follow these steps (and mark the checkboxes):
brew update
and try to reproduce the issue againbrew doctor
, fix all issues and try to reproduce your issue againbrew config
andbrew doctor
and include their outputWhat you were trying to do
Brew updating all outdated formulas, which included libgccjit and gcc 11.3.0_1 -> 12.1.0 today. Since emacs-plus is a dependent, it got rebuilt too and failed, so I uninstalled it completely and re-ran the install command below (because its
reinstall
build is known to not work).What happened (include command output)
Command output
Note that the final error about an API token is irrelevant to this issue - I've disabled the GitHub PAT on my machine because of work restrictions.
Output of
brew config
Output of
brew doctor
I don't think this warning is relevant, it's a result of my mitigation for #466 .
The text was updated successfully, but these errors were encountered: