Providing Artifacts basics

What is the recommended way to download and extract some binaries and build a simple Julia wrapper package around it? I read the excellent blog post on the artifact system, but it is still unclear how to proceed. In particular:

  • Should I touch binary builder at all? I do not really want to build something, just download and extract.
  • Where should the “build script” live? Just in the main package, or should there be a jll package?

Background

I would like to be able to load and maybe save .dhall files from Julia. Implementing .dhall in Julia is too much work, so I would like to call existing tools, that translate .dhall to JSON under the hood.
So what needs to be done is to download and extract these tools.

2 Likes

This might help:

Oh, I’ve just seen it’s Haskell. Well, we haven’t used BinaryBuilder to build Haskell stuff, the only one who tried so far has been @oxinabox, but I think he had some problems back then

The problem is Stack (a Haskell build tool) won’t work with musl.
( there is an issue on there GitHub, where they are basically like “Yep, its true. Don’t think we will ever have time to fix that”)

@giordano was saying there is now a way to run BinaryBuilder for at least some platforms that does not use musl so that could work.

Thanks for the reply. I think I do not want to build anything at all (Or is there a reason not to simply reuse the binaries provided by the Dhall maintainers?). I think I want something much more simple. Namely download + extract binaries. My question is what is the recommended way to organize this? Will it involve BinaryBuilder/jll/Yggdrasil or do I just add a build script to my package?

Fair enough. So maybe you’re more interested in this discussion:

Examples of packages using Artifacts outside of BinaryBuilder include:

3 Likes

Thanks for the great reply. I loosly followed GitHub - r3tex/ObjectDetector.jl: Pure Julia implementations of single-pass object detection neural networks. and created this

However it fails with e.g.

Unable to automatically install 'dhall' from '/home/travis/build/jw3126/Dhall.jl/Artifacts.toml'

Any ideas how to debug this? Here are the relevant files:

using Pkg.Artifacts
download_artifact(Base.SHA1("f296f1c3f770aaade98d2f1dfa960c89dee06318"), "https://github.com/dhall-lang/dhall-haskell/releases/download/1.30.0/dhall-1.30.0-x86_64-linux.tar.bz2", "79b121880de426ef6a7ffd665e0754c5ad71871d"; verbose=true)
1 Like

Is this also the recommended way to include data with a Package? Currently, I have just included a bunch of XML files in my repo.

This fails, still I don’t know why:

julia> download_artifact(Base.SHA1("f296f1c3f770aaade98d2f1dfa960c89dee06318"), "https://github.com/dhall-lang/dhall-haskell/releases/download/1.30.0/dhall-1.30.0-x86_64-linux.tar.bz2", "79b121880de426ef6a7ffd665e0754c5ad71871d"; verbose=true)
[ Info: Downloading https://github.com/dhall-lang/dhall-haskell/releases/download/1.30.0/dhall-1.30.0-x86_64-linux.tar.bz2 to /tmp/jl_XWc0do-download.bz2...
######################################################################## 100,0%##O#- #                                                                       
false

Sorry, I got the last argument wrong:

download_artifact(Base.SHA1("f296f1c3f770aaade98d2f1dfa960c89dee06318"), "https://github.com/dhall-lang/dhall-haskell/releases/download/1.30.0/dhall-1.30.0-x86_64-linux.tar.bz2", "6845421de9c3cc40f4140a1278c408df8ef49bf8086ee7f37730d2eda8ce9402"; verbose=true)
3 Likes

Yes, with the caveat that this only works with Julia v1.3+

Thanks for all the help, it works now!