Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cargo: Add a mostly-static build configuration
Add a "static" feature flag that enables building rusqlite with the "bundled" feature (via the matrix-sdk "bundled-sqlite" one) and using rustls instead of openssl (via the matrix-sdk "rustls-tls" feature). This results in a binary that depends only on the C library (libm, libc) and libgcc: % cargo build --release --no-default-features --features static ... % ls -lh target/release/hebbot -rwxr-xr-x 1 aperez aperez 32M oct 9 21:46 target/release/hebbot* % lddtree target/release/hebbot target/release/hebbot (interpreter => /lib64/ld-linux-x86-64.so.2) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 libm.so.6 => /usr/lib/libm.so.6 libc.so.6 => /usr/lib/libc.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 % This allows running Hebbot from tiny containers, for example using the "static-debian12" provided by the Distroless project [1], which itself takes only about 2 MiB of space. [1] https://github.com/GoogleContainerTools/distroless/
- Loading branch information