When a package depends on Oxygen with @oxidise macro and is loaded seperatelly with using MyPackage a following error is raised:
PkgPrecompileError: The following 1 direct dependency failed to precompile:
PeaceFounder [916f7771-afe2-4319-943d-0e770c333432]
Failed to precompile PeaceFounder [916f7771-afe2-4319-943d-0e770c333432] to "/Users/jerdmanis/.julia/compiled/v1.10/PeaceFounder/jl_IwU1FY".
ERROR: LoadError: MethodError: no method matching dirname(::Nothing)
Closest candidates are:
dirname(::AbstractString)
@ Base path.jl:164
Stacktrace:
[1] top-level scope
@ ~/.julia/packages/Oxygen/KbVNY/src/Oxygen.jl:25
[2] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[3] include(x::String)
@ PeaceFounder.Server ~/.julia/packages/PeaceFounder/H5E3m/src/Server/Server.jl:1
[4] top-level scope
@ ~/.julia/packages/PeaceFounder/H5E3m/src/Server/Server.jl:14
[5] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[6] include(x::String)
@ PeaceFounder ~/.julia/packages/PeaceFounder/H5E3m/src/PeaceFounder.jl:1
[7] top-level scope
@ ~/.julia/packages/PeaceFounder/H5E3m/src/PeaceFounder.jl:23
[8] include
@ ./Base.jl:495 [inlined]
[9] 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:2222
[10] top-level scope
@ stdin:3
in expression starting at /Users/jerdmanis/.julia/packages/PeaceFounder/H5E3m/src/Server/Service.jl:1
in expression starting at /Users/jerdmanis/.julia/packages/PeaceFounder/H5E3m/src/Server/Server.jl:1
in expression starting at /Users/jerdmanis/.julia/packages/PeaceFounder/H5E3m/src/PeaceFounder.jl:1
in expression starting at stdin:
This can be resolved by adding Oxygen to the project which is a bit anoying. I think we can resolve this issue if the path to Oxygen library location could be resolved differently with a global variable at compile time or runtime by editing a following line in Oxygen.jl:
global OXYGEN_PATH::String = Base.find_package("Oxygen")
...
include(joinpath(dirname(OXYGEN_PATH), "methods.jl"))
...
This however seems could pose issues when compilation cache is relocated which is also important for my usecase. Thus in situations where this does not work out for currently uknown reasons one could run a hack:
using Oxygen
Oxygen.OXYGEN_PATH = Base.find_package("Oxygen")
using MyPackage
When a package depends on
Oxygen
with@oxidise
macro and is loaded seperatelly withusing MyPackage
a following error is raised:This can be resolved by adding
Oxygen
to the project which is a bit anoying. I think we can resolve this issue if the path to Oxygen library location could be resolved differently with a global variable at compile time or runtime by editing a following line inOxygen.jl
:At compile time it could look something like:
This however seems could pose issues when compilation cache is relocated which is also important for my usecase. Thus in situations where this does not work out for currently uknown reasons one could run a hack:
which hopefully is never necessary.