Hey all,
why can’t I use a module const like
module A
const TEST = Ref{Task}(@async nothing)
end
in a package.
(@v1.6) pkg> update
Updating git-repo `C:\ProjectName\packages\julia\ProjectName`
Updating `C:\Users\UserName\.julia\environments\v1.6\Project.toml`
[e4102d56] ~ ProjectName v0.2.1 `C:\ProjectName\packages\julia\ProjectName#master` ⇒ v0.2.1 `C:\ProjectName\packages\julia\ProjectName#master`
Updating `C:\Users\UserName\.julia\environments\v1.6\Manifest.toml`
[e4102d56] ~ ProjectName v0.2.1 `C:\ProjectName\packages\julia\ProjectName#master` ⇒ v0.2.1 `C:\ProjectName\packages\julia\ProjectName#master`
Precompiling project...
✗ ProjectName
0 dependencies successfully precompiled in 2 seconds (43 already precompiled)
1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
julia> using ProjectName
[ Info: Precompiling ProjectName [e4102d56-39a5-47ec-876b-10baf1c2b503]
fatal: error thrown and no exception handler available.
ErrorException("Task cannot be serialized")
jl_error at /cygdrive/c/buildbot/worker/package_win64/build/src\rtutils.c:41
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:678
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:787
[inlined]
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:798
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:330
[inlined]
jl_serialize_module at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:361
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:675
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:387
[inlined]
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:507
jl_serialize_value_ at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:387
[inlined]
jl_save_incremental at /cygdrive/c/buildbot/worker/package_win64/build/src\dump.c:2183jl_write_compiler_output at /cygdrive/c/buildbot/worker/package_win64/build/src\precompile.c:65
jl_atexit_hook at /cygdrive/c/buildbot/worker/package_win64/build/src\init.c:211
repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:703
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:51
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
ERROR: Failed to precompile ProjectName [e4102d56-39a5-47ec-876b-10baf1c2b503] to C:\Users\UserName\.julia\compiled\v1.6\ProjectName\jl_14CB.tmp.
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
@ Base .\loading.jl:1360
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base .\loading.jl:1306
[4] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1021
[5] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:914
[6] require(into::Module, mod::Symbol)
@ Base .\loading.jl:901
[7] eval
@ .\boot.jl:360 [inlined]
[8] eval
@ .\Base.jl:39 [inlined]
[9] repleval(m::Module, code::Expr, #unused#::String)
@ VSCodeServer c:\Users\UserName\.vscode\extensions\julialang.language-julia-1.2.1\scripts\packages\VSCodeServer\src\repl.jl:139
[10] (::VSCodeServer.var"#69#71"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
@ VSCodeServer c:\Users\UserName\.vscode\extensions\julialang.language-julia-1.2.1\scripts\packages\VSCodeServer\src\repl.jl:105
[11] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging .\logging.jl:491
[12] with_logger
@ .\logging.jl:603 [inlined]
[13] (::VSCodeServer.var"#68#70"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
@ VSCodeServer c:\Users\UserName\.vscode\extensions\julialang.language-julia-1.2.1\scripts\packages\VSCodeServer\src\repl.jl:106
[14] #invokelatest#2
@ .\essentials.jl:708 [inlined]
[15] invokelatest(::Any)
@ Base .\essentials.jl:706
[16] macro expansion
@ c:\Users\UserName\.vscode\extensions\julialang.language-julia-1.2.1\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
[17] (::VSCodeServer.var"#53#54")()
@ VSCodeServer .\task.jl:411