Skip to content

Commit

Permalink
don't report skipped comments as failures (and only show failed when …
Browse files Browse the repository at this point in the history
…> 0)
  • Loading branch information
IanButterworth committed Dec 29, 2022
1 parent 8c5e490 commit a1ee9af
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,12 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
occursin(", Core.Compiler.AbstractInterpreter, ", statement) && continue
try
ps = Meta.parse(statement)
isexpr(ps, :call) || continue
if !isexpr(ps, :call)
# these are typically comments
@debug "skipping statement because it does not parse as an expression" statement
delete!(statements, statement)
continue
end
popfirst!(ps.args) # precompile(...)
ps.head = :tuple
l = ps.args[end]
Expand All @@ -483,15 +488,15 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
n_succeeded += 1
failed = length(statements) - n_succeeded
yield() # Make clock spinning
print_state("step3" => "R$n_succeeded ($failed failed)")
print_state("step3" => string("R$n_succeeded", failed > 0 ? " ($failed failed)" : ""))
catch ex
# See #28808
@warn "Failed to precompile expression" form=statement exception=ex _module=nothing _file=nothing _line=0
end
end
wait(clock) # Stop asynchronous printing
failed = length(statements) - n_succeeded
print_state("step3" => "F$n_succeeded ($failed failed)")
print_state("step3" => string("F$n_succeeded", failed > 0 ? " ($failed failed)" : ""))
println()
if have_repl
# Seems like a reasonable number right now, adjust as needed
Expand Down

0 comments on commit a1ee9af

Please sign in to comment.