Subject: Re: bug#50975: 28.0.60; mh-utils-tests fail with native compilation

From: Andrea Corallo <[email-masked]>
Date: Mon, 04 Oct 2021 20:57:22 +0000

Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

[...]

> Yep will have a look, I'd bet is `file-directory-p' being redefined with
> a incompatible lambda list.
>
>   Andrea

Okay I see what's the issue.

`with-mh-test-env' through `mh-test-utils-setup-with-mocks' is mocking
`call-process'.

The substitute for this (`mh-test-utils-mock-call-process') is verifying
something each time is called in the assumption that `call-process' is
only triggered by the tests.  Unfortunatelly to compile a trampoline
Emacs is invoking `call-process' and the test fails.

This is not 100% trivial to solve cause redefining a primitive needs to
have `call-process' functional and is not only a matter of skipping the
test in the fake `call-process' when this is called by the native
compiler.

I've pushed 63cb65dcce to fix that, it builds the two trampolines AOT so
we have no interference with the tests.

Seems to work here, please have a try.

Thanks!

  Andrea