rofinn / FilePaths.jl

A type based approach to working with filesystem paths in julia
Other
81 stars 14 forks source link

Swtich from Requires.jl to package extensions #62

Open frankier opened 1 month ago

frankier commented 1 month ago

Might it be possible to switch from Requires.jl to package extensions? These should be faster to precompile.


By the way, I'm actually asking for this because I'm running into a bug. Here it is, however, I'm having trouble making a MWE, and I don't think FilePaths.jl is at fault here.. It may be to do with interactions between Revise and Requires. At any rate, it seems like Requires.jl is heading for deprecation.

ERROR: LoadError: InitError: KeyError: key Base.PkgId(Base.UUID("8fc22ac5-c921-52a6-82fd-178b2807b824"), "FilePaths") not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:477 [inlined]
  [2] macro expansion
    @ ./lock.jl:273 [inlined]
  [3] root_module(key::Base.PkgId)
    @ Base ./loading.jl:2319
  [4] parse_pkg_files(id::Base.PkgId)
    @ Revise ~/.julia/packages/Revise/doDG7/src/loading.jl:49
  [5] watch_package(id::Base.PkgId)
    @ Revise ~/.julia/packages/Revise/doDG7/src/pkgs.jl:349
  [6] add_require(sourcefile::String, modcaller::Module, idmod::String, modname::String, expr::Expr)
    @ Revise ~/.julia/packages/Revise/doDG7/src/pkgs.jl:188
  [7] withnotifications(::Any, ::Vararg{Any})
    @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:70
  [8] (::FilePaths.var"#8#17")()
    @ FilePaths ~/.julia/packages/Requires/Z8rfN/src/require.jl:106
  [9] listenpkg(f::Any, pkg::Base.PkgId)
    @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:20
 [10] macro expansion
    @ ~/.julia/packages/Requires/Z8rfN/src/require.jl:98 [inlined]
 [11] __init__()
    @ FilePaths ~/.julia/packages/FilePaths/ULnpu/src/FilePaths.jl:14
 [12] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1263
 [13] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1251
 [14] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing)
    @ Base ./loading.jl:1195
 [15] _include_from_serialized
    @ ./loading.jl:1152 [inlined]
 [16] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
    @ Base ./loading.jl:1900
 [17] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2378
 [18] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2243
 [19] #invoke_in_world#3
    @ ./essentials.jl:1077 [inlined]
 [20] invoke_in_world
    @ ./essentials.jl:1074 [inlined]
 [21] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2230
 [22] macro expansion
    @ ./loading.jl:2169 [inlined]
 [23] macro expansion
    @ ./lock.jl:273 [inlined]
 [24] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2126
 [25] #invoke_in_world#3
    @ ./essentials.jl:1077 [inlined]
 [26] invoke_in_world
    @ ./essentials.jl:1074 [inlined]
 [27] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2119
during initialization of module FilePaths