[ANN] RunBinary.jl: easily run binaries from YggDrasil

Thanks to BinaryBuilder, some programs are now much easier to install as Julia *_jll packages compared to other solutions. However, simple no-setup ways to run these programs were not available yet to my knowledge.

This is where RunBinary.jl (registered) comes to help. Its API consists of a single macro @run that installs the required jll package in a temporary environment and executes the specified binary:

@run SQLCipher.sqlcipher

A common usecase is to run via CLI:

$ julia -e 'using RunBinary; @run ImageMagick.identify `/path/to/file.jpg`'

For more details and options, see README.

The overhead is just about 2 seconds on my laptop:

$ time julia -e 'using RunBinary; @run HelloWorldC'
Hello, World!
2.20s user 0.86s system 144% cpu 2.116 total

This includes starting julia, creating a new temporary env, instantiating it, and running the target program. It further improves fourfold to 0.5 seconds with --compile=min.


There’s also ygg (see also Announcing ygg), maybe there’s some synergy potential here?

Indeed, @ericphanson pointed me to ygg in slack when I asked about it.
As I understand, ygg's approach is aimed at a somewhat different case of using jll binaries: set up all required programs beforehand, add paths to $PATH, etc.
RunBinary is the alternative for running these programs in a more ad-hoc way with no additional setup needed (only julia + ]add RunBinary), and everything is garbage-collected by Pkg when not in use.
But I agree, in principle there may be some overlap…


Thanks, @ericphanson !

1 Like