30 releases (breaking)

new 0.26.1 Dec 10, 2024
0.26.0 Nov 18, 2024
0.25.0 Oct 23, 2024
0.22.0 Jun 18, 2024
0.1.0 Dec 8, 2021

#78 in Cargo plugins

Download history 151/week @ 2024-08-25 6/week @ 2024-09-01 30/week @ 2024-09-15 93/week @ 2024-09-22 40/week @ 2024-09-29 9/week @ 2024-10-06 152/week @ 2024-10-13 141/week @ 2024-10-20 30/week @ 2024-10-27 28/week @ 2024-11-03 13/week @ 2024-11-10 150/week @ 2024-11-17 24/week @ 2024-11-24 14/week @ 2024-12-01

201 downloads per month

BSD-3-Clause

160KB
3.5K SLoC

libcnb-cargo   Latest Version MSRV

A Cargo command for managing buildpacks written with libcnb.rs.

Installation

cargo install --locked libcnb-cargo

Usage

Currently, there is only one sub-command: package. It allows users to package their Rust buildpack in a spec-compliant manner and helps with cross-compilation.

$ cargo libcnb package --help
Packages a libcnb.rs Cargo project as a Cloud Native Buildpack

Usage: cargo libcnb package [OPTIONS]

Options:
      --no-cross-compile-assistance  Disable cross-compile assistance
      --release                      Build in release mode, with optimizations
      --target <TARGET>              Build for the target triple [default: x86_64-unknown-linux-musl]
      --package-dir <PACKAGE_DIR>    Directory for packaged buildpacks, defaults to 'packaged' in Cargo workspace root
  -h, --help                         Print help

Using it is fairly simple, run cargo libcnb package inside the buildpack's project directory:

$ cargo libcnb package
🚚 Preparing package directory...
🖥️ Gathering Cargo configuration (for x86_64-unknown-linux-musl)
🏗️ Building buildpack dependency graph...
🔀 Determining build order...
🚚 Building 1 buildpacks...
📦 [1/1] Building libcnb-examples/my-buildpack (./)
# Omitting compilation output...
    Finished dev [unoptimized] target(s) in 8.24s
Successfully wrote buildpack directory: packaged/x86_64-unknown-linux-musl/debug/libcnb-examples_my-buildpack (4.09 MiB)
✨ Packaging successfully finished!

💡 To test your buildpack locally with pack, run:
pack build my-image-name \
  --buildpack packaged/x86_64-unknown-linux-musl/debug/libcnb-examples_my-buildpack \
  --trust-extra-buildpacks \
  --path /path/to/application

/Users/example/src/my-buildpack/packaged/x86_64-unknown-linux-musl/debug/libcnb-examples_my-buildpack

Dependencies

~10–21MB
~307K SLoC