-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Artifact folder could not be made on Windows. #3822
Comments
Update, perhaps not unsuprisingly, it seems to have been an anti-virus issue (using a different, non-centrally administrated anti-virus solved the problem). |
Perhaps, but at the same time it feels fruitless to fight anti viruses since they sit at a different privilege level and can just block anything they feel like. |
What about providing a hint to windows users to check if their anti-virus could be interfering then? |
This post seems to be about a similar issue https://discourse.julialang.org/t/installation-of-nodejs-fails-directory-not-empty/111117 It might be good to put the If you run |
Oh, I see, the real issue is |
As @vtjnash points out, it may be possible to change libuv to using posix |
This seems a common misconception, so just note that that comment does not reflect what atomic rename is documented to mean on Unix or anywhere else either. The atomic only refers to the new file name and contents, but does not require the old name to be deleted simultaneously
|
When renaming directories instead of files, does that mean oldpath and newpath can refer to the same directory shortly after rename succeeds? |
No, most file systems usually won't permit a hard link to be created to a directory |
So in that case, it should be fine/equivalent to call And in that case, most likely this problem would be solved? Unfortunately, I don't have time to re-install the old antivirus to test that now... |
The fix suggested in #3822 (comment) (the EDIT: after rereading the OP, the error I got with the hacked |
The issue with using |
Yeah, it feels like someone really needs to rewrite a lot of that code in Filesystem better. It is currently intended to replicate the For example, we could try to be inspired more by the |
@mzaffalon @KnutAM I don't know how to test this in a real-world scenario because I don't have a problematic anti-virus installed. But if you want to test this out https://github.com/JuliaLang/Pkg.jl?tab=readme-ov-file#using-the-development-version-of-pkgjl has instructions for using the development version of Pkg.jl. You will also need the nightly version of julia https://julialang.org/downloads/nightlies/ |
@nhz2 I still had the old artifacts directory on my computer. I gave it a try with the nightly version and your instructions for the development version of I removed the directory |
I don't know exactly how the antivirus is interferring, but perhaps it is possible to reproduce the error by opening one of the files that are attempted to be renamed? |
I found a way to reproduce the error on Linux, but it requires sudo so try this at your own risk. After running this I had to manually move my artifact folder to trash. The following Julia code continuously scans through the artifact folder, making any temporary directories immutable. julia> d = joinpath(DEPOT_PATH[1], "artifacts");
julia> while true
sleep(0.1)
ds = readdir(d)
for i in findall(startswith("jl_"), ds)
t = joinpath(d, ds[i])
run(`sudo chattr +i $(t)`)
end
end While this is running, if I try to add (@v1.10) pkg> add NodeJS
Resolving package versions...
Downloaded artifact: JpegTurbo
ERROR: IOError: rm("/home/nathan/.julia/artifacts/jl_39jFUR"): operation not permitted (EPERM)
Stacktrace:
... In the PR I get: (jl_Fa2kB2) pkg> add NodeJS
Resolving package versions...
┌ Warning: Failed to clean up temporary directory "/home/nathan/.julia/artifacts/jl_x8Yk1d"
│ exception = IOError: rm("/home/nathan/.julia/artifacts/jl_x8Yk1d"): operation not permitted (EPERM)
└ @ Pkg.Artifacts ~/github/Pkg.jl/src/Artifacts.jl:385
┌ Warning: Failed to clean up temporary directory "/home/nathan/.julia/artifacts/jl_CqRuTl"
│ exception = IOError: rm("/home/nathan/.julia/artifacts/jl_CqRuTl"): operation not permitted (EPERM)
└ @ Pkg.Artifacts ~/github/Pkg.jl/src/Artifacts.jl:385
ERROR: Unable to automatically download/install artifact 'nodejs_app' from sources listed in '/home/nathan/.julia/packages/NodeJS/LntTk/Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/9c278c61d6242d19deca58e582fc6a6f0a727de8
Error: SystemError: opening file "/home/nathan/.julia/artifacts/jl_x8Yk1d/CHANGELOG.md": Operation not permitted
- https://github.com/davidanthoff/NodeJSBuilder/releases/download/v18.16.0%2B0/NodeJS-18.16.0+0-x86_64-linux-gnu.tar.gz
Error: SystemError: opening file "/home/nathan/.julia/artifacts/jl_CqRuTl/CHANGELOG.md": Operation not permitted
Stacktrace:
... |
Manually renaming the artifact folder to the hash is another fix for anyone getting hit by this (e.g. |
If the rename was retried after sleeping for some increasing amount of time, would that solve this issue, or does the anti-virus always stop Julia from doing a rename? |
I think there's a related issue with Line 991 in 8b2c0f3
|
When running
Pkg.add("CairoMakie")
in an empty project I'm getting this,Error: "C:\\Users\\meyer\\.julia\\artifacts\\a8244d6d23cbb895fcd39dd3eddb859a0c05d1c6" could not be made
, which I seems to occur as the atomic rename fails after #3768.However, before getting there, I hit JuliaLang/julia#34700, but that could be due to a failure related to above, but the
rm
is in a final block...To "fix" the problem, I first hacked
Base.rm
(but this could just as well be done in
create_artifact
)And modified
_mv_temp_artifact_dir
(which I couldn't hack since the dispatch is concrete...)Just do cp 💀
is printed twice, along with a couple ofTrying again for ...
.In fact, it seems like the
x264_jll
andPixman_jll
are the ones that needs retries, not sure if by chance or anything special about these.Strangely, trying many times, it seemed to work, but fails again if I empty the artifacts folder...
Versioninfo
The text was updated successfully, but these errors were encountered: