Subject: bug#62004: 30.0.50; comp-run-async-workers failure when default-directory deleted

From: Andrea Corallo <[email-masked]>
Date: Tue, 07 Mar 2023 16:00:39 +0000

No Wayman <[email-masked]> writes:

>>> Eli Zaretskii <[email-masked]> writes:
>>>  > Well, maybe we should bind the variable to be on the safe  >
>>> side?  What
>>> > if we bind it to the directory where we write that
>>> > emacs-async-comp-something.el file?
>
> Binding default-directory makes sense.
> It's just a matter of what to bind it to.
> I see that `comp-run-async-workers` calls `make-temp-file' internally.
> Binding default-directory to temporary-file-directory around the call
> to `make-process' will prevent this error and seems like a safe bet.
>
>>> From: Andrea Corallo <[email-masked]>
>>> Cc: [email-masked], [email-masked]
>>> Date: Tue, 07 Mar 2023 13:51:37 +0000
>>>
>>> Maybe but the reporter says "The default-directory is dependent on
>>> where
>>> comp-run-async-workers happens to kick off." and I don't understand
>>> if
>>> that's correct why is that.
>>> I'd like first to understand better the issue here.
>>
>> I agree that we should first have a good understanding of the
>> situation.  Let me know if I can help in any way.
>
> The call to `make-process' in `comp-run-async-workers' is executed in
> the context of whatever default-directory happens to be. If
> default-directory does not refer to an existing directory (as
> demonstrated in the reproduction case I provided) the creation of the
> subprocess will fail.
> I'm not sure what more detail I can provide, so please ask a specific
> question if you have any.

Ah now it's clear to me, the error is not happening in the child process
but in the main Emacs failing in running `make-process'.

Thanks

  Andrea