GenieFramework / Stipple.jl

The reactive UI library for interactive data applications with pure Julia.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

precompile of GB-project fails: "some other module mutating `Stipple` with `eval` during precompilation - don't do this."

michaelfliegner opened this issue · comments

I want to deploy my Genie Builder Project to julia hub. Precompile fails with error below.
Source is
https://github.com/Actuarial-Sciences-for-Africa-ASA/GenieBuiltLifeProto
You can, however, run the app - in gitpod, for example, with a preloaded postgres db.
by

include("run.jl")

Code is developped with and runs under GenieBuilder, all I changed is, add this module
https://github.com/Actuarial-Sciences-for-Africa-ASA/GenieBuiltLifeProto/blob/main/src/GenieBuiltLifeProto.jl

Failed to precompile GenieBuiltLifeProto [9e6ec31a-4cef-4def-9440-f7db695aa5a5] to /home/gitpod/.julia/compiled/v1.8/GenieBuiltLifeProto/jl_VjC2Gc.
ERROR: LoadError: Evaluation into the closed module `Stipple` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Stipple` with `eval` during precompilation - don't do this.
Stacktrace:
 [1] eval
   @ ./boot.jl:368 [inlined]
 [2] binding(expr::Expr, m::Module, mode::Any; source::LineNumberNode, reactive::Bool)
   @ Stipple.ReactiveTools ~/.julia/packages/Stipple/XoQ2b/src/ReactiveTools.jl:274
 [3] var"@out"(__source__::LineNumberNode, __module__::Module, expr::Any)
   @ Stipple.ReactiveTools ~/.julia/packages/Stipple/XoQ2b/src/ReactiveTools.jl:361
 [4] include(mod::Module, _path::String)
   @ Base ./Base.jl:419
 [5] include(x::String)
   @ GenieBuiltLifeProto /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:1
 [6] top-level scope
   @ /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:6
 [7] include
   @ ./Base.jl:419 [inlined]
 [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
   @ Base ./loading.jl:1554
 [9] top-level scope
   @ stdin:1
in expression starting at /workspace/GenieBuiltLifeProto/app.jl:26
in expression starting at /workspace/GenieBuiltLifeProto/app.jl:1
in expression starting at /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:1
in expression starting at stdin:1

Not sure whether that solves it (currentlyon my mobile), but try to replace @handlers by @app

Will try that this evening. Thankful for your quick response🙏

Unfortuantely, that wasn´t it: error remains:

(GenieBuiltLifeProto) pkg> precompile
Precompiling project...
✗ GenieBuiltLifeProto
0 dependencies successfully precompiled in 43 seconds. 216 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

GenieBuiltLifeProto [9e6ec31a-4cef-4def-9440-f7db695aa5a5]

Failed to precompile GenieBuiltLifeProto [9e6ec31a-4cef-4def-9440-f7db695aa5a5] to /home/gitpod/.julia/compiled/v1.8/GenieBuiltLifeProto/jl_dX4Zu3.
ERROR: LoadError: Evaluation into the closed module Stipple breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating Stipple with eval during precompilation - don't do this.
Stacktrace:
[1] eval
@ ./boot.jl:368 [inlined]
[2] binding(expr::Expr, m::Module, mode::Any; source::LineNumberNode, reactive::Bool)
@ Stipple.ReactiveTools ~/.julia/packages/Stipple/XoQ2b/src/ReactiveTools.jl:274
[3] var"@out"(source::LineNumberNode, module::Module, expr::Any)
@ Stipple.ReactiveTools ~/.julia/packages/Stipple/XoQ2b/src/ReactiveTools.jl:361
[4] include(mod::Module, _path::String)
@ Base ./Base.jl:419
[5] include(x::String)
@ GenieBuiltLifeProto /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:1
[6] top-level scope
@ /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:6
[7] include
@ ./Base.jl:419 [inlined]
[8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base ./loading.jl:1554
[9] top-level scope
@ stdin:1
in expression starting at /workspace/GenieBuiltLifeProto/app.jl:26
in expression starting at /workspace/GenieBuiltLifeProto/app.jl:1
in expression starting at /workspace/GenieBuiltLifeProto/src/GenieBuiltLifeProto.jl:1
in expression starting at stdin:1

(GenieBuiltLifeProto) pkg>

Will try to have a look tonight.

I just published a branch hh-precompile to address the issue.
Would you be so kind and test with that branch?

] add Stipple#hh-precompile

When I wrote this I was just learning about macro programming and was not aware about this kind of dos and don'ts.
Meanwhile I am, although I am still learning...

I am on stand-by

There's more to it, I'll let you know when there are essential news.

You can try now. I built a MWE for myself and that passes with two warnings. The warnings result from the fact that we allow for redefinition of apps, so they are there by design.

(GenieBuiltLifeProto) pkg> status Stipple
Project GenieBuiltLifeProto v0.1.0
Status ~/dev/julia_depot/geniebuilder/apps/GenieBuiltLifeProto/Project.toml
[4acbeb90] Stipple v0.26.3 https://github.com/GenieFramework/Stipple.jl.git#hh-precompile

(GenieBuiltLifeProto) pkg> update Stipple
Updating registry at ~/dev/julia_depot/registries/General.toml
Updating git-repo https://github.com/GenieFramework/Stipple.jl.git
Installed StaticArrays ─── v1.5.24
Installed GeometryBasics ─ v0.4.7
Installed Distributions ── v0.25.88
Updating ~/dev/julia_depot/geniebuilder/apps/GenieBuiltLifeProto/Project.toml
[4acbeb90] ~ Stipple v0.26.3 https://github.com/GenieFramework/Stipple.jl.git#hh-precompile ⇒ v0.26.3 https://github.com/GenieFramework/Stipple.jl.git#hh-precompile
Updating ~/dev/julia_depot/geniebuilder/apps/GenieBuiltLifeProto/Manifest.toml
[31c24e10] ↑ Distributions v0.25.87 ⇒ v0.25.88
[5c1252a2] ↑ GeometryBasics v0.4.6 ⇒ v0.4.7
[90137ffa] ↑ StaticArrays v1.5.23 ⇒ v1.5.24
[4acbeb90] ~ Stipple v0.26.3 https://github.com/GenieFramework/Stipple.jl.git#hh-precompile ⇒ v0.26.3 https://github.com/GenieFramework/Stipple.jl.git#hh-precompile
[3bb67fe8] ↑ TranscodingStreams v0.9.12 ⇒ v0.9.13
Precompiling project...
29 dependencies successfully precompiled in 232 seconds. 188 already precompiled.

will You close the issue after merging into the main branch?

Happy that it works for you as well. Have you also tested functionality?

ja, läuft.