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

Tracking Base is broken on master

Open Liozou opened this issue 2 years ago • 12 comments

Revise.track(Base) has stopped working on julia master: nothing errors but no modification of a file in julia/base is taken into account either. Also, doing test-revise-* displays a lot of errors like the following:

┌ Error: unable to find path containing source for Downloads, tracking is not possible
└ @ Revise ~/.julia/packages/Revise/VskYC/src/recipes.jl:54
┌ Error: unable to find path containing source for Unicode, tracking is not possible
└ @ Revise ~/.julia/packages/Revise/VskYC/src/recipes.jl:54
...
┌ Warning: /home/liozou/julia-10/usr/share/julia/src/usr/share/julia/stdlib/v1.9/Downloads/src is not an existing directory, Revise is not watching
└ @ Revise /home/liozou/.julia/packages/Revise/VskYC/src/packagedef.jl:566
┌ Warning: /home/liozou/julia-10/usr/share/julia/src/usr/share/julia/stdlib/v1.9/Downloads/src/Curl is not an existing directory, Revise is not watching
└ @ Revise /home/liozou/.julia/packages/Revise/VskYC/src/packagedef.jl:566
┌ Warning: /home/liozou/julia-10/usr/share/julia/src/usr/share/julia/stdlib/v1.9/Unicode/src is not an existing directory, Revise is not watching
└ @ Revise /home/liozou/.julia/packages/Revise/VskYC/src/packagedef.jl:566
...

etc., for all the stdlibs I guess.

I bisected this to https://github.com/JuliaLang/julia/pull/45441 @vtjnash but given the size of the commit, I couldn't delve further in. I also don't know whether the fix should be done upstream or directly in Revise.jl so I'm opening the issue here.

EDIT: my versioninfo:

julia> versioninfo()
Julia Version 1.9.0-DEV.unknown
Commit f0b1c5f (2022-06-09 20:04 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 40 × Intel(R) Xeon(R) Silver 4210R CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, cascadelake)
  Threads: 1 on 40 virtual cores

Liozou avatar Jun 23 '22 15:06 Liozou

Note: in the warnings, the path indeed does not exist, there is one "/src/usr/share/julia" too many. The actual path is "~/julia-10/usr/share/julia/stdlib/..." where "julia-10" is the name of the root julia folder

Liozou avatar Jun 23 '22 16:06 Liozou

If this is related to https://github.com/timholy/Revise.jl/issues/691, then the fix belongs here.

LilithHafner avatar Jul 13 '22 14:07 LilithHafner

Is there a workaround or anything for this? It's having a significant impact on my workflow.

I think it might also apply to make -C doc revise=true

LilithHafner avatar Jul 19 '22 22:07 LilithHafner

At the moment I do includet(Base, "~/julia/base/whatever.jl" to circumvent the issue, it usually works fine but I think it caused me some trouble over conflicting const definitions in one of the files, I don't remember which. So it's a stopgap measure really.

Liozou avatar Jul 20 '22 08:07 Liozou

I can repro the stdlib issue, but Base itself is correctly tracked for me.

Should be fixed by #694.

pfitzseb avatar Jul 20 '22 08:07 pfitzseb

I tried with https://github.com/timholy/Revise.jl/pull/694, which makes it so that the files in julia/usr/share/julia/src/base/ are correctly tracked and make test-revise-... works, thanks a lot!

However, the files directly in julia/base are still not tracked. I suppose that's inevitable because the two sets of files are not linked and Revise has to choose one of the two sets to track, it would not make sense to track both if there were conflicting definitions. But as a consequence, I have to modify the files in julia/usr/share/julia/src/base/ when working, and then copy them to julia/base before committing, which is annoying.

Note: the fact that the two sets of file are not linked is because this line uses cp instead of ln I believe. Anyone knows why?

Liozou avatar Jul 20 '22 16:07 Liozou

Yup. That's also the behvaiour described here.

@vtjnash Thoughts on symlinking julia/base into julia/usr/share/julia/src/base instead? The obvious downside of that is that these builds wouldn't be relocatable, but I feel like that was the case before https://github.com/JuliaLang/julia/pull/45441 too.

pfitzseb avatar Jul 20 '22 16:07 pfitzseb

I thought I tried it, and it was broken in Revise, so I figured it was okay initially that it was tracking julia/usr/share/julia/src/base instead, and that Revise could eventually be updated to look at the development folder instead when applicable

vtjnash avatar Jul 20 '22 18:07 vtjnash

That's easy enough, but then you can't initially @edit a function (because that takes you to the files in use/share).

pfitzseb avatar Jul 20 '22 19:07 pfitzseb

I thought Revise already rewrites locations, for things like @edit?

vtjnash avatar Jul 20 '22 19:07 vtjnash

Revise would need to fix .file for all methods on load then, no? That doesn't seem like a good idea.

pfitzseb avatar Jul 20 '22 21:07 pfitzseb

On my computer, ~/julia/usr/share/julia/stdlib/v1.9 is filled with links to the contents of ~/julia/stdlib so I don't know if the builds are currently relocatable anyway. ~/julia/usr/share/julia/test is also a link to ~/julia/test. So julia/usr/share/julia/src/base not being a link looks more like the exception.

Liozou avatar Jul 24 '22 17:07 Liozou

I think this has been fixed on recently nightly

timholy avatar Sep 14 '22 20:09 timholy