Skip to content

Commit 721932d

Browse files
authored
prevent precompilation from breaking if Base.PkgId is imported (#42329)
`repr` will only print a module prefix if the symbol is not existing in Main but the module prefix is unconditionally needed here since the code will be evaluated in another process.
1 parent 3eeafa6 commit 721932d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/loading.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,8 @@ function create_expr_cache(pkg::PkgId, input::String, output::String, concrete_d
13561356
for (pkg, build_id) in concrete_deps
13571357
push!(deps_strs, "$(pkg_str(pkg)) => $(repr(build_id))")
13581358
end
1359-
deps = repr(eltype(concrete_deps)) * "[" * join(deps_strs, ",") * "]"
1360-
1359+
deps_eltype = sprint(show, eltype(concrete_deps); context = :module=>nothing)
1360+
deps = deps_eltype * "[" * join(deps_strs, ",") * "]"
13611361
trace = isassigned(PRECOMPILE_TRACE_COMPILE) ? `--trace-compile=$(PRECOMPILE_TRACE_COMPILE[])` : ``
13621362
io = open(pipeline(`$(julia_cmd()::Cmd) -O0
13631363
--output-ji $output --output-incremental=yes

0 commit comments

Comments
 (0)