see haskell#11759
in particular this comment:
It adds some more cleanup than strictly what haskell#11686 asks for (the teardown function removes some extra *.tmp files) but it looks legit: it addresses this logic in Distribution.Client.Config
Rather than work around it in the test suite, let's fix Distribution.Client.Config: the shenanigans with tmpFile are ill advised, just createDirectoryIfMissing and immediately writeFileAtomic file.
haskell#11759 (comment)
see haskell#11759
in particular this comment:
haskell#11759 (comment)