I’m making a wrapper for SimpleBLE in Julia and I can’t get it to build targeting windows in BinaryBuilder.jl I suspect because Mingw_jll is too old.
As a result I’ve written the package using pre-built binaries using @ccall and it works pretty well as far as I can tell. SimpleBLE.jl
But when I try to ship it with a local registry to another computer I get an access denied error because the .julia/packages directory has special permissions.
So my question is: Is there a recommended way to ship a package with pre-built binaries that is not BinaryBuilder.jl?
This post is also me begging for help with building SimpleBLE for windows (I got it working for Linux, see this post, but I don’t use Linux). I’ve opened an issue on Yggdrasil for updating MinGW but I just don’t know enough.
Copy the dlls into a named directory inside tempdir() load it with Libc.Libdl.dlopen and then delete the copies.
This must be done inside of the __init__ function of the module to make sure that the library is loaded when the module is.
The directory must be named and made with mkdir because otherwise Julia complains at exit that it can’t delete the tempdir, probably because julia makes temporary copies of the dlls for it self and doesn’t delete them before tempdir clean up.
Even if you’re not using Yggdrasil, I’d strongly advise you to use Artifacts. Instead of putting the hand-built DLLs into the git repository itself, you can put them into a GitHub release asset akin to how BB/Yggdrasil do it. Or ArtifactUtils.jl will help you stash them into Gists.
That is true about how Pkg adds packages, but it’s not the case for artifacts. They are built for this very use case and should preserve the permissions within the tarball.