Revise not working in WSL2?

I have created a simple test project with the following structure:

.
├── Manifest.toml
├── Project.toml
├── main.jl
└── src
    └── TestRevise.jl

TestRevise.jl:

module TestRevise

export greet

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

end

main.jl:

using Revise
using TestRevise

greet()

I activate the Julia project and run the main.jl in the REPL:

julia --project=.
julia> include("main.jl")
Hello World!

Then I change greet as follows:

greet() = print("Hello!")

And run main again:

julia> include("main.jl")

However, it still outputs “Hello World!”, so Revise seems to be not working at all.

Why?

Hi!
Welcome to Julia discourse.

If I understand correctly TestRevise is a package.
Then the only thing you need to do is

julia --project=.
julia> includet("main.jl")
Hello World!

Note the t in includet. This is a Revise function for tracking simple files.
I think this should work. You should be able to modifiy TestRevise.jl and without calling again includet(“main.jl”) you should be able to see the modifications.

Best,
Olivier

Thank you for your reply. I tried this:

julia> using Revise

julia> includet("main.jl")
[ Info: Precompiling TestRevise [02a7098f-09b0-4b01-acae-27578462e065]
Hello World!

# Changing to `greet()` to output "Hello"
julia> includet("main.jl")

# --> does not output anything anymore

Calling via includet after editing greet() results in no output at all.

So you don’t need to call includet(“main.jl”) again.

You call it just once, you then you make your modifications to TestRevise and/or main.jl you can call those modifications from the repl.

In your example you would just do from Julia repl

julia --project=.
julia> includet("main.jl")
Hello World!
# You then modify TestRevise.jl by making the change greet() = print("Hello!")
julia> greet()
Hello!

This does not work either. But I think I have found the issue.

I am using WSL2 and a mounted Windows drive:

After setting

export JULIA_REVISE_POLL=1

in the ~/.bashrc it works.

1 Like

ok, good you found the real issue!