self_update

Rust library for updating standalone executables in place from release backends.

Library
Cargo
v1.0.0-rc.6
958stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
75/100Good
Development Activity88
Maintenance72
Community52
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture86
Code Quality84
Innovation78
Learning Curve76

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

  • Update and ReleaseList builders 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-update command 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.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search