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: disable trampoline generation when installing packages #109370
Conversation
cc @tadfisher |
I guess I'm confused; if |
To be clear, the present PR is just a workaround. Failing to compile a trampoline didn't previously result in package installation failing (as evidenced by the fact that trampolines have always failed to compile during package installation in the gccemacs Nix setup). But |
Update: Changes in The gccemacs maintainer argues that failure to compile trampolines should be an error because it could change behaviour, and I think I agree. So for Nix I see two options:
|
|
Ah, I think I see the problem now. An alternative approach could be to exercise trampoline generation by loading the package after installing it, which I would hope would generate trampolines to all advised functions called at |
I was running this patch for a while, but just determined that it was causing me some trouble. The actual issue I was experiencing was that There were no errors or warnings obviously pointing to missing |
@acowley This is very interesting, thanks for the investigation! So if this PR causes problems, I think setting up EMACSNATIVELOADPATH at package install time is the only option. I think doing so is a good option even if it duplicates trampolines, and we can always try to remove duplication later with @tadfisher's idea. |
One idea to reduce duplication would be to try this workaround Andrea suggested in an earlier bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44238#8 @flatwhatson From the above bug, I assume you were doing the trampoline precompilation for Guix packaging reasons. From your experience, are we missing a solution here? We are having trouble with packages that |
@acowley By the way, do you disable deferred compilation in your init file? |
@collares I've tried it both ways several times in trying to debug things. It is disabled at this moment, but I ran with it enabled yesterday. I'm happy to try variations! I admit I don't really understand its exact impact, so whenever I notice an issue I try it both ways with a few emacs restarts each way, and keep an eye on whether or not there's an Async compilation buffer and what it's doing. |
In gccemacs, installing packages using
elpa2nix-install-package
sometimes causes trampolines to be compiled even if we are not runningbatch-native-compile
. This happens, for example, when a package does a topleveladd-advice
. Since we do not haveEMACSNATIVELOADPATH
set up when installing packages (and I believe we do not want to have it set up because native compilation is supposed to be a separate step), there won't be an output directory for the compiled trampoline. This is blockingemacsGcc
in the overlay, see nix-community/emacs-overlay#74 (comment).