Revise.jl icon indicating copy to clipboard operation
Revise.jl copied to clipboard

`juliadir` is incorrectly inferred on nightly

Open jishnub opened this issue 2 years ago • 5 comments

On v1.8

julia> Sys.BINDIR
"/home/jishnu/packages/julias/julia-1.8/bin"

julia> Revise.juliadir
"/home/jishnu/packages/julias/julia-1.8/share/julia"

On v1.9

julia> Sys.BINDIR
"/home/jishnu/packages/julias/julia-latest/bin"

julia> Revise.juliadir
"/"

(@v1.9) pkg> st Revise
Status `~/.julia/environments/v1.9/Project.toml`
  [295af30f] Revise v3.3.3

This is certainly not the correct path, and seems to lead to issues in tracking files. Potentially related: #687 (although I'm not certain about this)

Edit: the path to Base seems to be ~/packages/julias/julia-latest/share/julia/src/base on v1.9 (note the extra /src after /share/julia, which seems to make this detection fail, as the upward search starts at /share/julia)

jishnub avatar Jul 01 '22 12:07 jishnub

Can't repro this on a recent build of 1.9.

pfitzseb avatar Jul 20 '22 08:07 pfitzseb

That's strange, what's your versioninfo? I still see this on a freshly downloaded binary. Are you perhaps building from source?

julia> Revise.juliadir
"/"

julia> versioninfo()
Julia Version 1.9.0-DEV.1013
Commit 8378d4cf96f (2022-07-20 02:54 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.5 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  LD_LIBRARY_PATH = :/usr/lib/x86_64-linux-gnu/gtk-3.0/modules
  JULIA_EDITOR = vim

(@v1.9) pkg> st Revise
Status `~/.julia/environments/v1.9/Project.toml`
  [295af30f] Revise v3.3.3

jishnub avatar Jul 20 '22 09:07 jishnub

I am, yes. Revise.juliadir is also subtly wrong for me, though.

julia> Revise.juliadir
"/home/pfitzseb/Documents/Git/julia/usr/share/julia/src"

julia> Revise.basebuilddir
"/home/pfitzseb/Documents/Git/julia/usr/share/julia/src"

julia> versioninfo()
Julia Version 1.9.0-DEV.1013
Commit 8378d4cf96* (2022-07-20 02:54 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.5 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = nvim

pfitzseb avatar Jul 20 '22 09:07 pfitzseb

Ok, that explains. The mechanism to detect juliadir is different in pre-built downloadable binaries from that for direct builds from the source. For binaries, Revise.basebuilddir points to a path in /cache, in which case Revise tries to detect juliadir in a hack-y way and fails.

julia> Revise.juliadir
"/"

julia> Revise.basebuilddir
"/cache/build/default-amdci4-0/julialang/julia-master/usr/share/julia/src"

On the other hand, if I build from source, I obtain

julia> Revise.basebuilddir
"/home/jishnu/julia/usr/share/julia/src"

julia> Revise.juliadir
"/home/jishnu/julia/usr/share/julia/src"

which seem correct.

jishnub avatar Jul 20 '22 09:07 jishnub

Nah, those are also wrong. Wanna give https://github.com/timholy/Revise.jl/pull/694 a go?

pfitzseb avatar Jul 20 '22 09:07 pfitzseb

I'm assuming this has been fixed now due to reverting the change that broke this.

timholy avatar Sep 14 '22 20:09 timholy