Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise stops working when using modules that are not listed as dependencies #371

Closed
mattuntergassmair opened this issue Oct 8, 2019 · 5 comments · Fixed by #385
Closed

Comments

@mattuntergassmair
Copy link

Revise stops working if modules use a package that is not explicitly listed as a dependency in Project.toml.

Example (julia v1.1, started with julia --project from MyPackage folder):

module MyPackage

# this line breaks Revise!!
# ]add Colors solves the problem
using Colors

function foo()
    println("foo")
end

export foo

end # module

If Colors (or any other package) is not in the dependencies of MyPackage, then Revise stops working (silently, without raising an error or warning). Removing the line using Colors or adding it to the dependencies fixes the issue.

If it's not worth fixing, at least putting this information somewhere in the Docs would be very helpful.

@timholy
Copy link
Owner

timholy commented Oct 8, 2019

When you say "stops working" do you mean not for other packages loaded in the same session? Or just for MyPackage?

@mattuntergassmair
Copy link
Author

It seems to stop tracking any changes in the MyPackage module, for example changing the output of foo() in the minimal example above. So calling foo() again skips recompilation and runs the old version of the function. Not sure if it still tracks other packages.

@mattuntergassmair
Copy link
Author

mattuntergassmair commented Oct 8, 2019

Actually I ran a quick test using MyPackage and Example in the same REPL, it still tracks changes in Example. So seems to just affect MyPackage.

The behavior should be easy to reproduce by running julia --project in the following folder structure

└── MyPackage
    ├── Manifest.toml
    ├── Project.toml
    └── src
        └── MyPackage.jl

and the following Project file

name = "MyPackage"
uuid = "ab86047e-e606-11e9-020a-1d793344fa1e"
version = "0.1.0"

Running the following in the REPL does not track changes for me: using Revise -> using MyPackage -> foo() -> changes to foo() -> run foo() again

@korsbo
Copy link

korsbo commented Nov 5, 2019

Thanks for reporting this, simply knowing where my revision issues come from has made my life easier!

@goretkin
Copy link
Contributor

goretkin commented Nov 6, 2019

I don't think this is exactly the same symptom, but if on using/importing a package I get:

┌ Warning: Package Geometry does not have GeometryTypes in its dependencies:
│ - If you have Geometry checked out for development and have
│   added GeometryTypes 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 Geometry
└ Loading GeometryTypes into Geometry from project dependency, future warnings for Geometry are suppressed.

then Revise appears not to track that file. (doesn't show up in keys(Revise.watched_files)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants