Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

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

Open fonsp opened this issue 1 year ago • 3 comments

TODO remove logs

fonsp avatar May 09 '24 09:05 fonsp

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

github-actions[bot] avatar May 09 '24 09:05 github-actions[bot]

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 avatar May 13 '24 15:05 fonsp

pankgeorg suggested flush(some_io)

fonsp avatar May 13 '24 15:05 fonsp

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 avatar May 17 '24 08:05 fonsp

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

fonsp avatar May 17 '24 09:05 fonsp

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

fonsp avatar May 21 '24 17:05 fonsp