Skip to content

Commit 4430ae8

Browse files
authored
generate_precompile: Move parsing into try/catch (#39592)
Our printing for precompile statements is not 100% reliable (#28808) and can fail. I introduced the extra `parse` call in the Varargs change, but because of #28808, it needs to go inside the try/catch.
1 parent ae703be commit 4430ae8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

contrib/generate_precompile.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,23 @@ function generate_precompile_statements()
353353
# println(statement)
354354
# The compiler has problem caching signatures with `Vararg{?, N}`. Replacing
355355
# N with a large number seems to work around it.
356-
ps = Meta.parse(statement)
357-
if isexpr(ps, :call)
358-
if isexpr(ps.args[end], :curly)
359-
l = ps.args[end]
360-
if length(l.args) == 2 && l.args[1] == :Vararg
361-
push!(l.args, 100)
356+
try
357+
ps = Meta.parse(statement)
358+
if isexpr(ps, :call)
359+
if isexpr(ps.args[end], :curly)
360+
l = ps.args[end]
361+
if length(l.args) == 2 && l.args[1] == :Vararg
362+
push!(l.args, 100)
363+
end
362364
end
363365
end
364-
end
365-
try
366366
# println(ps)
367367
Core.eval(PrecompileStagingArea, ps)
368368
n_succeeded += 1
369369
print("\rExecuting precompile statements... $n_succeeded/$(length(statements))")
370370
catch
371371
# See #28808
372-
@error "Failed to precompile $statement"
372+
# @error "Failed to precompile $statement"
373373
end
374374
end
375375
println()

0 commit comments

Comments
 (0)