Skip to content

Packaging

Enoch-199811 edited this page Aug 9, 2026 · 1 revision

Packaging

Compiled products can be bundled into a single distributable package:

bio pack <out.img|.zip> [--entry NAME] <files...>
bio unpack <pkg> [dir]   # extract a package
bio run pkg.img          # run a package directly (executes its entry)
bio run pkg.zip

.img — raw image

A custom raw image format (BIOIMG1, version 2):

  • Small directory header followed by the files' bytes written directly — no compression, fully seekable, extremely fast to pack and run.
  • File permissions are stored — unpacked executables keep their executable bit (older v1 images without the mode field still read fine).

.zip — native STORE

A standard zip archive, written and read natively:

  • No external zip/unzip tools required — works on every platform (including Windows).
  • Uses the STORE method (no compression); unix permission bits are recorded in the external attributes.
  • When the system unzip is present it is used for unpacking, so legacy deflate archives still open.

Entry points

--entry NAME marks which packed file is the runnable entry point (a compiled executable from bio shell build); bio run executes it. For zip packages without an explicit entry, the first file is executed.

Building packages directly

bio build -m produces a complete package in one step — the app binary plus the current platform's CLI and shared runtime:

bio build examples/project -m              # → bin/<project>.img
bio build examples/project -m dist.zip     # → dist.zip

Cross-platform release trees

make bin (via tools/make-dist.sh) cross-compiles release trees for all supported platforms with zig (no foreign SDKs needed):

bin/<platform>/bin/bio(.exe)   launcher (dynamically linked)
bin/<platform>/lib/            shared runtime (libbio.so / bio.dll / libbio.dylib) + deps

Platforms: linux-x86_64, linux-arm64, win32, win64, win-arm64, macos-x86_64, macos-arm64. Requires zig (>= 0.14) on PATH.

Clone this wiki locally