I’ve got a TaskWrappers.jl
package whose source file looks like this.
module TaskWrappers
struct TaskWrapper
task::Task
end
t = @async sleep(10)
example = TaskWrapper(t)
end
My directory layout is simple:
|- Project.toml
|- src/
|- TaskWrappers.jl
See https://github.com/Jasha10/TaskWrappers.jl for reference.
There is no problem at all if I run the following from the command line:
julia -ie 'include("src/TaskWrappers.jl"); using .TaskWrappers'
However, I get major issues if I run this command:
julia --project -ie 'using TaskWrappers'
The program crashes horribly:
Jashas-MBP-2:TaskWrappers.jl lappy486$ julia --project -ie 'using TaskWrappers'
[ Info: Precompiling TaskWrappers [8aa0bef4-ac27-11e9-2b40-fd2da0855edc]
fatal: error thrown and no exception handler available.
ErrorException("Task cannot be serialized")
rec_backtrace at /Users/julia/buildbot/worker/package_macos64/build/src/stackwalk.c:94
record_backtrace at /Users/julia/buildbot/worker/package_macos64/build/src/task.c:217
jl_throw at /Users/julia/buildbot/worker/package_macos64/build/src/task.c:417
jl_error at /Users/julia/buildbot/worker/package_macos64/build/src/rtutils.c:41
jl_serialize_value_ at /Users/julia/buildbot/worker/package_macos64/build/src/dump.c:865
jl_serialize_module at /Users/julia/buildbot/worker/package_macos64/build/src/dump.c:427 [inlined]
jl_serialize_value_ at /Users/julia/buildbot/worker/package_macos64/build/src/dump.c:862
jl_serialize_value_ at /Users/julia/buildbot/worker/package_macos64/build/src/dump.c:663
jl_save_incremental at /Users/julia/buildbot/worker/package_macos64/build/src/dump.c:2706
jl_write_compiler_output at /Users/julia/buildbot/worker/package_macos64/build/src/precompile.c:66
jl_atexit_hook at /Users/julia/buildbot/worker/package_macos64/build/src/init.c:222
main at /Applications/Julia-1.1.app/Contents/Resources/julia/bin/julia (unknown line)
ERROR: Failed to precompile TaskWrappers [8aa0bef4-ac27-11e9-2b40-fd2da0855edc] to /Users/lappy486/.julia/compiled/v1.1/TaskWrappers/4gSkB.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1197
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
Anybody know what’s going on here?
I’m running Julia version 1.1.1 on macOS 10.14.5.