self_update
Rust library for updating standalone executables in place from release backends.
Repository Health
Technical Analysis
self_update is a Rust library that lets a standalone executable update itself in place by fetching newer builds from a release distribution backend. It supports GitHub, GitLab, Gitea, and S3-compatible stores (Amazon S3, Google GCS, DigitalOcean Spaces), all exposed through the same configure -> build -> update builder API.
It handles listing releases, downloading the right asset for the current platform, verifying it with checksums and optional signatures, extracting archives (zip/tar with gzip, bzip2, xz, deflate), and replacing the running binary. Optional features add async support, progress bars, and multiple HTTP/TLS backends.
What You Get
UpdateandReleaseListbuilders with a uniform configure -> build -> update API- Backends for GitHub, GitLab, Gitea, and S3-compatible object stores
- Archive extraction for zip and tar with gzip, bzip2, xz, and deflate compression
- Checksum and optional signature verification of downloaded assets
- Optional async, progress-bar, and pluggable HTTP (reqwest/ureq) and TLS backends
Common Use Cases
- Adding a
self-updatecommand to a distributed Rust CLI - Auto-updating agents or daemons from GitHub or S3 releases
- Listing and selecting available releases for a target platform
- Verifying downloads with checksums and signatures before replacing a binary
Under The Hood
Architecture The crate centers on update.rs (the generic Update/ReleaseUpdate state machine) and a backends/ module implementing GitHub, GitLab, Gitea, and S3 release discovery behind a common trait, with supporting modules for version comparison (semver), checksum, TLS selection (tls.rs), an abstracted http_client, archive/compression extraction, and restart.rs for swapping the running binary. macros.rs provides cargo_crate_version!. Tech Stack Rust (2024 edition, MSRV 1.88) with serde/serde_json, semver, and a large matrix of optional cargo features gating reqwest vs ureq, native-tls vs rustls, zip/tar archive and gzip/bzip2/xz/deflate compression, signatures, checksums, async, and progress bars. Code Quality The project is mature and actively developed with ~21 test-bearing modules, docs.rs feature documentation, migration guides, and CI, indicating solid maintenance and testing. API Design / DX The fluent configure -> build -> update builder is ergonomic and consistent across backends; the main friction is choosing the correct feature flags and remembering that defaults are interactive (no_confirm(true) is needed for unattended use), both of which the README documents prominently.