The darcs code makes use of the current working directory, a process-
level global. This is not thread safe, either for concurrent calls to
the darcs library itself on different threads, or for concurrent use of
CWD by a non-darcs thread at the same time as darcs.
The obvious code fix is to use absolute paths anyway, but this
apparently has a significant performance penalty (see discussion on
patch127).
In msg10613, Duncan suggests use of the POSIX openat function where
available:
> Here's a crazy idea: use the POSIX "*at" functions, see man
> openat for an explanation and links to the related functions.
> The API can be emulated on Windows at the performance cost that
> has already been noted.
> The downside of course would be not using the ordinary System.*
> functions and having to write your own binding. Of course such
> a binding would be useful more widely, probably best as
> an implementation substrate in some new IO lib that has an
> abstract FilePath type.
Discussion under way at
http://lists.osuosl.org/pipermail/darcs-users/2010-April/023566.html
Hopefully this will give us an idea how to address the problem.
[Yeah, the downside to this separation of tracking from talking is the
bureaucratic overhead of talking about talking, and then apologetic
talking about talking about talking. Sorry! :-(]
Marking this as "wishlist". I am not sure any of the proposed
solutions are practical. openat is nice but not available via the
Win32 API (https://stackoverflow.com/questions/32138524/is-there-a-
windows-equivalent-of-openat).
I agree this should be wishlist for now but it would be very nice to find a
proper solution. I'd be open to using the NT kernel API (NtCreateFile)
if necessary.