- Rust via
rustup
. x86_64-unknown-linux-musl
Rust target:rustup target add x86_64-unknown-linux-musl
- cargo-make:
cargo install cargo-make
- musl libc
- Linux (Debian):
sudo apt install musl-tools
- MacOS via homebrew-musl-cross:
brew install FiloSottile/musl-cross/musl-cross
- Linux (Debian):
- libssl-dev
- Linux (Debian):
sudo apt install libssl-dev
- MacOS:
brew install openssl
- Linux (Debian):
- pack (for local development)
This buildpack targets x86_64-unknown-linux-musl
as the platform for the buildpack and comes with tooling to support cross-compilation on macOS. It uses libcnb.rs
as the language binding for buildpacks.
To use this buildpack for local development that can be used by pack
, a buildpack dir needs to be made:
$ cargo make pack
This will create a target/
directory that can be passed to pack
. If a default builder hasn't been set, the heroku one can be set:
$ pack config default-builder heroku/buildpacks:20
With the heroku builder image set and from the buildpack directory:
$ pack build <IMAGE NAME> -b heroku/jvm -b heroku/maven -b `target` -p <APP SOURCE DIR>
cargo-make
has the concept of profiles which is how it can choose where to do a "release" build with optimizations for runtime vs. optimizing for build speed.
When packaging up the buildpack the build.sh
script uses this cargo-make
command:
$ cargo make pack --profile production
To run the unit + doc tests:
$ cargo test
Licensed under the MIT License. See LICENSE file.