-
Notifications
You must be signed in to change notification settings - Fork 110
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
discourage packages from depending on Revise? #728
Comments
Most of these packages either have very few users (< 5 downloads in the lsat month) or have a legitimate dependency on Revise.
DataDrop and Scruff both depend on Revise but don't actually load it, so the dependency should have no impact on user experience or precompilation (except to unnecessarily download and precompile Revise.jl) If Revise can't participate in precompilation, that is a separate bug but this would not be a great solution. |
I'm all in favor of expunging needless dependencies, but I don't understand why this package makes precompilation less reliable. And there are a few packages that build on Revise's functionality. |
Revise appears to start tracking changes immediately, which would result in miscompilation (or more likely eval errors) if any were detected. It seems to need some different cue then for what and when to watch for changes if users are going to try to precompile with it. I had assumed that Revise was the interactive package, while most of the utilities were implemented elsewhere (such as LoweredCodeUtils and CodeTracking). Whereas this package relies on some pretty heavy-weight and expensive interactive packages additionally (such as Pkg, REPL, JuliaInterpreter) |
I think I get it now: the issue is that Revise's Presumably you'd like it if we wait until the "last package loaded" is the one that launches these Tasks? But isn't that a bit ugly? |
Personally I am leaning towards the view that the best solution is to revert JuliaLang/julia#46571 (sorry). There are genuine reasons packages need to start tasks in their |
Maybe what Revise could do is check whether |
There are workarounds for specific issues. But I'm mulling over the bigger picture. Suppose someone was worried about data loss from a task that periodically writes to disk. This user requested that we make it impossible to |
I personally think that the failure mode of JuliaLang/julia#46571 seems too harsh for these type of simple mistakes. |
@timholy You seem to be onto my plan for stage 2 of this haha. I had not been discussing it since I did not want to work out all of the details yet, but I believe it was briefly mentioned in the original PR. Yes, in the future I envision you can set a flag that defers normal program exit until the application has shutdown and cleaned up itself sufficiently. It would have to be opt-in, and you could still bypass it simply with any abnormal program exit code (non-zero). Languages, like C and C++, already do this (by waiting for all destructors to run before any exit), so it should not be too surprising that we also are doing this more now too. Although the blend of exactly which things we cancel vs. wait for completion is very implementation specific, and we can still work to adjust those categorizations too. |
I don't pretend to understand this landscape as well as you do, but IMO Kristoffer's point is right: we're already in the territory where fears over correctness are making people's lives harder. Heck, until I sit down and spend half a day finally learning about pipes and other advanced I/O features, even I don't know how to fix JuliaDebug/Cthulhu.jl#344. And if someone like me has a worthy goal, "shave 6s off the startup time," but I'm stymied simply because I can't figure out how to clean up a Task nicely, I think we're entering dangerous territory. |
What about moving forward the
and getting that done first? |
That is already done. Just call exit(1) |
module StuckPackge
Timer(0.0; interval=1) do _
println("fire")
end
sleep(3)
exit(1)
end # module StuckPackge gives
|
The ongoing discussion is not Revise.jl specific. I'd like to move it to JuliaLang/julia#48506 |
PkgEval had previously indicated that Revise was the only (remaining) affected package. |
The approach that the users should set up Revise as part of their Many people have experience with other languages and web frameworks and just want to try building a quick app in a few lines of code before committing to spending more time to learn Julia (even so, many don't bother reading the manual). In addition, these days people don't necessarily go through the trouble of setting up a full programming environment to test Julia. If I want to try a language I just spin up something like Repl.it and test some demos. These kind of environments make configuring |
Yes, that makes sense. Packages like Genie and JET are using the API here in explicit ways to build upon it, so they are sensible consumers of this package, and we should not break that. The trouble is they don't necessarily want to also opt the user into the magic |
This might be a very bad idea. Tries to fix timholy#728
I didn't agree with that at the time. Of course it is weird that a package like Cthulhu didn't show up.
@essenciary can you open a separate issue about configuration? And any thoughts you have about an alternative? (Meaning, the obvious alternative is to not tell people how to run Revise by default and let them figure that out by themselves, but I'm not sure that's what you mean.) |
This might be a very bad idea. Tries to fix #728
There are packages embedding Revise as a dependency (https://juliahub.com/ui/Packages/Revise/M1Qoh/3.5.0?page=2). This seems like generally a user-hostile API design for these packages, since they are implicitly forcing the user to depend on Revise for a random subset of packages (whatever happens to get loaded after Revise happened to get loaded).
This also can show up as a bug during precompilation, since Revise starts tracking some files in the precompile process, which may lead to incorrect evaluation (attempting to load and evaluate files that should not be part of the package) and other similar issues.
I wonder if we should define
__init__() = precompile(false)
here, so that those packages are discouraged from depending on a package which makes that precompilation less reliable (this one)The text was updated successfully, but these errors were encountered: