Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompile: Improve handling of packages that are missing modules #2579

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ function precompile(ctx::Context; internal_call::Bool=false, strict::Bool=false,

function handle_interrupt(err)
notify(interrupted_or_done)
sleep(0.2) # yield for a period to let the print loop cease first
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience this just makes the interrupt printing more reliably tidy

if err isa InterruptException
lock(print_lock) do
println(io, " Interrupted: Exiting precompilation...")
Expand Down Expand Up @@ -1250,8 +1251,8 @@ function precompile(ctx::Context; internal_call::Bool=false, strict::Bool=false,
end
loaded && (n_loaded += 1)
catch err
if err isa ErrorException
failed_deps[pkg] = (strict || is_direct_dep) ? String(take!(iob)) : ""
if err isa ErrorException || (err isa ArgumentError && startswith(err.msg, "Invalid header in cache file"))
failed_deps[pkg] = (strict || is_direct_dep) ? string(sprint(showerror, err), "\n", String(take!(iob))) : ""
!fancyprint && lock(print_lock) do
println(io, string(color_string(" ✗ ", Base.error_color()), name))
end
Expand Down