BinaryBuilder
"Yea, though I walk through the valley of the shadow of death, I will fear no evil"
Quickstart
- Install
BinaryBuilder
Pkg.add("BinaryBuilder")
- Run the wizard.
using BinaryBuilder
BinaryBuilder.run_wizard()
-
The wizard will take you through a process of building your software package. Note that the wizard may need to download a new rootfs image for each platform targeted, and there are about a dozen of these at the time of writing. The output of this stage is a
build_tarballs.jl
file, which will be deployed to GitHub. The wizard will also configure Travis and GitHub releases for your package. -
Once you complete the wizard and your repository is created on GitHub, create a new release on the
GitHub Releases
page and Travis will automatically upload binaries for all platforms to your GitHub release. It will also upload abuild.jl
file that you can use in your Julia package to import the binaries you have just built. -
Not all platforms may be successfully built the first time. Use the iteration workflow described in the
Build Tips
section of the documentation to debug the breaking builds. Push your changes and tag a new release to test the new platforms. -
Once you have a
build.jl
file, you can just drop it into thedeps/
folder of your Julia package and use it just like any otherbuild.jl
file. When it is run throughPkg.build()
, it will generate adeps.jl
file, which records the path of every binary listed as aProduct
during the wizard stage. This allows package startup to be really fast; all your package has to do isinclude("../deps/deps.jl")
(and callcheck_deps()
within__init__()
, see the docs ofBinaryProvider
for more information about this), and it has variables that point to the location of the installed binaries.
For more information, see the documentation for this package, viewable either directly in markdown within the docs/src
folder within this repository, or online.
Usage
This package will help you create a distribution of binary dependencies for your julia package.
Generally this is accomplished using a dependency-specific
buildscript, or build_tarballs.jl
file
(example)
that builds the binary for all platforms. These tarballs are then suitable for
installation using
BinaryProvider.jl
.
Currently we recommend creating a separate GitHub repository for the
build_tarballs.jl
script and using that repository's GitHub Releases
page to
host the binaries. (Examples for
Nettle,
OpenBLAS and
Openlibm)
The contents of the build_tarballs.jl
file is relatively straightforward,
but getting it right can be a little tricky.
Philosophy
Building binary packages is a pain. BinaryBuilder
follows a philosophy that
is similar to that of building Julia itself; when you
want something done right, you do it yourself.
To that end, BinaryBuilder
is designed from the ground up to facilitate the
building of packages within an easily reproducible and reliable environment,
ensuring that the built libraries and executables are deployable to every
computer that Julia itself will run on. Packages are built using a sequence of
shell commands, packaged up inside tarballs, and hosted online for all to enjoy.
Package installation is merely downloading, verifying package integrity and
extracting that tarball on the user's computer. No more compiling on user's
machines. No more struggling with system package managers. No more needing
sudo
access to install that little mathematical optimization library.
We do not use system package managers.
We do not provide multiple ways to install a dependency. It's download and unpack tarball, or nothing.
All packages are cross compiled. If a package does not support cross compilation, fix the package.