Skip to content

Commit 139e507

Browse files
pass warning state into nexted compilecache workers to conform warnings
1 parent 6a7481e commit 139e507

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

base/loading.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,8 @@ function require(into::Module, mod::Symbol)
10281028
"future warnings for $(where.name) are suppressed.")
10291029
) _module = nothing _file = nothing _group = nothing
10301030
push!(modules_warned_for, where)
1031+
full_warning_showed[] = true
10311032
end
1032-
full_warning_showed[] = true
10331033
end
10341034
end
10351035
if _track_dependencies[]
@@ -1393,6 +1393,8 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d
13931393
"Base.PkgId(Base.UUID(\"$(_pkg.uuid)\"), $(repr(_pkg.name)))"
13941394
end
13951395
end
1396+
repr_modules_warned_for() = string("Base.PkgId[", join(pkg_str.(collect(Base.modules_warned_for)), ", "), "]")
1397+
13961398
for (pkg, build_id) in concrete_deps
13971399
push!(deps_strs, "$(pkg_str(pkg)) => $(repr(build_id))")
13981400
end
@@ -1406,10 +1408,13 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d
14061408
$trace
14071409
--eval 'eval(Meta.parse(read(stdin,String)))'`, stderr = internal_stderr, stdout = internal_stdout),
14081410
"w", stdout)
1409-
# write data over stdin to avoid the (unlikely) case of exceeding max command line size
1411+
# write data over stdin to avoid the (unlikely) case of exceeding max command line size.
1412+
# Pass warning state into workers to avoid excessive warnings from nested precompilation
1413+
# TODO: consider passing warning state back from workers also, so that warning state traverses the precompilation tree
14101414
write(io.in, """
1411-
Base.include_package_for_output($(pkg_str(pkg)), $(repr(abspath(input))), $(repr(depot_path)), $(repr(dl_load_path)),
1412-
$(repr(load_path)), $deps, $(repr(source_path(nothing))))
1415+
Base.full_warning_showed[] = $(Base.full_warning_showed[]); (isempty($(repr_modules_warned_for())) || push!(
1416+
empty!(Base.modules_warned_for), $(repr_modules_warned_for())...)); Base.include_package_for_output($(pkg_str(pkg)),
1417+
$(repr(abspath(input))), $(repr(depot_path)), $(repr(dl_load_path)), $(repr(load_path)), $deps, $(repr(source_path(nothing))))
14131418
""")
14141419
close(io.in)
14151420
return io

0 commit comments

Comments
 (0)