TMPDIR does not work on windows
The TMPDIR variable should be able to be used to override the location for temporary files.
-tmpdir ⟨dir⟩
If you have trouble because of running out of space in /tmp (or wherever your installation thinks temporary files should go), you may use the -tmpdir ⟨dir⟩ option to specify an alternate directory. For example, -tmpdir . says to put temporary files in the current working directory.
Alternatively, use your TMPDIR environment variable. Set it to the name of the directory where temporary files should be put. GCC and other programs will honour the TMPDIR variable as well.
On windows, the value of the TMPDIR
is not honoured.
This is because we rely on the directory function getTemporaryDirectory
which doesn't honour it.
module Main where
import System.Directory
main = getTemporaryDirectory >>= print
on linux prints
[nix-shell:~/ghc-clean]$ TMPDIR=$PWD ./TempDir
"/home/matt/ghc-clean"
but on windows the value is ignored.