Strange behavior (Revise and other stuff)

Hi, folks.
I use Revise all the time while using Julia, as I often modify the code I’m running.
Sometimes (and I’m not sure how to repeat this), Revise throws a bunch of errors and becomes yellow, as if I made big modifications to the code, even if I haven’t made any changes at all.
When this happens, sometimes I have to type something twice on the REPL for it to do something. The first (or even second) time I hit enter, the REPL reruns the previous command.
This has been happening for a while and I’m not sure why.
Today it went too far, though: I’m getting this odd REPL behavior without any errors from Revise, so now I’m not even sure it comes from it (though Revise is running).
Has anyone encountered this? Sorry, I know my description is not great or reproducible, but that’s part of the problem.
I also have an issue sometimes with packages failing to precompile (with the using command) while Revise is on (using Revise, Pkg; Pkg.activate("MyModule"). I often have to reboot Julia and load all the modules I want prior to activating the module.
I might be posting 3 separate issues here. Not sure if they are related at all.
Thanks a lot!

Part of what your are describing seems to be the same as this Issue
See also issue 647 of Revise. I think Tim gas fixed this. A future release of Revise should hopefully get rid of this problem. Bur you seem to experience additional issues for which I have no remedies.

Thank you. Is there a way for me to load a package with Revise on (again, I’m doing using Revise, Pkg; Pkg.activate("MyModule")) without it updating my Manifest? I’m loading the package to run some stuff, not loading it “into” my module.
Thanks again!

As far as I know, this code should not update the Manifest at all.
Does this produce an error for you every time?

No, I mean this is how I’m starting up.

using Revise, Pkg; Pkg.activate("MyModule") ); using MyModule;
using OtherModule

Loading another module while working on my module is sometimes giving me issues. Is this the right way to do it?

I think this is perfectly fine. The Manifest is updated if you do Pkg operations such as Pkg.update()

1 Like

This should be fixed by Revise 3.1.20. Explanation: if you had already loaded MyModule or some of its dependencies, then changed something about your environment (e.g., a Pkg.update, Pkg.develop, etc), Revise tries to incorporate any changes. Sometimes errors can be thrown if the code changes in ways that Revise can’t handle (e.g., type-changes). However, it also turned out that there was a missed opportunity to find the “right” code, and it was throwing errors due to some cache being updated “behind it’s back” (which has been exacerbated by the lovely new parallel precompilation in Julia 1.6, though it isn’t actually the source of the issue). The new version of Revise tries harder to find a reference source for the original code, and should succeed in most cases. Hopefully it will show fewer errors when you update packages.

2 Likes

Thank you. I’ll try it out!