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")

julia> mkdir(ENV["TMPDIR"])

julia> mktempdir()

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

So perhaps change the environment variable TMP or TEMP.

Also libuv xref:

That does nothing whatsoever for the precompile error.

Did it change the location of the temporary directory?


Try these directions to see if changing the temporary directory location helps:

On what grounds do you expect that changing precompilation directory will make any difference?

The reported error is a file permission issue. Perhaps if you relocate the temporary directory to a directory where you more clearly have file permissions, there might not be a problem deleting the temporary files.

I was inspecting the source code, and there have been changes to this part of the Julia code that may resolve the issue.
In particular, it seems that this function should only warn if there an issue deleting these files. There have also been changes in this area with regard to precompilation.

Could you try the nightly builds and report the stacktrace if the error still occurs?