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

Depends_on does not work with chained dependencies #27

Closed
cstjean opened this issue Nov 27, 2015 · 4 comments
Closed

Depends_on does not work with chained dependencies #27

cstjean opened this issue Nov 27, 2015 · 4 comments

Comments

@cstjean
Copy link

cstjean commented Nov 27, 2015

depends_on does not work at all for me, in fact, given

arequire("A")
arequire("B", depends_on=["A"])

The second line will disable any reloading for "A" because it calls arequire("A"; command=:on_depends), which sets files[".../A.jl"].should_reload to false here and that is a necessary condition for reloading.

In any case, I'm happy to rework the logic and fix it myself, I just want to make sure that I'm clear on the desired interface. If I have modules A, B, and C, B depending on A and C depending on B, I assume that I should write

arequire("A")
arequire("B", depends_on=["A"])
arequire("C", depends_on=["B"])

and modifying A will trigger updates to A, B and C. Is that correct?

@jdlangs
Copy link
Contributor

jdlangs commented Dec 17, 2015

I came here to post this same issue. I get the behavior I want regarding dependencies if I hard code should_reload to always be true. It's not clear to me why it should ever be false.

@malmaud
Copy link
Owner

malmaud commented Mar 22, 2016

I'm about to modernize this package to work with Julia .4, and in the process will fix this.

@malmaud
Copy link
Owner

malmaud commented Mar 22, 2016

I am sure at some point I had a reason for the should_reload mechanic, but whatever it was, it does seem erroneous now.

@malmaud
Copy link
Owner

malmaud commented Mar 23, 2016

Ah, I remember now. The situation should_reload=false is useful in is if you want a.jl to reload whenever b.jl changes, but b.jl is not a stand-alone file that could be included on its own (for example, it relies on some constants defined in a). It's a common situation in packages.

So if you both want a.jl to reload when b.jl changes, but also b.jl to reload whenever b.jl changes, the proper code is

arequire("b")
arequire("a", depens_on=["b"])

It was a bug that this wasn't working before, fixed now.

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

No branches or pull requests

3 participants