How do I effectively utilize the "build" step in Julia?

Viewed 205

Per the Julia Docs:

The build step is executed the first time a package is installed or when explicitly invoked with build. A package is built by executing the file deps/build.jl.

Why would I want to make a build.jl file and how do I effectively utilize the benefits it allows for?

1 Answers

Typically (historically) the build step and the build.jl file is used for downloading/installing binary dependencies with e.g. BinaryProvider (or its predecessor BinDeps)1. The build step can also be used to install configuration files. For example, IJulia uses build.jl in order to install a Julia kernel for Jupyter.

If your package is pure Julia code you typically don't have a build.jl file since there is no need for it.


1 With Julia 1.3 we have Artifacts which is meant to replace the BinaryProvider workflow and make build.jl obsolete for the purpose of downloading and installing prebuilt binaries.

Related