JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
613 stars 251 forks source link

ignore tree hashes on Windows w/o symlink capability #3764

Closed StefanKarpinski closed 5 months ago

StefanKarpinski commented 6 months ago

Step one of addressing https://github.com/JuliaLang/Pkg.jl/issues/3643. I implemented this by providing a default for the ignore_hash value in download_artifact, namely the default value is false unless the OS is Windows and the user cannot create symlinks in the artifact directory, in which case we default ignore_hash to true instead. This still emits a warning, which seems desirable based on the discussion in #3643.

StefanKarpinski commented 5 months ago

If someone wants to help me debug this, I'm slammed and haven't and won't have the time (kid was sick last week, I was sick over the weekend, childcare is sick now, plus have to work), but this needs to go into 1.10.1. An intermediate version did work, now it's failing tests, probably because the tests expect some specific error message. If someone could help track down why this is failing now, that would really help.

IanButterworth commented 5 months ago

~This is the issue.~

julia> ENV["JULIA_PKG_IGNORE_HASHES"] = nothing

julia> ENV["JULIA_PKG_IGNORE_HASHES"]
"nothing"

The test setup is bad. It should avoid the withenv here rather than set it to nothing.

I'll push a fix


Ok, I might be wrong, but I'll figure it out this eve

julia> withenv("FOO" => nothing) do
       ENV["FOO"]
       end
ERROR: KeyError: key "FOO" not found
IanButterworth commented 5 months ago

Ok. The logic was just inverted on ignore_hash_env_set. This passes artifacts tests locally now

StefanKarpinski commented 5 months ago

Thank you so much, @IanButterworth! You're the best ❤️