# Should I turn on/off repeatedly to reflect changes of currently developing packages?

**URL:** <https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560>\
**Category:** New to Julia\
**Tags:** package, revise\
**Created:** [September 30, 2020, 11:26pm UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560 "2020-09-30T23:26:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 30, 2020, 11:26pm UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/1 "2020-09-30T23:26:28Z")

</div>

Hi, I’m developing my own packages.

While developing my packages, I have to turn off Julia REPL and turn on again to reflect changes of the packages, which takes too long time.

As in [docs of Revise.jl](https://timholy.github.io/Revise.jl/stable/), it looks that I have to change a package to be dev mode to make Revise.jl works automatically (without turn off/on REPL).  
However, I don’t know how to change my currently developing package to be `dev`.  
Instead of it, manually adding files like `using Revise; includet("my_file.jl")` works to me but it seems not for package development.

So what I need is:  
Is there any way to reflect changes of my own package (can be unregistered) without turn off and on REPL?

EDIT: should my package be in `~/.julia/dev`?

---

<div class="post-metadata">

**Author:** ![lhnguyen-vn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lhnguyen-vn/32/15449_2.png) [@lhnguyen-vn](https://discourse.julialang.org/u/lhnguyen-vn)\
**Post date:** [September 30, 2020, 11:48pm UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/2 "2020-09-30T23:48:38Z")

</div>

Your package does not need to be in `~/.julia/dev`. Simple enter the path to your local package in the REPL’s `Pkg` mode: `]dev ~/path/to/your/package`.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [September 30, 2020, 11:53pm UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/3 "2020-09-30T23:53:31Z")

</div>

1. when activated at the project (seems an incorrect way to enter dev mode)

```julia
(FymEnvs) pkg> dev .
[ Info: Resolving package identifier `.` as a directory at `~/github/julia/FymEnvs`.
Path `.` exists and looks like the correct package. Using existing path.
ERROR: package `FymEnvs [d6fd7ba0]` has the same name or UUID as the active project

```

1. at default env

```julia
(@v1.5) pkg> dev .
[ Info: Resolving package identifier `.` as a directory at `~/github/julia/FymEnvs`.
Path `.` exists and looks like the correct package. Using existing path.
  Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
  [d6fd7ba0] ~ FymEnvs v0.1.0 `~/.julia/dev/FymEnvs` ⇒ v0.1.0 `../../../github/julia/FymEnvs`
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [d6fd7ba0] ~ FymEnvs v0.1.0 `~/.julia/dev/FymEnvs` ⇒ v0.1.0 `../../../github/julia/FymEnvs`

```

and running codes with changes at both the project and default envs seems not reflect the changes.

---

<div class="post-metadata">

**Author:** ![lhnguyen-vn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lhnguyen-vn/32/15449_2.png) [@lhnguyen-vn](https://discourse.julialang.org/u/lhnguyen-vn)\
**Post date:** [October 1, 2020, 12:15am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/4 "2020-10-01T00:15:13Z")

</div>

Loading Revise and `FymEnvs` after `dev`ing the package should work. Note that now `Pkg` Is tracking the path `../../../github/julia/FymEnvs`, so make sure you’re editing the right code files.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 12:21am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/5 "2020-10-01T00:21:27Z")

</div>

1. A part of source code

```julia
function reset!(clock::Clock)
    error("test") # to check Revise.jl
    clock.t = 0.0
    return clock
end

```

1. `reset!` gives an error

```julia
julia> using FymEnvs
[Info: Precompiling FymEnvs [d6fd7ba0-2ca9-4676-ba23-5bed9e863cfb]
using
julia> clock = Clock(0.01, 1)
Clock(0.0, 0.01, 10.0, 1001, [0.0, 0.01], 1)

julia> reset!(clock)
ERROR: test
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] reset!(::Clock) at /home/jinrae/github/julia/FymEnvs/src/FymCore.jl:58
 [3] top-level scope at REPL[3]:1

```

1. `dev` and `using Revise; using FymEnvs`

```julia
(@v1.5) pkg> dev .
[ Info: Resolving package identifier `.` as a directory at `~/github/julia/FymEnvs`.
Path `.` exists and looks like the correct package. Using existing path.
  Resolving package versions...
No Changes to `~/.julia/environments/v1.5/Project.toml`
No Changes to `~/.julia/environments/v1.5/Manifest.toml`

julia> using Revise

julia> using FymEnvs

julia> clock = Clock(0.01, 1)
Clock(2.0e-323, 0.01, 10.0, 1001, [0.0, 0.01], 1)

julia> reset!(clock)
ERROR: test
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] reset!(::Clock) at /home/jinrae/github/julia/FymEnvs/src/FymCore.jl:58
 [3] top-level scope at REPL[5]:1

julia> reset!(clock) # error msg removed in script
ERROR: test
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] reset!(::Clock) at /home/jinrae/github/julia/FymEnvs/src/FymCore.jl:58
 [3] top-level scope at REPL[5]:1

```

Still does not work for me.

Note: of course it works after turning off/on REPL with changes.

```julia
julia> using FymEnvs
[Info: Precompiling FymEnvs [d6fd7ba0-2ca9-4676-ba23-5bed9e863cfb]

julia> clock = Clock(0.01, 1)
Clock(3.0e-323, 0.01, 10.0, 1001, [0.0, 0.01], 1)

julia> reset!(clock)
Clock(0.0, 0.01, 10.0, 1001, [0.0, 0.01], 1)

```

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [October 1, 2020, 12:48am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/6 "2020-10-01T00:48:54Z")

</div>

You have to say `using Revise` before you say `using FymEnvs`. Is that what you’re doing?

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 12:50am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/7 "2020-10-01T00:50:35Z")

</div>

Sure.  
Please see [3. of this](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/5).

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [October 1, 2020, 1:00am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/8 "2020-10-01T01:00:18Z")

</div>

> [@iHany](#):
>
> Please see [3. of this](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/5).

Sorry about that, I jumped the gun.

> [@lhnguyen-vn](#):
>
> Note that now `Pkg` Is tracking the path `../../../github/julia/FymEnvs` , so make sure you’re editing the right code files.

This also smells to me like a path issue. When you dev a package (by name at least, I don’t know about by path) it is copied to `julia/dev`. Can you see if the directory you’re in has a new `/dev` folder in it? Or maybe one level up? Or maybe if indeed `julia/dev` contains a copy of `FymEnvs`?

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:06am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/9 "2020-10-01T01:06:35Z")

</div>

My current `~/.julia/dev` is empty.  
It should be contain a copy of `FymEnvs`? If so, it seems that `dev` command was not properly worked.

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [October 1, 2020, 1:10am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/10 "2020-10-01T01:10:28Z")

</div>

What about `~/github/julia/` and `~/github/julia/FymEnvs`? Do they have a `/dev` folder in them?

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:11am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/11 "2020-10-01T01:11:34Z")

</div>

Umm…  
It seems to me that no directory has `/dev` directory…

Having considered the case of registered packages, it definitely looks weird, isn’t it?

---

<div class="post-metadata">

**Author:** ![lhnguyen-vn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lhnguyen-vn/32/15449_2.png) [@lhnguyen-vn](https://discourse.julialang.org/u/lhnguyen-vn)\
**Post date:** [October 1, 2020, 1:14am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/12 "2020-10-01T01:14:52Z")

</div>

It’s normal for `Pkg` to directly track file path to local packages instead of cloning them into `dev`. Could you perhaps use `@edit reset!(clock)` after removing the error line to verify that the correct file is being updated?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [October 1, 2020, 1:20am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/13 "2020-10-01T01:20:07Z")

</div>

Are you on Windows with WSL2 by any chance? There’s an issue with FileWatching in that setup which means Revise doesn’t work (unless you change an environmental variable): [https://github.com/timholy/Revise.jl/issues/514](https://github.com/timholy/Revise.jl/issues/514)

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:21am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/14 "2020-10-01T01:21:51Z")

</div>

`@edit` shows that the script has correctly been changed, right?

```julia
julia> using Revise

julia> using FymEnvs
[Info: Precompiling FymEnvs [d6fd7ba0-2ca9-4676-ba23-5bed9e863cfb]

julia> clock = Clock(0.01, 1)
Clock(2.2e-322, 0.01, 10.0, 1001, [0.0, 0.01], 1)

julia> reset!(clock)
ERROR: test
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] reset!(::Clock) at /home/jinrae/github/julia/FymEnvs/src/FymCore.jl:58
 [3] top-level scope at REPL[6]:1

julia> @edit reset!(clock) # file updated

julia> reset!(clock)
ERROR: test
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] reset!(::Clock) at /home/jinrae/github/julia/FymEnvs/src/FymCore.jl:58
 [3] top-level scope at REPL[8]:1

```

- Update checked using `@edit`:

```julia
function reset!(clock::Clock)
    # error("test")
    clock.t = 0.0
    return clock
end

```

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:23am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/15 "2020-10-01T01:23:25Z")

</div>

I’m running codes on Ubuntu 18.04 😓 Does it also have a potential issue that you mentioned?

EDIT: `includet` command works well, so the problem occurs when tyring to revise a local package. Can it be related to that as well?  
EDIT2: there’s a peculiar thing in my routine: I’m writing codes on my Mac and sending them to server using `rsync`. I found that some rsync options prevent immediate update of scripts in Revise but Revise.jl does not reflect changes at all after a while in this case.  
EDIT3: I suspect that the reason might be `rsync`, but directly correcting codes on Ubuntu server does not work as well ☹

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [October 1, 2020, 1:29am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/16 "2020-10-01T01:29:02Z")

</div>

No, that should be fine, it is probably a different issue then. You could try setting the environmental variable anyway though to see it helps.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:32am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/17 "2020-10-01T01:32:19Z")

</div>

I didn’t get it.  
Can you explain what it means?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [October 1, 2020, 1:41am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/18 "2020-10-01T01:41:16Z")

</div>

It’s described here: [Configuration · Revise.jl](https://timholy.github.io/Revise.jl/stable/config/#Polling-and-NFS-mounted-code-directories:-JULIA_REVISE_POLL-1), if you start Julia with

```julia
JULIA_REVISE_POLL=1 julia 

```

Then Revise will check every few seconds to see if the files have updated instead of waiting for a notification that they’ve been updated. So if there’s an issue with those notifications then it could help.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 1:43am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/19 "2020-10-01T01:43:55Z")

</div>

Gosh, it doesn’t work as well.  
There might be an error while compiling/installing Revise.  
I’ll this those things after reinstalling Revise.jl.

EDIT: nothing works for me…  
What’s wrong with my Revise.jl? 😢  
I don’t want spend times to turn off and on REPL everytime. So sad.

---

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [October 1, 2020, 2:00am UTC](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560/20 "2020-10-01T02:00:05Z")

</div>

@ericphanson  
@lhnguyen-vn  
@tomerarnon  
Guys, I thought there might be an error in my Ubuntu server so I tested above things again on my local Mac.  
And it works very well.  
One thing different from the case of Ubuntu was that the response of executing command `dev` looks different. So I suspect that there’s something wrong in my server, and I will reinstall julia and try again.

Thanks you all 🙂

EDIT: Everyone uses Revise correctly and doesn’t need to turn off and on REPL repeatedly. Feels like being an idiot. Unfair 😁

[Next page](https://discourse.julialang.org/t/should-i-turn-on-off-repeatedly-to-reflect-changes-of-currently-developing-packages/47560.md?page=2)
