Revise.jl doesn't appear to do anything

I tried in a new package, and nothing appears to happen there either.

Okay, starting entirely from scratch, here is a full log that fails:

alice@magatoroido ~ % julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

(@v1.5) pkg> generate TestPkg
 Generating  project TestPkg:
    TestPkg/Project.toml
    TestPkg/src/TestPkg.jl

(@v1.5) pkg> 
alice@magatoroido ~ % cd TestPkg
alice@magatoroido TestPkg % tree            
.
├── Project.toml
└── src
    └── TestPkg.jl

1 directory, 2 files
alice@magatoroido TestPkg % julia --project 
┌ Warning: no Manifest.toml file found, static paths used
└ @ Revise ~/.julia/packages/Revise/lwch5/src/Revise.jl:866
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> println(read("src/TestPkg.jl", String))
module TestPkg

greet() = print("Hello World!")

end # module


julia> using Revise

julia> using TestPkg
[ Info: Precompiling TestPkg [39da3a16-183b-40c1-a219-f5fee491b8e0]

julia> TestPkg.greet()
Hello World!

Now I modify the file. Back to the same terminal:

julia> println(read("src/TestPkg.jl", String))
module TestPkg

greet() = print("Hello World!")

function foo()
  println("In foo")
end

end # module


julia> TestPkg.foo()
ERROR: UndefVarError: foo not defined
Stacktrace:
 [1] top-level scope at REPL[6]:1
 [2] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.3/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288

julia> 
alice@magatoroido TestPkg % julia --project 
┌ Warning: no Manifest.toml file found, static paths used
└ @ Revise ~/.julia/packages/Revise/lwch5/src/Revise.jl:866
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

julia> using TestPkg
[ Info: Precompiling TestPkg [39da3a16-183b-40c1-a219-f5fee491b8e0]

julia> TestPkg.foo()
In foo

I have found some information on debugging Revise. Will be back with more info in a bit…

Thanks a ton for this.

I did the exact same process and it’s working for me.

 ~/Documents/Projects/test/VoronoiCLR  julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
 ~/Documents/Projects/test  julia -q
(@v1.5) pkg> generate TestPkg
 Generating  project TestPkg:
    TestPkg/Project.toml
    TestPkg/src/TestPkg.jl

julia> 
 ~/Documents/Projects/test  cd TestPkg
 ~/Documents/Projects/test/TestPkg  julia --project -q

julia> using Revise;
┌ Warning: no Manifest.toml file found, static paths used
└ @ Revise ~/.julia/packages/Revise/moD4B/src/packagedef.jl:1361

julia> using TestPkg
[ Info: Precompiling TestPkg [f1e03898-1ba8-48c0-9610-f60f1b9612ad]

julia> TestPkg.foo()
ERROR: UndefVarError: foo not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./Base.jl:26
 [2] top-level scope at REPL[3]:1

shell> subl .

julia> println(read("src/TestPkg.jl", String))
module TestPkg

greet() = print("Hello World!")

end # module


julia> println(read("src/TestPkg.jl", String))
module TestPkg

greet() = print("Hello World!")

function foo()
	println("In foo.")
end

end # module


julia> TestPkg.foo()
In foo.

Okay, more info, from this part of the doc, I tried to run the tests.

Try running test Revise from the Pkg REPL-mode. If tests pass, check the documentation to make sure you understand how Revise should work. If they fail (especially if it mirrors functionality that you need and isn’t working), see Debugging problems with paths for one set of suggestions.

Running the tests as suggested results in lots of errors:

click to see output

Do you see anything in these logs that reveal the issue? The above is with Revise v1.0.3 and julia version 1.5.3 on Linux.

The most current version is 3.1.11. Is there a reason you are using an old version of Revise?

3 Likes

As mentioned above, you should update Revise. You have an old version.

That sounds like it would explain it, but I’m still not sure how I ended up with an old version.

I tried to update it, but I have now ended up with the version v2.7.6. How do I get it to update to the latest one?

(@v1.5) pkg> update Revise
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Installed LoweredCodeUtils ── v0.4.9
  Installed CodeTracking ────── v0.5.12
  Installed Tokenize ────────── v0.5.12
  Installed StructTypes ─────── v1.2.3
  Installed WebSockets ──────── v1.5.9
  Installed Revise ──────────── v2.7.6
  Installed CategoricalArrays ─ v0.9.2
Updating `~/.julia/environments/v1.5/Project.toml`
  [295af30f] ↑ Revise v1.0.3 ⇒ v2.7.6
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [324d7699] ↑ CategoricalArrays v0.9.0 ⇒ v0.9.2
  [da1fd8a2] ↓ CodeTracking v1.0.5 ⇒ v0.5.12
  [9a962f9c] ↑ DataAPI v1.4.0 ⇒ v1.5.1
  [31c24e10] ↑ Distributions v0.24.10 ⇒ v0.24.12
  [1a297f60] ↑ FillArrays v0.10.2 ⇒ v0.11.1
  [f6369f11] ↑ ForwardDiff v0.10.14 ⇒ v0.10.16
  [6f1432cf] + LoweredCodeUtils v0.4.9
  [e1d29d7a] ↑ Missings v0.4.4 ⇒ v0.4.5
  [d8a4904e] ↑ MutableArithmetics v0.2.13 ⇒ v0.2.14
  [bac558e1] ↑ OrderedCollections v1.3.2 ⇒ v1.3.3
  [295af30f] ↑ Revise v1.0.3 ⇒ v2.7.6
  [3eaba693] ↑ StatsModels v0.6.18 ⇒ v0.6.21
  [856f2bd8] ↑ StructTypes v1.2.1 ⇒ v1.2.3
  [0796e94c] ↑ Tokenize v0.5.8 ⇒ v0.5.12
  [104b5d7c] ↑ WebSockets v1.5.7 ⇒ v1.5.9

There is some package holding back updating of Revise.

This is a main reason why it’s important to use local environments for everything. Too many packages in your main environment and it becomes difficult to keep the packages you “really need” up to date.

Try ] add Revise@3.1.11 and take a look at that error. If it’s being prevented from updating by some package you don’t need in your global environment, rm that package.

2 Likes

Amazing, it works.

I got this output when updating:

(@v1.5) pkg> add Revise@3.1.11
  Resolving package versions...
  Installed Juno ───────────── v0.8.4
  Installed BinDeps ────────── v1.0.2
  Installed Atom ───────────── v0.12.30
  Installed StaticArrays ───── v0.12.5
  Installed JuMP ───────────── v0.21.6
  Installed DataFrames ─────── v0.22.5
  Installed PooledArrays ───── v1.1.0
  Installed Documenter ─────── v0.26.1
  Installed JuliaFormatter ─── v0.12.3
  Installed SpecialFunctions ─ v0.8.0
  Installed CSV ────────────── v0.8.3
  Installed PrettyTables ───── v0.11.0
  Installed FuzzyCompletions ─ v0.4.0
Updating `~/.julia/environments/v1.5/Project.toml`
  [c52e3926] ↑ Atom v0.12.21 ⇒ v0.12.30
  [336ed68f] ↑ CSV v0.8.2 ⇒ v0.8.3
  [a93c6f00] ↑ DataFrames v0.22.2 ⇒ v0.22.5
  [864edb3b] ↑ DataStructures v0.18.8 ⇒ v0.18.9
  [2e9cd046] ↑ Gurobi v0.9.6 ⇒ v0.9.8
  [4076af6c] ↑ JuMP v0.21.5 ⇒ v0.21.6
  [e5e0dc1b] ↑ Juno v0.8.3 ⇒ v0.8.4
  [295af30f] ↑ Revise v2.7.6 ⇒ v3.1.11
  [90137ffa] ↑ StaticArrays v0.12.4 ⇒ v0.12.5
  [bd369af6] ↑ Tables v1.2.2 ⇒ v1.3.2
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [c52e3926] ↑ Atom v0.12.21 ⇒ v0.12.30
  [9e28174c] + BinDeps v1.0.2
  [336ed68f] ↑ CSV v0.8.2 ⇒ v0.8.3
  [da1fd8a2] ↑ CodeTracking v0.5.12 ⇒ v1.0.5
  [e66e0078] - CompilerSupportLibraries_jll v0.3.4+0
  [a93c6f00] ↑ DataFrames v0.22.2 ⇒ v0.22.5
  [864edb3b] ↑ DataStructures v0.18.8 ⇒ v0.18.9
  [e30172f5] ↑ Documenter v0.25.5 ⇒ v0.26.1
  [fb4132e2] ↑ FuzzyCompletions v0.2.6 ⇒ v0.4.0
  [2e9cd046] ↑ Gurobi v0.9.6 ⇒ v0.9.8
  [cd3eb016] ↑ HTTP v0.8.19 ⇒ v0.9.2
  [4076af6c] ↑ JuMP v0.21.5 ⇒ v0.21.6
  [98e50ef6] ↑ JuliaFormatter v0.7.6 ⇒ v0.12.3
  [aa1ae85d] ↑ JuliaInterpreter v0.7.26 ⇒ v0.8.8
  [e5e0dc1b] ↑ Juno v0.8.3 ⇒ v0.8.4
  [6f1432cf] ↑ LoweredCodeUtils v0.4.9 ⇒ v1.2.7
  [efe28fd5] - OpenSpecFun_jll v0.5.3+4
  [2dfb63ee] ↑ PooledArrays v0.5.3 ⇒ v1.1.0
  [08abe8d2] ↑ PrettyTables v0.10.1 ⇒ v0.11.0
  [295af30f] ↑ Revise v2.7.6 ⇒ v3.1.11
  [276daf66] ↓ SpecialFunctions v0.10.3 ⇒ v0.8.0
  [90137ffa] ↑ StaticArrays v0.12.4 ⇒ v0.12.5
  [bd369af6] ↑ Tables v1.2.2 ⇒ v1.3.2
  [5c2747f8] + URIs v1.2.0
   Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/ne2iw/deps/build.log`

Most likely one of your dependencies in your global environment is blocking Revise from being updated. There are two approaches you can take to resolve. You can run add Revise @v3.1.11 and systematically remove blocking dependencies, as pdeffebach recommended. This problem will recur periodically. The second approach is to rely on project specific environments, and use your global environment for a few key packages, like Revise. In my experience, the later works better because it avoids version conflicts and gives you more version control and reproducibility for your individual projects.

2 Likes

It didn’t seem to report an error when I updated it, but it did update a bunch of other stuff.

Anyway, thanks everyone. Now I know where to look for this kind of issue in the future.

2 Likes

P.S.: You can dev a local package by doing dev /path/to/VCLR.

What does it actually do?

When you do using MyPkg, Julia looks in a select number of folders for code that contains MyPkg.

dev /path/to/VCLR will add that path to that list of folders. It also takes care of some dependency management, so you don’t have to use instantiate to get set up.

It doesn’t really sound immediately useful to me…

It’s useful if you want other things to depend on your package.

If you want to create a Voronoi diagram in another project in a separate environment, using dev will allow you to use VCLR as a dependency.

This is partly what I was saying above about how it’s odd you have VoronoiCLR and a bunch of sub-folders. Are you sure that the subfolders VCLR, CLR etc. shouldn’t be in their own folders? Then using them inside VoronoiCLR, itself a separate folder? Where you dev all the modules you made inside the VoronoiCLR environment.

1 Like

Well, the shared folder contains a bunch of things, but one of them is a branch-and-bound algorithm. The CLR and VCLR folders are two separate implementations of what happens in each branch-and-bound node, which I swap out by using abstract types.

Maybe you can have a CLRBase package which contains the overlap between CLR and VCLR, then separate packages for CLR and VCLR which both depend on CLRBase? That would be the most common way of organizing things.