mbaz / Gaston.jl

A julia front-end for gnuplot.
MIT License
148 stars 30 forks source link

do not run i/o when precompiling #185

Closed t-bltg closed 6 months ago

t-bltg commented 6 months ago

Fix issue when precompiling extensions:

This means that a package has started a background task or event source that has not finished running. For precompilation to complete successfully, the event source needs to be closed explicitly. See the developer documentation on fixing precompilation hangs for more help.

A version bump would be appreciated.

Needed for https://github.com/JuliaPlots/Plots.jl/pull/4904.

mbaz commented 6 months ago

Thanks for the PR. This issue has been fixed in the dev branch (which will become v2.0), but a version bump in v1 is a good idea. I'll need to take a look at the test failures, but I'll try to get this done soon.

t-bltg commented 6 months ago

Would it be possible to release a fix quickly for 1 ?

This is currently deadlocking CI (as in https://github.com/JuliaPlots/Plots.jl/actions/runs/8514690332/job/23320875036?pr=4914#step:9:667).

Thanks.

mbaz commented 6 months ago

I understand the urgency. I'll fix this and release ASAP.

mbaz commented 6 months ago

v1.1.1 has been released. Let me know if any issues come up.

t-bltg commented 6 months ago

@mbaz, thanks, but the proposed fix doesn't work in 1.1.1:

https://github.com/mbaz/Gaston.jl/blob/c7fe06a3926da99910430a94d9695314057b9680/src/Gaston.jl#L94 is causing the same message as in https://github.com/mbaz/Gaston.jl/pull/185#issue-2217169517.

The recommended way is to use ccall(:jl_generating_output, Cint, ()) == 1 && return as implemented in this PR. Please explain what's wrong with this proposition ?

mbaz commented 6 months ago

Sorry about that. What version of Julia did you use to test? I tested on v1.6 and 1.10 and I don't see that message.

Anyway, I have a more radical solution that should definitely solve this. I'll need a couple of days to implement it and cut a new release.

t-bltg commented 6 months ago

This is on linux, julia 1.10.2, and this deadlock appears when precompiling the GastonExt from PlotsBase in the v2 branch.

mbaz commented 6 months ago

Interesting; I'm on Linux and 1.10.2 myself.

Is it possible for you to test using a branch (or a tag) on this repo, or do you need a release?

t-bltg commented 6 months ago

We would need a new release since this is affecting CI: see for example https://github.com/JuliaPlots/Plots.jl/actions/runs/8514690332/job/23320875036?pr=4914#step:9:667 where Gaston is clearly incriminated for the deadlock.

t-bltg commented 6 months ago

And locally, ccall(:jl_generating_output, Cint, ()) == 1 && return works.

mbaz commented 6 months ago

v1.1.2 has been released -- please let me know how it goes.

t-bltg commented 6 months ago

Thanks, it works, CI seems to go past precompilation now ...