Problem installing ImageCore in Julia 1.4.0 on Windows (Pkg bug?)

Hi folks,

I am trying to install ImageCore in Julia 1.4.0-rc2 on Windows 10.

When I try add the first time, the result is an IOError: symlink: no such file or directory (ENOENT). When I try add the second time, it pass but the package is not really installed. status warns to use instantiate, but it has no effect. Removing and adding result in the same error. Add each dependency of ImageCore results in no error (all packages are installed), but if I try add ImageCore after, also the same error. I tried many other packages that work fine (IJulia, DataFrames, Flux, Plots, PyPlot, …).

I think there is a bug in Pkg, at least the state after the errors is problematic.

Maybe something related to case insensitive filenames?

(I don’t think it is about symlinks, the error also occurs when I ran as Administrator, I also set Developer Mode and add my user to Create Symlink local police)

PS D:\> rm -Recurse -Force julia-pkgs
PS D:\> $env:JULIA_DEPOT_PATH="d:\julia-pkgs"
PS D:\> julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0-rc2.0 (2020-02-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.4) pkg> activate
 Activating environment at `d:\julia-pkgs\environments\v1.4\Project.toml`

(v1.4) pkg> add ImageCore
    Cloning default registries into `d:\julia-pkgs`
    Cloning registry from "https://github.com/JuliaRegistries/General.git"
      Added registry `General` to `d:\julia-pkgs\registries\General`
  Resolving package versions...
┌ Warning: On Windows, creating file symlinks requires Administrator privileges
└ @ Base.Filesystem file.jl:952
ERROR: Error when installing package ImageCore:
IOError: symlink: no such file or directory (ENOENT)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] symlink(::String, ::String) at .\file.jl:955
 [3] cptree(::String, ::String; force::Bool, follow_symlinks::Bool) at .\file.jl:322
 [4] cptree(::String, ::String; force::Bool, follow_symlinks::Bool) at .\file.jl:324 (repeats 2 times)
 [5] cp(::String, ::String; force::Bool, follow_symlinks::Bool) at .\file.jl:349
 [6] rename(::String, ::String) at .\file.jl:895
 [7] #mv#13 at .\file.jl:393 [inlined]
 [8] install_archive(::Array{Pair{String,Bool},1}, ::Base.SHA1, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Operations.jl:530
 [9] macro expansion at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Operations.jl:680 [inlined]
 [10] (::Pkg.Operations.var"#43#46"{Bool,Pkg.Types.Context,Dict{Base.UUID,Array{String,1}},Channel{Any},Channel{Any}})() at .\task.jl:358

(v1.4) pkg> add ImageCore
  Resolving package versions...
   Updating `D:\julia-pkgs\environments\v1.4\Project.toml`
  [a09fc81d] + ImageCore v0.8.11
   Updating `D:\julia-pkgs\environments\v1.4\Manifest.toml`
  [3da002f7] + ColorTypes v0.9.1
  [5ae59095] + Colors v0.11.2
  [53c48c17] + FixedPointNumbers v0.7.1
  [a2bd30eb] + Graphics v1.0.1
  [a09fc81d] + ImageCore v0.8.11
  [dbb5928d] + MappedArrays v0.2.2
  [77ba4419] + NaNMath v0.3.3
  [6fe1bfb0] + OffsetArrays v1.0.2
  [5432bcbf] + PaddedViews v0.5.1
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.0.1
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [b77e0a4c] + InteractiveUtils 
  [76f85450] + LibGit2 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [44cfe95a] + Pkg 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [9a3f8284] + Random 
  [ea8e919c] + SHA 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 

(v1.4) pkg> status
Status `D:\julia-pkgs\environments\v1.4\Project.toml`
→ [a09fc81d] ImageCore v0.8.11
┌ Warning: Some packages (indicated with a red arrow) are not downloaded, use `instantiate` to instantiate the current environment
└ @ Pkg.Display D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Display.jl:238

(v1.4) pkg> instantiate

(v1.4) pkg> status
Status `D:\julia-pkgs\environments\v1.4\Project.toml`
→ [a09fc81d] ImageCore v0.8.11
┌ Warning: Some packages (indicated with a red arrow) are not downloaded, use `instantiate` to instantiate the current environment
└ @ Pkg.Display D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Display.jl:238

julia> versioninfo()
Julia Version 1.4.0-rc2.0
Commit b99ed72c95 (2020-02-24 16:51 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_DEPOT_PATH = d:\julia-pkgs

julia> 

Not that this addresses the fundamental issue, but what happens if you dev ImageCore, does that work?

Yes. Thank you!

PS D:\> rm -Recurse -Force julia-pkgs
PS D:\> $env:JULIA_DEPOT_PATH="d:\julia-pkgs"
PS D:\> julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0-rc2.0 (2020-02-24)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.4) pkg> activate
 Activating environment at `d:\julia-pkgs\environments\v1.4\Project.toml`

(v1.4) pkg> dev ImageCore
    Cloning default registries into `d:\julia-pkgs`
    Cloning registry from "https://github.com/JuliaRegistries/General.git"
      Added registry `General` to `d:\julia-pkgs\registries\General`
    Cloning git-repo `https://github.com/JuliaImages/ImageCore.jl.git`
  Resolving package versions...
  Installed NaNMath ─────────── v0.3.3
  Installed Requires ────────── v1.0.1
  Installed PaddedViews ─────── v0.5.1
  Installed FixedPointNumbers ─ v0.7.1
  Installed ColorTypes ──────── v0.9.1
  Installed OffsetArrays ────── v1.0.2
  Installed Graphics ────────── v1.0.1
  Installed Colors ──────────── v0.11.2
  Installed Reexport ────────── v0.2.0
  Installed MappedArrays ────── v0.2.2
   Updating `D:\julia-pkgs\environments\v1.4\Project.toml`
  [a09fc81d] + ImageCore v0.8.11 [`d:\julia-pkgs\dev\ImageCore`]
   Updating `D:\julia-pkgs\environments\v1.4\Manifest.toml`
  [3da002f7] + ColorTypes v0.9.1
  [5ae59095] + Colors v0.11.2
  [53c48c17] + FixedPointNumbers v0.7.1
  [a2bd30eb] + Graphics v1.0.1
  [a09fc81d] + ImageCore v0.8.11 [`d:\julia-pkgs\dev\ImageCore`]
  [dbb5928d] + MappedArrays v0.2.2
  [77ba4419] + NaNMath v0.3.3
  [6fe1bfb0] + OffsetArrays v1.0.2
  [5432bcbf] + PaddedViews v0.5.1
  [189a3867] + Reexport v0.2.0
  [ae029012] + Requires v1.0.1
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [b77e0a4c] + InteractiveUtils 
  [76f85450] + LibGit2 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [44cfe95a] + Pkg 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [9a3f8284] + Random 
  [ea8e919c] + SHA 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 

(v1.4) pkg> status
Status `D:\julia-pkgs\environments\v1.4\Project.toml`
  [a09fc81d] ImageCore v0.8.11 [`d:\julia-pkgs\dev\ImageCore`]

julia> using ImageCore
[ Info: Precompiling ImageCore [a09fc81d-aa75-5fe9-8630-4744c3626534]

julia>

Also works using # (but @ does not)

(v1.4) pkg> add ImageCore#v0.8.11
(v1.4) pkg> add ImageCore#master

Try remove .julia/packages/ImageCore in case it has gotten into a bad state.