Unbreak beginend(marks-test and beginend-narrowing-test #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello !
The tests in the files
test/beginend-narrowing-test.el
andtest/beginend-marks-test.el
can fail under a specific set of conditions.Emacs 28 has introduced native compilation of elisp code. In order to allow the advising of primitives (functions accessible from elisp implemented in C) to benefit from native compilation as well, these primitives have to be replaced by a trampoline that allows jumping to arbitrary native code (that we imagine to be the native compiled version of the elisp function the user has replaced the primitive with).
The test bed provided by the two aforementioned files advises the primitive
message
:If no trampoline is already present for the primitive at the time of evaluation of the form, a trampoline has to be compiled from it. This trampoline compilation fails with the following backtrace :
You probably never reach this error because you are lucky to always have the trampoline already. In specific build environments, where tests are run in a clean environment with a clean emacs (for instance the Debian build process of beginend from which the backtrace is taken), the trampoline is not there and needs to be compiled. You should be able to reproduce if you delete the trampoline (it should be named something like
subr-message-<some hash>.eln
) before launching the test.We have no idea why the function
comp--native-compile
errors. We do know that we can simply work around the error by deactivating trampoline compilation for this primitive, thus allowing the tests to pass.This patch does exactly that.
Let me know if you have any questions.
Best,
Aymeric Agon-Rambosson