Error precompiling Plots: RecipesBase.jl:607 needs to be placed at the top level, or use "eval"

Any hint on how to solve this precompilation problem? I’m using an environment and all the packages seem up to date.

precompile
Precompiling project...
  ✗ Plots
  0 dependencies successfully precompiled in 2 seconds. 180 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/leandro/.julia/compiled/v1.8/Plots/jl_YLLoQ5.
ERROR: LoadError: syntax: Global method definition around /home/leandro/.julia/packages/RecipesBase/eU0hg/src/RecipesBase.jl:607 needs to be placed at the top level, or use "eval".
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/RecipesBase/eU0hg/src/RecipesBase.jl:600
 [2] include
   @ ./Base.jl:419 [inlined]
 [3] 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::String)
   @ Base ./loading.jl:1554
 [4] top-level scope
   @ stdin:1
in expression starting at /home/leandro/.julia/packages/RecipesBase/eU0hg/src/RecipesBase.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile RecipesBase [3cdcf5f2-1ef4-517c-9805-6587b60abb01] to /home/leandro/.julia/compiled/v1.8/RecipesBase/jl_3UMlMP.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:1707
  [3] compilecache
    @ ./loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
  [6] macro expansion
    @ ./loading.jl:1180 [inlined]
  [7] macro expansion
    @ ./lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
  [9] include
    @ ./Base.jl:419 [inlined]
 [10] 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
 [11] top-level scope
    @ stdin:1
in expression starting at /home/leandro/.julia/packages/Plots/Hxe7H/src/Plots.jl:1

edit: the issue got solved. After using Plots, I got a warning saying that GR was not installed, then it installed it and now everything is working. I don’t know why before the dependency was not there.

I am suddenly getting the same error on CI.
I am getting this as well when installing RecipesBase as the only package in a clean environment. IMHO installation of GR shouldn’t be required to make this work.

See [BUG] RecipesBase and RecipesPipeline fail to precompile · Issue #4597 · JuliaPlots/Plots.jl · GitHub

Look like induced by latest SnoopPrecompile latest version of `SnoopPrecompile` breaks `RecipesBase` · Issue #317 · timholy/SnoopCompile.jl · GitHub.

I think we should yank SnoopPrecompile@1.0.2 until we know more, since this affects a lots of Plots users.

cc @tim.holy

2 Likes

DifferentialEquations also seems affected. Thanks for the diagnosis and the quickfix <3

pkg> update

should fix this issue, since SnoopPrecompile@1.0.2 was yanked.

Check with ] status -m SnoopPrecompile, that you don’t have 1.0.2.

1 Like

Yeah I saw it, and then the Plots.jl issue with 20 people saying “same” within the last hour, so I merged the yank.

Usually one doesn’t merge a yank until the maintainer agrees, but this seems like a special scenario that was going to effect half of Julia users, so might as well do it before the well-adjusted humans of the US east coast wake up. @tim.holy let me know if you want it back, but I assume you’re okay with a quick action here.

5 Likes

Definitely OK with it, sorry this happened. We need a test case to catch this.

3 Likes