Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calling `redirect_stdout` without any arguments redirects the output to a newly created `Pipe`[^1] (which is mostly a wrapper around standard *nix pipes). Not reading data from this `Pipe` can result in precompilation to hang, e.g. in CI environments such as GitHub Actions or as reported here[^2]. This is due to a fundamental expectation that a (*nix) kernel has on pipes, as documented[^3] "write will block until sufficient data has been read from the pipe to allow the write to complete". For this reason never reading from `new_stdout` may cause the precompilation to hang. Explicitly redirecting to `devnull` circumvents this expectation and ensures precompilation succeeds. [^1]: https://github.com/JuliaLang/julia/blob/9233a16172139c06107b475480bfce098f10a8a6/base/stream.jl#L1259 [^2]: https://discourse.julialang.org/t/when-i-add-any-package-prettytables-will-get-stuck-here-and-cannot-be-executed-i-need-to-control-c-to-close-it [^3]: https://man7.org/linux/man-pages/man7/pipe.7.html
- Loading branch information
8cf53ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ronisbr, can you cut a patch release with this fix?
8cf53ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure! I will do this today.