Building from source
Prerequisites
Rust 1.88 or newer — grammers-mtsender's DNS dependencies require 1.88, which is higher than edition 2024's own 1.85 floor.
rustc --versionThe CLI needs Rust and the platform's C build toolchain; Linux GNU builds also need pkg-config and libdbus-1-dev. The GUI additionally needs Node.js and a package manager, since the interface is built with Vue 3 and Vite.
Building the CLI only
git clone https://github.com/lejunyang/omy.git
cd omy
cargo build --release -p omy-cliThe artifact is target/release/omy (omy.exe on Windows). Note the binary is called omy, not omy-cli.
Static Linux musl CLI
Build on a Debian / Ubuntu host with the same CPU architecture as the target:
sudo apt install build-essential cmake perl musl-tools
target=x86_64-unknown-linux-musl # use aarch64-unknown-linux-musl on an ARM64 host
rustup target add "$target"
export CC=musl-gcc
cargo build --locked --release -p omy-cli --target "$target"The binary is target/<target>/release/omy. Musl targets automatically build and statically link the D-Bus client, without a system libdbus development package. Saving credentials still needs running D-Bus and Secret Service providers. Use musl-gcc only for C dependencies; leave Rust's linker at its default so it uses the bundled CRT. Release CI builds the four GNU / musl targets natively on x86_64 and ARM64 runners and rejects musl binaries with a dynamic loader or shared dependencies.
Building the GUI
cargo build --release -p omy-guiThe build script handles the frontend automatically: when the output is missing it installs dependencies and builds, so a fresh clone works with that one command.
The package manager follows the lockfile
build.rs picks based on which lockfile exists: pnpm-lock.yaml → pnpm, package-lock.json → npm, yarn.lock → yarn. This repository ships pnpm. Mixing them produces two competing dependency trees.
The frontend output (crates/omy-gui/dist/) is not committed — otherwise every frontend change would drag minified JS into the diff. Editing frontend sources and rebuilding picks the changes up (cargo:rerun-if-changed watches src, public, index.html, vite.config.js and package.json).
To work on the frontend directly:
cd crates/omy-gui/frontend
pnpm install
pnpm build # outputs to ../distpnpm dev starts a Vite dev server, but a plain browser has no Tauri IPC, so the interface reports an explicit error. Real development still means cargo run -p omy-gui.
System dependencies per platform
Windows
Verified. Rust and Node suffice — WebView2 ships with the system.
Linux
Not yet verified
The dependencies below come from the official Tauri v2 documentation; omy has not been tested on Linux.
Debian / Ubuntu:
sudo apt update
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-devFedora:
sudo dnf install webkit2gtk4.1-devel openssl-devel gtk3-devel \
libappindicator-gtk3-devel librsvg2-devel
sudo dnf group install "c-development"Tauri v2 requires WebKitGTK 4.1, so the baseline is Ubuntu 22.04 or Debian 12 and newer.
macOS
Verified on Apple Silicon. Xcode Command Line Tools are needed:
xcode-select --installTauri v2 generally needs no extra system packages on macOS.
Cross-checking with zig
If you only have a Windows machine, zig can act as the C cross-compiler so you can cargo check other platforms locally instead of waiting for CI. zig bundles libc for each target plus the macOS SDK headers, so a single executable is enough — no Xcode, no Linux sysroot.
cc-rs invokes CC_<target> as one executable, so zig cc (two words) does not fit; it needs a wrapper. And cc-rs and zig disagree on architecture names: for Apple targets cc-rs passes --target=arm64-apple-macosx, while zig only accepts aarch64 and fails with unknown architecture: 'arm64'. The wrapper has to strip the --target / -arch that cc-rs appends and substitute zig's spelling.
Write the wrapper in Python — not batch, and not pwsh -File. Both mangle -mmacosx-version-min=11.0 into -mmacosx-version-min=11 plus .0, which surfaces as the baffling .0: unrecognized file extension; batch also cannot filter arguments containing = via echo %~1 | findstr. Both were hit in practice.
# zigcc.py
import os, subprocess, sys
ZIG_TARGET = os.environ.get("OMY_ZIG_TARGET", "aarch64-macos")
args, skip = [], False
for a in sys.argv[1:]:
if skip:
skip = False
continue
if a.startswith(("--target=", "-target=")):
continue
if a in ("-target", "--target", "-arch"):
skip = True
continue
args.append(a)
sys.exit(subprocess.run(["zig", "cc", "-target", ZIG_TARGET] + args,
shell=(os.name == "nt")).returncode)cc-rs only accepts an executable, so wrap that in a .cmd (zigcc.cmd):
@echo off
python <path to zigcc.py> %*zigar.cmd is the same idea, containing zig ar %*. Then:
set OMY_ZIG_TARGET=aarch64-macos
set CC_aarch64_apple_darwin=<path to zigcc.cmd>
set AR_aarch64_apple_darwin=<path to zigar.cmd>
cargo check --workspace --all-targets --target aarch64-apple-darwinTo switch targets, change OMY_ZIG_TARGET and the matching CC_<target> variable. Note that zig and Rust spell triples differently: aarch64-apple-darwin → aarch64-macos, x86_64-unknown-linux-gnu → x86_64-linux-gnu.
Measured coverage (zig 0.16.0):
| Target | Result |
|---|---|
aarch64-apple-darwin | ✅ the whole workspace (including omy-gui) checks |
x86_64-apple-darwin | ✅ same |
x86_64-unknown-linux-gnu | ⚠️ core / media / net / cli work, omy-gui does not |
aarch64-linux-android | ❌ unusable, the NDK is still required |
On Linux, omy-gui stops at libdbus-sys: it looks for dbus-1 through pkg-config, and that is a Linux system library, not something a compiler can provide. zig supplies libc, not third-party .so files and headers, so this one needs CI or a real machine.
Android does not work because zig does not bundle Bionic headers: compiling a file that only does #include <string.h> already fails with 'string.h' file not found (for both aarch64-linux-android and the API-qualified aarch64-linux-android.24). Android therefore still requires the NDK's clang — see the next section.
This is only a check, not real-device verification
A cross cargo check catches compile-time problems only — an API that does not exist on macOS, for instance. Runtime behaviour (permissions, the recycle bin, path case sensitivity) can still only be verified on a real machine.
Android
Verified. There are several prerequisites, and the repository ships a checker:
pwsh -NoProfile -File spikes\check-android-env.ps1It reports each missing item and how to obtain it:
| Requirement | How to get it |
|---|---|
| JDK 21 | Comes with Android Studio; keep it aligned with osdk.toml |
Android SDK (ANDROID_HOME points at it) | SDK Manager: Platform 36 + Build-Tools 37.0.0 + Platform-Tools |
Android NDK 29.0.14206865 (NDK_HOME points at it) | SDK Tools → NDK (Side by side) |
| clang inside the NDK | Ships with the NDK |
| Rust targets | aarch64-linux-android, x86_64-linux-android (releases build only these two 64-bit ABIs) |
| tauri-cli | cargo install tauri-cli --version "^2" |
The NDK's clang is the easiest thing to miss
zstd-sys is C code, so cross-compiling requires clang from the NDK. Without it even omy-core fails to build, with an error that looks unrelated to Tauri.
If you see "failed to find tool aarch64-linux-android-clang"
cc-rs looks for aarch64-linux-android-clang without an API level, but since r19 the NDK only ships the versioned wrappers (aarch64-linux-android24-clang and friends). If no other clang is on PATH to fall back to, cross-compilation fails.
Point it at the real compiler (24 matches this project's minSdk):
BIN="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin" # use windows-x86_64 on Windows
export CC_aarch64_linux_android="$BIN/aarch64-linux-android24-clang"
export CC_x86_64_linux_android="$BIN/x86_64-linux-android24-clang"These compilers target ARM64 and x86_64; releases no longer build 32-bit APKs.
Once ready:
osdk run android-release-build # build the frontend and separate ARM64 / x86_64 release APKs
# For interactive development, Tauri can still be invoked directly:
cd crates/omy-gui
cargo tauri android init
cargo tauri android dev # attach a device or emulatorFirst run osdk install rust to install the targets declared in osdk.toml. android-release-build installs the locked frontend dependencies, builds frontendDist, installs the Tauri CLI, then runs cargo tauri android build --apk --target aarch64 x86_64 --split-per-abi. The outputs are in gen/android/app/build/outputs/apk/arm64/release/ and gen/android/app/build/outputs/apk/x86_64/release/, relative to crates/omy-gui. It produces neither 32-bit nor universal APKs and ensures web assets exist before Tauri checks them.
Running the tests
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warningsBoth must pass. clippy forbids unwrap / expect / panic / slice indexing in omy-gui — in cryptography and file handling code a panic becomes data loss or denial of service.
After changing frontend strings, also run:
python spikes\check-i18n-keys.pyIt verifies that every i18n key used in .vue files exists in the string files and that the Chinese and English key sets match. A missing key shows up as a raw key name like remote.readonly in the interface — the build does not fail and tests do not catch it; only eyes do.
A portable FFmpeg for development
pwsh -NoProfile -File scripts\fetch-ffmpeg.ps1Downloads a portable build into tools/ (not committed). omy-media finds it among its candidate directories, so nothing needs installing system-wide.
Building the bundled FFmpeg
The FFmpeg shipped in the Windows release is built by us, not downloaded. The recipe and scripts live in scripts/ffmpeg-build/. Day-to-day development never needs this — only changes to codec coverage do.
# 1. Check the toolchain; it prints the SYSROOT for the next step
pwsh -File scripts\ffmpeg-build\prepare-toolchain.ps1
# 2. Build (about 12.44 MB, with H.264 / HEVC / VP8 / VP9 / AV1)
$env:SYSROOT='...'
bash scripts/ffmpeg-build/build-windows.sh
# 3. Verify the output
bash scripts/ffmpeg-build/verify.sh /tmp/omy-ffmpeg-build/outMSYS2 is not needed on Windows: both the mingw cross compiler and the POSIX build environment come from the osdk.toml at the repository root.
macOS
You need the Xcode Command Line Tools plus brew install pkg-config nasm cmake. Both arches share the same SDK; cross-compiling only switches -arch:
# Native arch (arm64 on Apple Silicon)
bash scripts/ffmpeg-build/build-macos.sh
# Intel: cross-compile on an arm64 machine (the output runs via Rosetta)
ARCH=x86_64 bash scripts/ffmpeg-build/build-macos.sh
# Verify the output (macOS checks otool -L and prints the lipo arch)
bash scripts/ffmpeg-build/verify.sh /tmp/omy-ffmpeg-build/outAfter changing the recipe, run cargo test -p omy-media as well — the warning below holds for every platform.
verify.sh is not optional
Run it whenever the recipe changes. All four problems hit so far (rawvideo, the fd protocol, image_png_pipe, movtext) were cases where configure accepted the argument but did not enable the component, and reported nothing: configure exited 0, make exited 0, hand-written command lines still worked, and only omy's own tests failed.
So "it compiled" is not an acceptance criterion. After verify.sh, run the project's tests against the build as well:
$env:OMY_FFMPEG='<output dir>\ffmpeg.exe'
$env:OMY_FFPROBE='<output dir>\ffprobe.exe'
cargo test -p omy-mediaThe documentation site
cd site
bun install
bun run dev # local preview
bun run build # build into site/dist