diff --git a/src/clusterserialize.jl b/src/clusterserialize.jl index d2f09e7..1e49b6a 100644 --- a/src/clusterserialize.jl +++ b/src/clusterserialize.jl @@ -167,10 +167,12 @@ function deserialize_global_from_main(s::ClusterSerializer, sym) return nothing end end - Core.eval(Main, Expr(:global, sym)) if sym_isconst - ccall(:jl_set_const, Cvoid, (Any, Any, Any), Main, sym, v) + Core.eval(Main, Expr(:block, + Expr(:const, GlobalRef(Main, sym), v), + nothing)) else + Core.eval(Main, Expr(:global, sym)) invokelatest(setglobal!, Main, sym, v) end return nothing