I compiled my package, which depends on HDF5.jl
. I compiled it in docker and then use the compiled executable directly in the host machine. It generally works fine, but there is a warning:
┌ Warning: Error requiring `MPI` from `HDF5.Drivers`
│ exception =
│ IOError: stat("/root/.julia/packages/HDF5/HtnQZ/src/drivers/mpio.jl"): permission denied (EACCES)
│ ... something omitted
│ [15] __init__()
│ @ HDF5.Drivers /root/.julia/packages/HDF5/HtnQZ/src/drivers/drivers.jl:92
└ @ Requires /root/.julia/packages/Requires/Z8rfN/src/require.jl:51
The problematic line is very clear:
@require MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" include("mpio.jl")
The reason seems to be simple: the @require
macro make the include happen in run time, when I can no longer get mpio.jl
, because I compile the package in docker but run it in the host machine.
After check, I found Requires.jl
offers a @include
macro, which seems to be fit for the problem.
If this is the case, should every package that currently use @require...include
change to @require...@include
?
There are currently many such packages, like Adapt.jl
, ArrayInterface.jl
, StaticArrayInterface.jl
, MPI.jl
, HDF5.jl
, to name but a few.