fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

Julia 1.11 compat: Use Base.BufferStream for capturing Pkg IO #2915

Closed fonsp closed 1 month ago

fonsp commented 1 month ago

implement #2910

github-actions[bot] commented 1 month ago

Try this Pull Request!

Open Julia and type:

  julia> import Pkg
  julia> Pkg.activate(temp=true)
  julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="Pkg-IO-capture-BufferStream")
  julia> using Pluto
fonsp commented 1 month ago

This PR seems to fix the issue! Except it stalls forever when doing Pkg operations, unless I add lots of logs to debug this, and then it magically works. So I need to figure out which log fixed it and why? (Maybe I need a yield or something?)

fonsp commented 1 month ago

pankgeorg suggested flush(some_io)

fonsp commented 1 month ago

The problem was that I was doing readavailable on a stream that was already fully read, so it was waiting forever for the next byte. The logs "fixed" it because the logs were also printed in this stream, adding bytes.

fonsp commented 1 month ago

This fixed it! There is one more Pkg issue that I will maybe do in a separate PR

fonsp commented 1 month ago

last failure is https://github.com/julia-actions/setup-julia/issues/240