Install midad
midad is a single binary. It needs no runtime, no package manager and no
service. Pick whichever of these fits your machine.
Requirements
| what | needed for |
|---|---|
| nothing | check, run, fmt, vendor, new, bundled build |
a C compiler (cc) |
build --native-all and --native-handlers, which emit C |
| Rust (stable) | installing with cargo install, or building from source |
libsqlite3 at run time |
programs that call db.* (the interpreter loads it with dlopen) |
There is no Node, no Python and no Go in the toolchain. The interpreter and the C backend are one binary.
Prebuilt archives
Every release has four archives, each with a .sha256 next to it:
| archive | needs |
|---|---|
midad-x86_64-unknown-linux-gnu.tar.gz |
glibc 2.34 or newer (Ubuntu 22.04+, Debian 12+) |
midad-aarch64-unknown-linux-gnu.tar.gz |
glibc 2.39 or newer (Ubuntu 24.04+) |
midad-aarch64-apple-darwin.tar.gz |
macOS on Apple silicon |
midad-x86_64-apple-darwin.tar.gz |
macOS on Intel |
Download one from the releases page,
unpack it, and put the binary on your PATH:
$ curl -LO https://github.com/mdexec/midad/releases/download/v0.2.1/midad-x86_64-unknown-linux-gnu.tar.gz
$ curl -LO https://github.com/mdexec/midad/releases/download/v0.2.1/midad-x86_64-unknown-linux-gnu.tar.gz.sha256
$ sha256sum -c midad-x86_64-unknown-linux-gnu.tar.gz.sha256
$ tar xzf midad-x86_64-unknown-linux-gnu.tar.gz
$ install -m 0755 midad ~/.local/bin/midad
With cargo
$ cargo install midad --locked
$ midad --version
midad 0.2.1
This builds the command line from the published crate. One thing it does not
put next to the binary is libmidad_rt.a, the runtime archive the Cranelift
backend links into the executables it builds. The C backend does not need it.
If you want Cranelift builds from a cargo install, build the archive in a
checkout and point MIDAD_RT_A at it:
$ cargo build --release -p midad-rt
$ export MIDAD_RT_A="$PWD/target/release/libmidad_rt.a"
The release archives ship the archive already, so this only affects
cargo install.
With Homebrew
$ brew install mdexec/tap/midad
The tap is mdexec/homebrew-tap and the formula installs the release archive
for your platform.
From a checkout
With Rust stable and, for the C backend, a C compiler:
$ git clone https://github.com/mdexec/midad
$ cd midad
$ sh install.sh
install.sh builds a release binary and copies it to ~/.local/bin, and tells
you if that directory is not on your PATH. PREFIX=/usr/local sh install.sh
puts it somewhere else.
If you would rather keep the build in place:
$ cargo build --release
$ export PATH="$PWD/target/release:$PATH"
Check that it works
$ midad --version
midad 0.2.1
$ midad
midad with no arguments prints its usage and exits with code 2. If you see
the usage, the install worked.
Next: your first program.