-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Precompilation fails with Iterators.jl dependency #21969
Comments
FWIW I have seen the same thing. Not sure if this is related to that, but I have also found that I sometimes get a cache file generated for a module, which does not have any precompile statement. Sometimes the "precompilation" of my module also fails with the error above. |
I'm surprised this didn't get a breaking tag? Having to close the text editor almost every time a package is changed is a really tough regression to live with. Partially saying that because I am extremely mad at the situation of having closed the text editor already 50 times this morning, but also I really hope that v0.6 doesn't ship with this prominent of a bug. |
This is the first we're hearing about this problem and I'm sure it wasn't done on purpose. Ideally we can figure out a way to fix this issue. |
A common error message associated with this is something like:
it seems to pick random (precompile) friendly dependents. @MikeInnes says he knew about this already. Iterators and Combinatorics seem to show up a lot though. Other than that, I'm not really sure what I'm looking for in order to debug this. |
You surely know this already, but Iterators is both the name of a package and a module in Base. And the Combinatorics package depends on Iterators. Perhaps try removing your Iterators package? You may have to do surgery on your REQUIRE files and/or METADATA to allow this. |
I tried to get rid of every v0.6 Iterators usage by doing an if statement on the versions to choose between Iterators and Base.Iterators, but even that doesn't work. It "fixed" RecursiveArrayTools, but then Roots.jl ended up with a faulty precompile cache on Iterators, and it stayed that way even after doing this change to all of its dependencies which use Iterators. But at least that's something. Doing a fresh install of the rc2 generic binaries on 3 separate Windows computers and then using it through Juno, it very reliably will have a precompilation problem on some (random) package which depends on iterators, either directly or indirectly. On the one hand it's great that it's very easy to repeat, but on the otherhand it's not so good that it's so easy to run into. Given this, I tried to find out if there is anything weird that Iterators does. I did find something, if I directly do
If I do it in the REPL, everything is fine. Since this precompilation problem seems to only be happening in Juno, maybe that's a clue that it's a problem with Juno using Base.Iterators for something? |
Hmm, what happens if you add the following as the first line of your Iterators package: error("don't use this!") |
Juno starts up just fine even with that. |
Bizarre. What if you |
I've seen similar bizarre precompilation issues (on 0.5) when there are multiple Julia processes started simultaneously, and they all try to load a package, and thus try to precompile a package simultaneously. Could something like that be happening here? Precompilation is far from being multi-anything safe. |
Juno does by default start up a few processes using its "Cycler". I changed that over to "Basic" and had the same issue. Maybe this should be checked more thoroughly though. @MikeInnes @pfitzseb what do you think of that? Is there a better test of this? |
Actually, deleting all of the precompilation files and then switching over to the "Basic" mode seems to be working now. |
While Juno in cycler mode certainly starts up a couple of Julia processes at the same time, only the currently used process should actually do something if you evaluate |
My |
FWIW, I've seen this plenty with Basic boot mode, which doesn't interleave processes at all, and at any rate I didn't see problems on 0.5. |
True. Me neither. |
Note that I see the problem at the REPL, if an attempt at compilation was made in Juno previously. This also exhibits the problem where my module, which doesn't have any precompilation statements, gets precompiled (and I do end up with a ji file): julia> using Schrodinger, BenchmarkTools
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\DiffEqBase.ji for module DiffEqBase.
WARNING: The call to compilecache failed to create a usable precompiled cache file for module DiffEqBase. Got:
WARNING: Module Iterators uuid did not match cache file.
INFO: Precompiling module Schrodinger.
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\Combinatorics.ji for module Combinatorics.
WARNING: The call to compilecache failed to create a usable precompiled cache file for module Combinatorics. G
ot:
WARNING: Module Iterators uuid did not match cache file.
ERROR: LoadError: Declaring __precompile__(true) is only allowed in module files being imported. |
I am seeing this problem from the REPL with RC2 after deleting |
Another example: JuliaImages/ImageAxes.jl#18. We worked around it by removing the Iterators.jl dependency. That seems to be at the root of all these reports. Title changed to reflect that. |
then it should be fixed by backporting #21580. does it happen on master? |
I don't seem to be having problems with this using the v0.7 nightly. |
This is still an issue with rc3 unfortunately: julia> using Schrodinger
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\Roots.ji for module Roots.
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\PolynomialFactors.ji for module PolynomialF
actors.
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\Combinatorics.ji for module Combinatorics.
WARNING: The call to compilecache failed to create a usable precompiled cache file for module Combinatorics. G
ot:
WARNING: Module Iterators uuid did not match cache file.
INFO: Precompiling module Schrodinger.
INFO: Recompiling stale cache file C:\Users\Jeremy\.julia\lib\v0.6\Combinatorics.ji for module Combinatorics.
WARNING: The call to compilecache failed to create a usable precompiled cache file for module Combinatorics. G
ot:
WARNING: Module Iterators uuid did not match cache file.
ERROR: LoadError: Declaring __precompile__(true) is only allowed in module files being imported. |
Does it help to do |
If I close and restart julia, it works, after which there seem to be some
delay before it will give the error again. FWIT I think `using
Combinatorics` package reproduces the error on its own.
…On Wed, Jun 7, 2017 at 2:03 PM David P. Sanders ***@***.***> wrote:
Does it help to do using Schrodinger again?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21969 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKoBtpk2IeLKN0oaZrOKYYsB2jA3_NOaks5sBuYGgaJpZM4Ng1Lx>
.
|
I've found I can "recover" from this by doing: using Iterators
using Combinatorics
using WhateverOtherPackage after seeing the error. |
I ended up adding |
I took a package approach to "fixing this", and put in PRs to remove Iterators.jl from every dependency that was giving me problems: JuliaMath/Combinatorics.jl#49 If those merge and and are released, v0.6 is safe for me. Other packages that I don't use might still have issues though. But if you work in a similar package sphere to me, you can checkout those 2 PRs and you won't have the issue anymore. |
would be nice to have this fixed for 0.6 |
@JeffBezanson did some investigation of this earlier; best if he reports what he found here. |
I saw v0.6 got tagged: was there a fix for this included? |
Not in 0.6.0, no. @JeffBezanson can hopefully share what he found from looking into this a bit. |
I believe this has been well reported, but I add my experience using julia version 0.6.0 (OSx, downloaded as precompiled julia.app) $ rm -fr ~/.julia INFO: Recompiling stale cache file /Users/cdaniels/.julia/lib/v0.6/Combinatorics.ji for module Combinatorics. I then quit the repl, restart julia, 'use Combinatorics' and it typically works. |
Not sure if this is news - but I've seen this also without having Iterators.jl installed, so it doesn't seem like it's specific to that package. I think I've seen it mostly in the context of DSP.jl not precompiling because FFTW.jl's UUID doesn't match. Probably has to do with switching branches of DSP.jl, but I don't have a consistent repro. |
FFTW is also having a name collision with the (deprecated) Base module. We need a real fix for this, or packages with the same name as a base module will never work reliably. |
+1 having the same issue on Win 7 with Iterators dependency, switching back to 0.5.2 |
ugg, after spending way to long getting Juno to work with issues from julia-client and ultimately HttpParser I ran into this... |
Update for those who haven't followed: Iterators.jl has been deprecated in favor of IterTools.jl. That gets rid of this issue for packages that used to use Iterators.jl. Please use |
@ChrisRackauckas thank you, I did do a |
Well Iterators and FFTW still won't work because of the naming issue. I'll let someone else determine whether it can be considered fixed just by renaming the packages. It seems like @tkelman is looking for a real fix. |
I'd like for there to be one, but I don't know how to do it myself. Jeff looked into this before JuliaCon but hasn't written down what he found. |
I think this will ultimately be solved by not using The only other thing we can do is remove the Base export for |
Ah yes, #17997 combined with some identity for modules that's independent of the name would be great. Is there any way we can start on that change before Pkg3 is entirely ready? |
The change is largely independent of Pkg3. In particular, it actually can't really use UUIDs because it's possible to load code from things that aren't packages. Unless we want to eliminate the ability to load non-local code that's not a full-blown package, we need to use a path or something like that. So the general scheme would be something like |
+1 same issue here when trying to |
Well you can |
Example:
Also posted at JunoLab/Atom.jl#86. For some reason, the REPL works but Juno fails often, and if I hit it with a few
using
s in the REPL (for some reason, a few), and then close and re-open Juno, it's finally able to find the right precompilation caches. I'm not entirely sure if this is Juno or Base.The text was updated successfully, but these errors were encountered: