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
emacs: turn off optimizations, re-enable native-compilation #17319
Conversation
Thank you for looking into this.
Does this change fix any issue or add another issue? |
It should "fix" (obviously not a permanent solution) #16413 #16375 #16190. I mainly tested the UCRT64 build, where I didn't notice any of the problems mentioned in the open issues. I was able to install packages, CPU utilization seems normal and starting an async process (e.g. As a tradeoff, it adds the issue of generally lower performance, which I measured with
Under emacs-28.2-2:
I can open a new issue for posterity if you want once the PR is merged. |
these patches are not needed anymore. it can be safely removed from the patch file..
MINGW-packages/mingw-w64-emacs/002-clang-fixes.patch Lines 4 to 23 in c3b17f8
|
I tried this build and it solves the sub-process related issues for me as well. Emacs seems to be a little bit more sluggish without the optimizations but very much usable. However, this could be just a placebo. In #16190 there was some talk about – yet unspecified – ideas to properly fix the issue. In the meanwhile, @oscarfv do you think turning off optimizations is a good workaround? |
Turning optimizations off is not acceptable, IMAO, performance is terrible. Popular packages such as OTOH, if |
@oscarfv I agree, LSP will probably bring it to a crawl. I just thought it to be better than the current state of things since the package has been unusable for months with no solution in sight. OTOH, leaving the package broken creates more urgency for a true fix :) |
Yes, the current state sucks big time. A possible low-tech route for "fixing" the problem is to pinpoint the optimization that causes it. Since gcc optimization switches: https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Optimize-Options.html |
I actually wanted to try this, but compiling with
I believe the above would explain what I've seen. It's either an optimization not controllable via an individual flag thats causing the issue or one that is actively suppressed by |
Delete superfluous clang patches
I've managed to find the culprit: removing https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63752 I've also deleted the patches @raedrizqie mentioned, the builds seem to work fine without them. |
This is fantastic news, thank you @cyrilarnould ! Would you please create a new PR with just the removal of |
Can do, although I'm worried about the ucrt64/mingw64 builds taking this long... Is there a way to look into the logs to see where they're hanging exactly? In the second PR, should I also remove the clang patches or keep them? |
That would also explain how the GNU build of Emacs 29 works fine while building it from MSYS doesn't. They built that with optimizations but without extra flags: |
The long compilation time is, most likely, because of you re-enabling nativecomp. @Biswa96 disabled it because gcc 13.1 requires a very long time to compile the I suggest that you submit the removal of the clang patches on a different PR. Thank you. |
I see, thanks for the explanation. I'll leave the clang patches to @raedrizqie then :) |
@oscarfv BTW, upstream is understandably passing the ball along to MSYS2. I've noticed that https://github.com/msys2/MSYS2-packages/commits/master/pacman/makepkg_mingw.conf Should I open an issue in the MSYS2-packages or MINGW-packages repository referencing this emacs build problem for further investigations? |
It is a good idea even if the issue remains inactive: it registers the existence of the problem. |
Using the
-O0
optimization level seems to address the issues that plague the previous two emacs releases. I tried-Og
and-O1
, but with those I was still getting problems.Performance is not great, but still usable. As a quick test, I ran
vhdl-beautify-buffer
on a large VHDL file (one of the heavier emacs commands I know). A file which previously took 3.97 seconds to beautify now takes 23.91 seconds.This might address issues #16413 #16375 and #16190, did not fully look into each of them though.