I have the following code here, where I define 2 package extensions: BrillouinSpglibExt & PeriodicTableExt. However, I can run the extension BrillouinSpglibExt but not the PeriodicTableExt. I met the following errors when running the latter:
julia> using PeriodicTable
(@v1.10) pkg> activate .
Activating project at `~/.julia/dev/CrystallographyBase`
julia> using CrystallographyBase
[ Info: Precompiling PeriodicTableExt [2e94639d-d7d3-5599-a54d-7c6405eaa55c]
ERROR: LoadError: ArgumentError: Package PeriodicTableExt does not have CrystallographBase in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
to ensure all packages in the environment are installed.
- Or, if you have PeriodicTableExt checked out for development and have
added CrystallographBase as a dependency but haven't updated your primary
environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with PeriodicTableExt
Stacktrace:
[1] macro expansion
@ Base ./loading.jl:1770 [inlined]
[2] macro expansion
@ Base ./lock.jl:267 [inlined]
[3] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[4] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[5] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[6] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
[7] include
@ Base ./Base.jl:489 [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, UInt128}}, source::Nothing)
@ Base ./loading.jl:2216
[9] top-level scope
@ stdin:3
in expression starting at ~/.julia/dev/CrystallographyBase/ext/PeriodicTableExt.jl:1
in expression starting at stdin:3
β Error: Error during loading of extension PeriodicTableExt of CrystallographyBase, use `Base.retry_load_extensions()` to retry.
β exception =
β 1-element ExceptionStack:
β Failed to precompile PeriodicTableExt [2e94639d-d7d3-5599-a54d-7c6405eaa55c] to "~/.julia/compiled/v1.10/PeriodicTableExt/jl_4GNDST".
β 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:2468
β [3] compilecache
β @ Base ./loading.jl:2334 [inlined]
β [4] (::Base.var"#967#968"{Base.PkgId})()
β @ Base ./loading.jl:1968
β [5] mkpidlock(f::Base.var"#967#968"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
β @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:92
β [6] #mkpidlock#6
β @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:87 [inlined]
β [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
β @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:110
β [8] #invokelatest#2
β @ Base ./essentials.jl:889 [inlined]
β [9] invokelatest
β @ Base ./essentials.jl:884 [inlined]
β [10] maybe_cachefile_lock(f::Base.var"#967#968"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
β @ Base ./loading.jl:2978
β [11] maybe_cachefile_lock
β @ Base ./loading.jl:2975 [inlined]
β [12] _require(pkg::Base.PkgId, env::Nothing)
β @ Base ./loading.jl:1964
β [13] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
β @ Base ./loading.jl:1806
β [14] #invoke_in_world#3
β @ Base ./essentials.jl:921 [inlined]
β [15] invoke_in_world
β @ Base ./essentials.jl:918 [inlined]
β [16] _require_prelocked
β @ Base ./loading.jl:1797 [inlined]
β [17] _require_prelocked
β @ Base ./loading.jl:1796 [inlined]
β [18] run_extension_callbacks(extid::Base.ExtensionId)
β @ Base ./loading.jl:1289
β [19] run_extension_callbacks(pkgid::Base.PkgId)
β @ Base ./loading.jl:1324
β [20] run_package_callbacks(modkey::Base.PkgId)
β @ Base ./loading.jl:1158
β [21] __require_prelocked(uuidkey::Base.PkgId, env::String)
β @ Base ./loading.jl:1813
β [22] #invoke_in_world#3
β @ Base ./essentials.jl:921 [inlined]
β [23] invoke_in_world
β @ Base ./essentials.jl:918 [inlined]
β [24] _require_prelocked(uuidkey::Base.PkgId, env::String)
β @ Base ./loading.jl:1797
β [25] macro expansion
β @ Base ./loading.jl:1784 [inlined]
β [26] macro expansion
β @ Base ./lock.jl:267 [inlined]
β [27] __require(into::Module, mod::Symbol)
β @ Base ./loading.jl:1747
β [28] #invoke_in_world#3
β @ Base ./essentials.jl:921 [inlined]
β [29] invoke_in_world
β @ Base ./essentials.jl:918 [inlined]
β [30] require(into::Module, mod::Symbol)
β @ Base ./loading.jl:1740
β [31] eval
β @ Core ./boot.jl:383 [inlined]
β [32] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
β @ REPL ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:150
β [33] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
β @ REPL ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:246
β [34] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
β @ REPL ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:231
β [35] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
β @ REPL ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:389
β [36] run_repl(repl::REPL.AbstractREPL, consumer::Any)
β @ REPL ~/.julia/juliaup/julia-1.10.0-beta2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:375
β [37] (::Base.var"#1012#1014"{Bool, Bool, Bool})(REPL::Module)
β @ Base ./client.jl:432
β [38] #invokelatest#2
β @ Base ./essentials.jl:887 [inlined]
β [39] invokelatest
β @ Base ./essentials.jl:884 [inlined]
β [40] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
β @ Base ./client.jl:416
β [41] exec_options(opts::Base.JLOptions)
β @ Base ./client.jl:333
β [42] _start()
β @ Base ./client.jl:552
β @ Base loading.jl:1295
What is wrong with my package extension implementation?
It seems to be OK to extension functions defined in my main package CrystallographyBase as indicated in the official documentation.
julia> versioninfo()
Julia Version 1.10.0-beta2
Commit a468aa198d0 (2023-08-17 06:27 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 10 Γ Apple M1 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 on 8 virtual cores