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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 07 Mar 2023 05:30:34 +0200

> From: No Wayman <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Mon, 06 Mar 2023 16:29:19 -0500
> 
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Sorry, I don't think I understand.  Are you saying that we don't 
> > bind
> > default-directory to a safe value when compiling?
> 
> Correct. The default-directory is dependent on where 
> comp-run-async-workers happens to kick off.

I'm not sure what would be a safe value for that.  We had a lot of
trouble in other cases where such a value was required.

Andrea, any ideas?  How come we never ran into this issue until now?
Is the default-directory value when native compilation is forked
somehow derived from the directory of the file being compiled?

> >  IOW, how could a directory where the async compilation 
> >  subprocess runs become invalid, in Real Life?
> 
> I ran into this error in the wild by:
> 
> - Installing a package to review it.
> - Deleting the package's repository, but still had the package's 
>   main elisp buffer open/current.
> - Ran a command, which loaded a package, which kicked off the JIT 
>   comp process.

That's a pretty unusual situation, IMO.