JuliaPy / PythonPlot.jl

Plotting for Julia based on matplotlib.pyplot
MIT License
74 stars 8 forks source link

Doesn't precompile on Windows machines #25

Open BoundaryValueProblems opened 1 year ago

BoundaryValueProblems commented 1 year ago

I just added PythonPlot.jl on my Windows machine, and its precompilation never ends. On the other hand, on my Mac’s, I could precompile it without any problem. I use Julia v1.8.5, PythonPlot v1.0.2, Plots v1.38.7. By the way, I already have a working version of PyPlot.jl and PyCall.jl on my Windows machine. Should I remove them if I want to use PythonPlot.jl and PythonCall.jl? Can they coexist? Any help would be appreciated!

alhirzel commented 1 year ago

I think I see something similar on Linux, but it seems to depend on my code being in a module. Here is an annotated MNWE - I wonder if you could test something like this @BoundaryValueProblems ?

#!/bin/sh

rm -rf /tmp/Module1

julia -e 'using Pkg; cd("/tmp"); Pkg.generate("Module1"); Pkg.activate("Module1"); Pkg.add.(["Gtk", "PythonPlot"])'

cat <<EOF > /tmp/Module1/src/Module1.jl
module Module1
using Gtk
using PythonPlot
end
EOF

julia --trace-compile=stderr --compiled-modules=no -e '@info "This will work:"; using Pkg; Pkg.activate("/tmp/Module1"); @time using Module1; @info "See, it worked!"'
julia --trace-compile=stderr -e '@info "This will NOT terminate:"; using Pkg; Pkg.activate("/tmp/Module1"); @time using Module1'

And @stevengj - what further testing do you think is the most valuable? I am testing on Julia master and can provide a typescript at your request.

alhirzel commented 1 year ago

I bisected the issue that I was encountering, and it starts when this commit landed: https://github.com/JuliaLang/julia/commit/b029fbfe8a24a3cc381b2adbfaf2520a3e43cca4

Discussion that may be related - https://github.com/JuliaLang/julia/issues/48506