I am having a problem that more or less every time I start Julia I run into precompilations that take ages (I can literally have hours each day where Julia is unavailable due to this).
When I do using MyPackage
I get a lot of stuff like this:
? NonlinearSolve
? OrdinaryDiffEqNonlinearSolve
? ModelingToolkit
? OrdinaryDiffEqPDIRK
? OrdinaryDiffEqStabilizedIRK
? OrdinaryDiffEqSDIRK
? OrdinaryDiffEqIMEXMultistep
? OrdinaryDiffEqFIRK
? ModelingToolkit β MTKChainRulesCoreExt
? OptimizationBase β OptimizationMTKExt
? ModelingToolkitStandardLibrary
Which, according to this, seems to indicate:
?
A question mark character indicates that aPrecompilableError
was thrown, indicating that precompilation was disallowed, i.e.__precompile__(false)
in that package.
(Here I am in a folderMyFolder
, which contains a package-folderMypackage
, which I have added using]dev MyPackage
)
This seems to possibly make sense? I.e. all these packages have some PrecompilationError
, meaning that the precompilation fails, which could (maybe?) both explain that it takes lots of time and that I have to keep rerunning precompilation even though I have not updated any package versions.
But how do I actually figure out what is going on? Many of these are fairly normal packages, and it seems unlikely that all of these (e.g. NonlinearSolve, OrdinaryDiffEq, Optimization) all have fundamental problems preventing precompilations. I have searched the packages for __precompile__(false)
statements, but there does not seem to be any.
At the end of precompilation, I get a lot of messages like
β LinearSolve β LinearSolveSparseArraysExt
β β Warning: Module RecursiveArrayTools with build ID fafbfcfd-0513-4542-0020-32fcd9b97709 is missing from the cache.
β β This may mean RecursiveArrayTools [731186ca-8d62-57ce-b412-fbd966d074cd] does not support precompilation but is imported by a module that does.
β β @ Base loading.jl:2541
β β Error: Error during loading of extension RecursiveArrayToolsSparseArraysExt of RecursiveArrayTools, use `Base.retry_load_extensions()` to retry.
β β exception =
β β 1-element ExceptionStack:
β β Error when precompiling module, potentially caused by a __precompile__(false) declaration in the module.
β β Stacktrace:
β β [1] _require(pkg::Base.PkgId, env::Nothing)
β β @ Base ./loading.jl:2603
β β [2] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
β β @ Base ./loading.jl:2388
β β [3] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [4] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [5] _require_prelocked
β β @ ./loading.jl:2375 [inlined]
β β [6] _require_prelocked
β β @ ./loading.jl:2374 [inlined]
β β [7] run_extension_callbacks(extid::Base.ExtensionId)
β β @ Base ./loading.jl:1544
β β [8] run_extension_callbacks(pkgid::Base.PkgId)
β β @ Base ./loading.jl:1576
β β [9] run_package_callbacks(modkey::Base.PkgId)
β β @ Base ./loading.jl:1396
β β [10] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt128)
β β @ Base ./loading.jl:1890
β β [11] _tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String)
β β @ Base ./loading.jl:1956
β β [12] _require(pkg::Base.PkgId, env::String)
β β @ Base ./loading.jl:2594
β β [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
β β @ Base ./loading.jl:2388
β β [14] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [15] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
β β @ Base ./loading.jl:2375
β β [17] macro expansion
β β @ ./loading.jl:2314 [inlined]
β β [18] macro expansion
β β @ ./lock.jl:273 [inlined]
β β [19] __require(into::Module, mod::Symbol)
β β @ Base ./loading.jl:2271
β β [20] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [21] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [22] require(into::Module, mod::Symbol)
β β @ Base ./loading.jl:2260
β β [23] include
β β @ ./Base.jl:557 [inlined]
β β [24] 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::String)
β β @ Base ./loading.jl:2881
β β [25] top-level scope
β β @ stdin:6
β β [26] eval
β β @ ./boot.jl:430 [inlined]
β β [27] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
β β @ Base ./loading.jl:2734
β β [28] include_string
β β @ ./loading.jl:2744 [inlined]
β β [29] exec_options(opts::Base.JLOptions)
β β @ Base ./client.jl:321
β β [30] _start()
β β @ Base ./client.jl:531
β β @ Base loading.jl:1550
β β Warning: Module SciMLBase with build ID fafbfcfd-f59a-ce42-0020-32f7a6c767b1 is missing from the cache.
β β This may mean SciMLBase [0bca4576-84f4-4d90-8ffe-ffa030f20462] does not support precompilation but is imported by a module that does.
β β @ Base loading.jl:2541
β β Error: Error during loading of extension SciMLBaseChainRulesCoreExt of SciMLBase, use `Base.retry_load_extensions()` to retry.
β β exception =
β β 1-element ExceptionStack:
β β Error when precompiling module, potentially caused by a __precompile__(false) declaration in the module.
β β Stacktrace:
β β [1] _require(pkg::Base.PkgId, env::Nothing)
β β @ Base ./loading.jl:2603
β β [2] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
β β @ Base ./loading.jl:2388
β β [3] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [4] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [5] _require_prelocked
β β @ ./loading.jl:2375 [inlined]
β β [6] _require_prelocked
β β @ ./loading.jl:2374 [inlined]
β β [7] run_extension_callbacks(extid::Base.ExtensionId)
β β @ Base ./loading.jl:1544
β β [8] run_extension_callbacks(pkgid::Base.PkgId)
β β @ Base ./loading.jl:1576
β β [9] run_package_callbacks(modkey::Base.PkgId)
β β @ Base ./loading.jl:1396
β β [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
β β @ Base ./loading.jl:2399
β β [11] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [12] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
β β @ Base ./loading.jl:2375
β β [14] macro expansion
β β @ ./loading.jl:2314 [inlined]
β β [15] macro expansion
β β @ ./lock.jl:273 [inlined]
β β [16] __require(into::Module, mod::Symbol)
β β @ Base ./loading.jl:2271
β β [17] #invoke_in_world#3
β β @ ./essentials.jl:1089 [inlined]
β β [18] invoke_in_world
β β @ ./essentials.jl:1086 [inlined]
β β [19] require(into::Module, mod::Symbol)
β β @ Base ./loading.jl:2260
β β [20] include
β β @ ./Base.jl:557 [inlined]
β β [21] 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::String)
β β @ Base ./loading.jl:2881
β β [22] top-level scope
β β @ stdin:6
β β [23] eval
β β @ ./boot.jl:430 [inlined]
β β [24] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
β β @ Base ./loading.jl:2734
β β [25] include_string
β β @ ./loading.jl:2744 [inlined]
β β [26] exec_options(opts::Base.JLOptions)
β β @ Base ./client.jl:321
β β [27] _start()
β β @ Base ./client.jl:531
β β @ Base loading.jl:1550
β β Warning: Module JLLWrappers with build ID fafbfcfd-dacd-7e66-0020-30fb8e2fed08 is missing from the cache.
β β This may mean JLLWrappers [692b3bcd-3c85-4b1f-b108-f13ce0eb3210] does not support precompilation but is imported by a module that does.
β β @ Base loading.jl:2541
β
β OptimizationBase β OptimizationMTKExt
β β Warning: The call to compilecache failed to create a usable precompiled cache file for SciMLBase [0bca4576-84f4-4d90-8ffe-ffa030f20462]
β β exception = Required dependency Base.PkgId(Base.UUID("3cdcf5f2-1ef4-517c-9805-6587b60abb01"), "RecipesBase") failed to load from a cache file.
β β @ Base loading.jl:2596
β
β Latexify β DataFramesExt
β β Warning: The call to compilecache failed to create a usable precompiled cache file for PrettyTables [08abe8d2-0d0c-5749-adfa-8a2ac140af0d]
β β exception = Required dependency Base.PkgId(Base.UUID("bd369af6-aec1-5ad0-b16a-f7cc5008161c"), "Tables") failed to load from a cache file.
β β @ Base loading.jl:2596
β
β OptimizationOptimisers
β β Warning: The call to compilecache failed to create a usable precompiled cache file for PrettyTables [08abe8d2-0d0c-5749-adfa-8a2ac140af0d]
β β exception = Required dependency Base.PkgId(Base.UUID("bd369af6-aec1-5ad0-b16a-f7cc5008161c"), "Tables") failed to load from a cache file.
β β @ Base loading.jl:2596
β
β OrdinaryDiffEqRKN
β β Warning: The call to compilecache failed to create a usable precompiled cache file for RecursiveArrayTools [731186ca-8d62-57ce-b412-fbd966d074cd]
β β exception = Required dependency Base.PkgId(Base.UUID("3cdcf5f2-1ef4-517c-9805-6587b60abb01"), "RecipesBase") failed to load from a cache file.
β β @ Base loading.jl:2596
β
β NonlinearSolveBase β NonlinearSolveBaseLineSearchExt
β β Warning: Module RecipesBase with build ID fafbfcfd-0d4e-ed10-0020-311511a516d1 is missing from the cache.
β β This may mean RecipesBase [3cdcf5f2-1ef4-517c-9805-6587b60abb01] does not support precompilation but is imported by a module that does.
β β @ Base loading.jl:2541
β
β NonlinearSolveSpectralMethods β NonlinearSolveSpectralMethodsForwardDiffExt
β β Warning: Module JLLWrappers with build ID fafbfcfd-dacd-7e66-0020-30fb8e2fed08 is missing from the cache.
β β This may mean JLLWrappers [692b3bcd-3c85-4b1f-b108-f13ce0eb3210] does not support precompilation but is imported by a module that does.
β β @ Base loading.jl:2541
β
which might provide some hint. However, checking e.g. GitHub - SciML/RecursiveArrayTools.jl: Tools for easily handling objects like arrays of arrays and deeper nestings in scientific machine learning (SciML) and other applications, there is no mention of __precompile__(false)
.
Generally, would it be possible to a few extensions of some packages like this prevents precompilation for the entire system?
ChatGPT says that unless there are β PackageName
in the precompilation output I should not worry, and things does run properly. However, it is getting increasingly unsistaianble with these really long precompilation times, and I feel I need to figure out what is actually going on.