Hi,
is it possible to deserialize a Module
in a new process to get that module (without defining it in the second process first)? I get the following error message when I use the Serialization
library as follows
Process 1
using Serialization
module A; x = 1; end
serialize("ModuleA", A)
Process 2
julia> using Serialization
julia> deserialize("ModuleA")
ERROR: UndefVarError: A not defined
Stacktrace:
[1] deserialize_module(s::Serializer{IOStream})
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:984
[2] handle_deserialize(s::Serializer{IOStream}, b::Int32)
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:883
[3] deserialize(s::Serializer{IOStream})
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:801
[4] handle_deserialize(s::Serializer{IOStream}, b::Int32)
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:907
[5] deserialize
@ ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:801 [inlined]
[6] deserialize(s::IOStream)
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:788
[7] open(f::typeof(deserialize), args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:330
[8] open
@ ./io.jl:328 [inlined]
[9] deserialize(filename::String)
@ Serialization ~/packages/julias/julia-1.7/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:798
[10] top-level scope
@ REPL[2]:1