Skip to content

Repository files navigation

onelf

Single-binary packaging for Linux. Packs a directory into a self-extracting executable with three execution modes: in-memory (memfd), FUSE mount, and on-disk cache extraction.

The full guide lives at docs/.

Quick example

# Collect shared libraries next to your binary.
onelf bundle-libs ./myapp --strip

# Pack into a single file.
onelf pack ./myapp -o myapp.bin --command bin/myapp

# Run it.
./myapp.bin

Graphical apps pick up GL, DRI, Vulkan, Wayland, and GTK bundling automatically:

onelf bundle-libs ./myapp --strip

Or declare everything in onelf.toml and use onelf build. See docs/guide/recipe.md.

Install

From source:

cargo build --release

The binary lands at target/release/onelf. Building requires a musl gcc for compiling the runtime stub. The build script looks up ONELF_MUSL_CC, CC_x86_64_unknown_linux_musl, and x86_64-linux-musl-gcc / musl-gcc in PATH. On NixOS, nix develop sets all of these up.

To reuse a pre-built runtime (for cargo install etc.), set ONELF_RT_PATH=/path/to/onelf-rt before building.

Project layout

crates/
  onelf/         CLI packer
  onelf-format/  binary format types, no deps
  onelf-rt/      runtime stub, static musl, embedded in packed files

Docs

License

MIT

About

Pack entire directories into self-contained executables

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages