Repository navigation
Fix Emacs package dependency on generated symbols - #4692
Conversation
|
oops, this might have a wrong base? @d-torrance ? |
|
OK, now the base is fine. @d-torrance - who can review this? |
both for cmake and for autotools Co-authored-by: Codex <noreply@openai.com>
Preserve explicit CI and build-script invocations with an empty target when Emacs or its submodule is unavailable. Co-authored-by: Codex <noreply@openai.com>
d-torrance
left a comment
There was a problem hiding this comment.
I don't think detecting the presence of Emacs during the build is the right fix for #4691, or even something we should be doing at all. We don't actually call the Emacs binary anywhere during the build, so there's no reason to require it.
The root cause of #4691 looks to be something different (No such file or directory when trying to copy a file.)
Remove Emacs executable checks: generation uses M2. Depend explicitly on the build-tree symbols file so the package copy waits for grammar generation. Co-authored-by: Codex <noreply@openai.com>
|
OK, @d-torrance - this is just 1-liner now. |
|
@d-torrance @mikestillman - do we want to make the emacs interface a proper M2 package? This would allow to get rid of the git submodule, I suppose. |
|
I would love to get rid of the submodule! I've got some ideas to distribute the emacs package MELPA-style from the website (we can't get in actual MELPA unless we agree to rename the package from |
|
thus, on the user side this would be via Or you'd rather do everything from emacs then? |
|
Probably still |
|
you mean M2's core? |
|
Yeah, exactly. Right now it writes to the user's .emacs file to ensure that Emacs knows how to load the package. We could instead have it add an "M2ELPA" package repo and install the M2 package if it's not available (probably using |
|
🤖 The starting point is good: M2-emacs already supports Emacs package managers, contains generated symbols and help files, and has its own symbol-generation script.
Merge order: independent package and tested installation instructions first; M2 removal second. MELPA acceptance can proceed separately because direct installation from Emacs already provides a migration path. The fix in #4692 remains useful for builds before this transition. 🤖 gpt-6-astra worked on this 🤖 |
|
PRs coming up |
|
@d-torrance - this PR is now an 1-liner, easy to review |
d-torrance
left a comment
There was a problem hiding this comment.
Looks good to me -- thanks!
The bug this fixes was a regression caused by me in Macaulay2/M2-emacs#87, when we started commiting M2-symbols.el instead of the gzipped M2-symbols.el.gz (this way, it gets byte-compiled when installing the Emacs package). Having a copy in the source directory satisfied the dependency to copy from the build directory, which caused an error if we hadn't built it yet.
Fixes #4691.
The Emacs package copy could run before the build-tree
emacs/M2-symbols.elwas generated: the relative dependency could resolve to the checked-in source file instead. Use the explicit build-tree path so grammar generation finishes before the copy runs.Emacs itself is not used to generate the package. The earlier CMake and Autotools checks for the Emacs executable have been removed; the final diff is a one-line CMake dependency fix.
Validation: reproduced the original copy failure with both Unix Makefiles and Ninja in an isolated editor-build harness using an existing M2 executable. Both builds pass with the fix, including regeneration after deleting the build-tree symbols file. A failing Emacs stub was not invoked. No full M2 rebuild was performed.
This is independent of #4725: that PR handles submodule source availability, while this change fixes generated-file ordering.
🤖 gpt-6-astra worked on this 🤖