Skip to content

Build targets

bunpy build --compile --target <os>-<arch> app.py -o dist/myapp

--target is only available with --compile. It cross-compiles the embedded goipy VM for the specified platform.

Supported targets

TargetPlatform
linux-x64Linux, amd64
linux-arm64Linux, ARM64
darwin-x64macOS, Intel
darwin-arm64macOS, Apple Silicon
windows-x64Windows, amd64
windows-arm64Windows, ARM64

Examples

Build for Linux from macOS:

bunpy build --compile --target linux-x64 app.py -o dist/myapp-linux

Build for Windows:

bunpy build --compile --target windows-x64 app.py -o dist/myapp.exe

Build all targets in a loop:

for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 windows-x64; do
  ext=""
  [[ "$target" == windows* ]] && ext=".exe"
  bunpy build --compile --target "$target" app.py -o "dist/myapp-${target}${ext}"
done

File sizes

A “hello world” compiled binary is approximately:

TargetSize
linux-x64~8 MB
darwin-arm64~8 MB
windows-x64~9 MB

Size includes the embedded goipy VM, gocopy compiler, and the Python script.