Mktempdir bug

Julia has an issue caused by mktempdir() that prevents precompiling of multiple packages on affected systems. This bug is three or more years old, yet is manifested sporadically, which is probably why it has not been fixed yet. I am looking for some workaround, perhaps, overloading the mktempdir() function, because at present it makes the Julia language unusable on affected computers.

1 Like

This issue is also present in the latest release 1.9.3, same error from libuv.jl:100

Julia is practically unusable on Windows 7 due to this, because it makes it impossible to install many popular packages, such as Images.jl . The issue is still present in 1.9.4 release.

Did you set the environment variable TMPDIR ?

julia> ENV["TMPDIR"] = joinpath(pwd(), "temporary")
"/home/mkitti/temporary"

julia> mkdir(ENV["TMPDIR"])
"temporary"

julia> mktempdir()
"/home/mkitti/temporary/jl_1AnfFW"

Also see GetTempPathW function (fileapi.h) - Win32 apps | Microsoft Learn

So perhaps change the environment variable TMP or TEMP.

Also libuv xref:
https://docs.libuv.org/en/v1.x/misc.html#c.uv_os_tmpdir