Subject: Re: bug#55743: 28.1.50; No directory error in comp-run-async-workers

From: Eli Zaretskii <[email-masked]>
Date: Thu, 02 Jun 2022 11:44:53 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: Juri Linkov <[email-masked]>,  [email-masked]
> Date: Thu, 02 Jun 2022 10:17:10 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > We require that default-directory be valid whenever Emacs needs to run
> > a subprocess.  This is a basic requirement for all Lisp programs using
> > this facility.  Native compilation is not different from any other
> > Lisp program that invokes a subprocess.
> 
> Any asynchronous background process has to ensure that it starts from a
> sensible directory -- not whatever default-directory that happens to be
> in place in the current buffer.

But what is the "sensible" directory in this case?  I don't think we
can know it, because what it is depends on many factors we cannot
possibly take into consideration.

IMO, it's the other way around: any Lisp program that could
potentially trigger a subprocess, including compilation, should make
sure the default-directory is always valid.