Building a Fully Static Linux Executable in 2021

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ripgrep

    ripgrep recursively searches directories for a regex pattern while respecting your gitignore

    Hello everyone. With all the development going on in the Rust compiler, many advice pertaining to outputting a static Linux executable is outdated or replaced by ugly hacks. Many Rust CLI tools distribute static executables, a good example of this is ripgrep (in its musl binary).

  • Cargo

    The Rust package manager

    I was going to say "just use a build.rs script", but it appears to be an issue when --target is specified. Your best bet is keeping your invocation and wrapping it in a shell script or something.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts