Hi there
I have just tried to install Revise and the usage example given in Home · Revise.jl does not seem to work as expected. I was wondering if someone could point out what I am doing wrong?
The full list of what I am doing is given below, but basically I install Revise, install Example, type “using Revise”, “using Example” and call the function in Example to print “hello, world” to the screen. Then I modify the code in Example.jl so that the message begins with “hi” instead of “hello”, call the function again, but still get the same result. So Revise doesn’t seem to have realised that I have modified the file.
Have I missed some step in installing or using Revise?
Sometimes I have the problem that Revise does not keep up with the updates I do in the code, so I made an habit always call revise(); method_I_just_changed(), can you check if this works for you?
If I type “test Revise” in the pkg Repl mode I find that 5 tests failed. Is this normal or expected? Maybe version 2.7.3 of Revise is not fully compatible with version 1.4.2 of Julia?
I am using version 2.7.3 of Revise and 1.4.2 of Julia, and my output is considerably different:
Testing Revise
Status `/tmp/jl_LpfS90/Manifest.toml`
[aafaddc9] CatIndices v0.2.1
[da1fd8a2] CodeTracking v0.5.11
[dc8bdbbb] CustomUnitRanges v1.0.0
[340492b5] EndpointRanges v0.2.0
[97e2ac4a] EponymTuples v0.2.2
[7876af07] Example v0.5.3
[9b13fd28] IndirectArrays v0.5.1
[aa1ae85d] JuliaInterpreter v0.7.24
[6f1432cf] LoweredCodeUtils v0.4.6
[dbb5928d] MappedArrays v0.2.2
[6fe1bfb0] OffsetArrays v1.1.2
[bac558e1] OrderedCollections v1.3.0
[ae029012] Requires v1.0.1
[295af30f] Revise v2.7.3
[d5f540fe] RoundingIntegers v0.2.0
[2a0f44e3] Base64
[ade2ca70] Dates
[8ba89e20] Distributed
[7b1f6079] FileWatching
[b77e0a4c] InteractiveUtils
[76f85450] LibGit2
[8f399da3] Libdl
[56ddb016] Logging
[d6f4376e] Markdown
[44cfe95a] Pkg
[de0858da] Printf
[3fa0cd96] REPL
[9a3f8284] Random
[ea8e919c] SHA
[9e88b42a] Serialization
[6462fe0b] Sockets
[8dfed614] Test
[cf7118a7] UUIDs
[4ec0a83e] Unicode
Skipping Base.active_repl
Skipping Base.active_repl_backend
Revise is currently tracking the following files in ReviseFileNow [top-level]: ["src/ReviseFileNow.jl"]
[ Info: tracking Base
┌ Warning: skipping git tests because Revise is not under development
└ @ Main ~/.julia/packages/Revise/BqeJF/test/runtests.jl:2383
extra
[ Info: tracking Pkg
┌ Warning: skipping Core.Compiler tests due to lack of git repo
└ @ Main ~/.julia/packages/Revise/BqeJF/test/runtests.jl:2491
┌ Warning: REPL tests skipped
└ @ Main ~/.julia/packages/Revise/BqeJF/test/runtests.jl:2534
Test Summary: | Pass Broken Total
Revise | 644 1 645
Test Summary: | Pass Total
Utilities | 3 3
Generating project A2D:
A2D/Project.toml
A2D/src/A2D.jl
Path `/tmp/jl_MNrVKM/A2D` exists and looks like the correct package. Using existing path.
Resolving package versions...
Cloning default registries into `/tmp/jl_MNrVKM`
Updating `/tmp/jl_MNrVKM/environments/v1.4/Project.toml`
[155aef8e] + A2D v0.1.0 [`/tmp/jl_MNrVKM/A2D`]
Updating `/tmp/jl_MNrVKM/environments/v1.4/Manifest.toml`
[155aef8e] + A2D v0.1.0 [`/tmp/jl_MNrVKM/A2D`]
Path `/tmp/jl_MNrVKM/dev/A2D` exists and looks like the correct package. Using existing path.
Resolving package versions...
Cloning default registries into `/tmp/jl_MNrVKM`
Updating `/tmp/jl_MNrVKM/environments/v1.4/Project.toml`
[155aef8e] ~ A2D v0.1.0 [`/tmp/jl_MNrVKM/A2D`] ⇒ v0.1.0 [`/tmp/jl_MNrVKM/dev/A2D`]
Updating `/tmp/jl_MNrVKM/environments/v1.4/Manifest.toml`
[155aef8e] ~ A2D v0.1.0 [`/tmp/jl_MNrVKM/A2D`] ⇒ v0.1.0 [`/tmp/jl_MNrVKM/dev/A2D`]
Path `/tmp/jl_MNrVKM/A2D` exists and looks like the correct package. Using existing path.
Resolving package versions...
Cloning default registries into `/tmp/jl_MNrVKM`
Updating `/tmp/jl_MNrVKM/environments/v1.4/Project.toml`
[155aef8e] ~ A2D v0.1.0 [`/tmp/jl_MNrVKM/dev/A2D`] ⇒ v0.1.0 [`/tmp/jl_MNrVKM/A2D`]
Updating `/tmp/jl_MNrVKM/environments/v1.4/Manifest.toml`
[155aef8e] ~ A2D v0.1.0 [`/tmp/jl_MNrVKM/dev/A2D`] ⇒ v0.1.0 [`/tmp/jl_MNrVKM/A2D`]
Test Summary: | Pass Total
Switching free/dev | 125 125
Generating project DepPkg371:
DepPkg371/Project.toml
DepPkg371/src/DepPkg371.jl
[ Info: A warning about not having OrderedCollection in dependencies is expected
┌ Warning: Package DepPkg371 does not have OrderedCollections in its dependencies:
│ - If you have DepPkg371 checked out for development and have
│ added OrderedCollections as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with DepPkg371
└ Loading OrderedCollections into DepPkg371 from project dependency, future warnings for DepPkg371 are suppressed.
Test Summary: | Pass Total
Broken dependencies (issue #371) | 2 2
Test Summary: | Pass Total
Non-jl include_dependency (issue #388) | 4 4
┌ Warning: /tmp/3dp4sGMhsb/DeletedFile/src/g.jl no longer exists, deleting all methods
└ @ Revise ~/.julia/packages/Revise/BqeJF/src/Revise.jl:713
Test Summary: | Pass Total
New files & Requires.jl | 34 34
Test Summary: | Pass Total
entr | 16 16
Test Summary: | Pass Total
entr with modules | 1 1
Test Summary: | Pass Total
entr with all files | 4 4
Test Summary: | Pass Total
callbacks | 4 4
beginning cleanup
Test Summary: | Pass Total
Cleanup | 1 1
Test Summary: | Pass Total
Backedges | 9 9
beginning signatures tests
27.415769 seconds (56.22 M allocations: 1.935 GiB, 2.36% gc time)
Test Summary: | Pass Total
Base signatures | 2 2
Testing Revise tests passed
Now that is interesting. I wonder why the test results are different when we are both using the same versions?
The 5 tests that fail for me are detailed below, but looking at the runtests.jl file unfortunately didn’t bring any enlightenment as to what the failures actually are or how significant they are, or what caused them.
Comparison and line numbering: Test Failed at /tcenas/home/anderson/.julia/packages/Revise/BqeJF/test/runtests.jl:332
Comparison and line numbering: Test Failed at /tcenas/home/anderson/.julia/packages/Revise/BqeJF/test/runtests.jl:340
Base & stdlib file paths: Test Failed at /tcenas/home/anderson/.julia/packages/Revise/BqeJF/test/runtests.jl:745
Line numbers in backtraces and warnings: Test Failed at /tcenas/home/anderson/.julia/packages/Revise/BqeJF/test/runtests.jl:1336
Line numbers in backtraces and warnings: Test Failed at /tcenas/home/anderson/.julia/packages/Revise/BqeJF/test/runtests.jl:1360
I give up on Revise and put this function into my code:
function restart()
atexit() do
run(`$(Base.julia_cmd())`)
end
exit()
end
then I just call the function and julia automatically exits and restarts then when I run my Julia program again it picks up any changes that have been made to modules.
Not elegant, but the best solution I can find.
( the ‘restart’ function originally by fredrikekre, thanks!)