abraemer / StartupCustomizer.jl

Easy customization of startup.jl from the REPL!
MIT License
11 stars 0 forks source link

Precompile Error on v1.10 #2

Closed ParadaCarleton closed 1 year ago

ParadaCarleton commented 1 year ago

On v1.10, I get this error:

using StartupCustomizer
Precompiling StartupCustomizer
  ✗ StartupCustomizer
  0 dependencies successfully precompiled in 2 seconds

ERROR: The following 1 direct dependency failed to precompile:

StartupCustomizer [fb0408be-4331-42cc-8584-db8fa022598a]

Failed to precompile StartupCustomizer [fb0408be-4331-42cc-8584-db8fa022598a] to "/home/lime/.julia/compiled/v1.10/StartupCustomizer/jl_w2pNR6".
WARNING: Method definition (::Type{StartupCustomizer.PkgTemplates})() in module StartupCustomizer at /home/lime/.julia/packages/StartupCustomizer/gNfnf/src/modules/pkgtemplates.jl:5 overwritten at /home/lime/.julia/packages/StartupCustomizer/gNfnf/src/modules/pkgtemplates.jl:6.
ERROR: LoadError: Method overwriting is not permitted during Module precompile.
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/StartupCustomizer/gNfnf/src/modules/pkgtemplates.jl:6
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:489
 [3] include(x::String)
   @ StartupCustomizer ~/.julia/packages/StartupCustomizer/gNfnf/src/StartupCustomizer.jl:1
 [4] top-level scope
   @ ~/.julia/packages/StartupCustomizer/gNfnf/src/StartupCustomizer.jl:147
 [5] include
   @ Base ./Base.jl:489 [inlined]
 [6] 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, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2216
 [7] top-level scope
   @ stdin:3
in expression starting at /home/lime/.julia/packages/StartupCustomizer/gNfnf/src/modules/pkgtemplates.jl:6
in expression starting at /home/lime/.julia/packages/StartupCustomizer/gNfnf/src/StartupCustomizer.jl:1
in expression starting at stdin:3

Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/.julia/juliaup/julia-1.10.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/Types.jl:69
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{…})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:1577
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ Pkg.API ~/.julia/juliaup/julia-1.10.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ Pkg.API ~/.julia/juliaup/julia-1.10.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1957
  [7] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
  [8] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
  [9] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [11] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [12] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [13] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [14] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [15] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [16] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
Some type information was truncated. Use `show(err)` to see complete types.
abraemer commented 1 year ago

Interesting. Tbh, I haven't tested on any other Julia version than 1.9. I'll look into this. Thanks for the report!

abraemer commented 1 year ago

I pushed a fix and did register a new version. After updating StartupCustomizer.jl it should work now.

On another note: I should probably come up with a way to test this package. Maybe just calling all the functions is enough for a start...