GNU bug report logs -
#55743
28.1.50; No directory error in comp-run-async-workers
Previous Next
Full log
View this message in rfc822 format
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 55743 <at> debbugs.gnu.org
> Date: Wed, 01 Jun 2022 09:13:14 +0300
>
> >> Shouldn't native compilation run in the directory where the emacs
> >> source files are located instead of running in the default directory
> >> of an arbitrary buffer that might be invalid?
> >
> > No, because native compilation could be invoked to compile a file that
> > has nothing to do with the Emacs source tree, e.g., some file of the
> > user or some 3rd-party package installed in some arbitrary place.
>
> Still, shouldn't it run compilation in the same directory
> where that file is located? Isn't this better than running
> compilation in a random dir from a random buffer?
No, it isn't better, because the directory should be set by the
caller. The compilation primitive cannot second-guess what the caller
meant. For example, the file to be compiled could load other files,
and load-path could mention the current directory in some relative
form; or the directory of the file could not be chdir'ed into, but
files in it could be accessed; or some VCS could be involved (so you
need to be in the VCS repository), or something else. make-process
uses the default-directory of the current buffer because making sure
that directory is the correct one is left to the caller, and it makes
it easy for the caller to ensure the compilation runs in the correct
directory.
This bug report was last modified 3 years and 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.