JuliaLang / Pkg.jl

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

dev .. : Relative directory failing under Windows when having cd'ed with incorrect case #3892

Open divbyzerofordummies opened 2 months ago

divbyzerofordummies commented 2 months ago

I have a minor issue when trying to dev a relative directory in REPL package mode.

My package has uppercase letters, say MyPackage, but I have moved there using the shell environment, having used a lower case letter by mistake:

shell> cd mypackage/test

which works.

pwd() gives the global path with mypackage in lower case letters, so the mistake is not "corrected".

If I activate the environment there (still works) and try to dev the parent folder, I get

(test) pkg> dev ..
ERROR: `..` appears to be a local path, but directory does not exist

Funnily, FileSystem does not have any issues:

julia> Base.Filesystem.readdir("..")

works as expected.

Also, this is not a Pkg.jl bug since

julia> import Pkg; Pkg.develop(path="..")

works as well.

My versioninfo() output is:

Julia Version 1.9.3
Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × 12th Gen Intel(R) Core(TM) i5-12400
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, alderlake)
  Threads: 4 on 12 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4
fredrikekre commented 2 months ago

Does (test) pkg> dev ./.. work?

KristofferC commented 2 months ago

It is explicitly checking case sensitively in

https://github.com/JuliaLang/Pkg.jl/blob/c26ad23e9084c8f714d7d866d6e28e95bacb172b/src/REPLMode/argument_parsers.jl#L146

Not sure if it should

divbyzerofordummies commented 2 months ago

Does (test) pkg> dev ./.. work?

No, same error:

ERROR: `./..` appears to be a local path, but directory does not exist