Files
VoelinClient/docs/building.md
T
faumarayandClaude Sonnet 5.5 fd6bc19c78 docs: the pin is the tag v0.2.0
CHANGELOG.md, "Unreleased": the line that VoelinProtocol's CHANGELOG offers
consumers when they pin (the sign-out lists a key once, Debug of the
messages prints <redacted> for secrets). docs/building.md names the tag, how
a later release is taken and the spikes' own lock; docs/ci.md and
docs/architecture.md name the three crates and the tag, and ci.md says that
the deploy key, the host key and the read check of the CI step are the same
for a tag. docs/session-seam.md: 17.9 records the move (the commits, the lock
edited by hand and why, what "For consumers" meant for the tests, what ran),
and the four sentences that named the old rev name the tag or the pin of
task 34.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:17:53 +03:00

228 lines
13 KiB
Markdown

# Packages: from releases and built locally
Every platform has installable packages. The release workflow builds them,
and the Dockerfiles in `docker/` build the same kinds of packages on any
machine with Docker. Both use `scripts/package.sh`, so file names and
contents match. CI (`ci.yml`, run by hand only) runs the checks and builds
no packages; the release workflow builds packages without running them.
The packages hold the app, Voelin. The gateway `tsgw` runs on servers and is
packaged for Linux only, separately. `voelinctl` is a development tool and is
in no package (`cargo run -p voelinctl`).
| Platform | Files | Install |
|---|---|---|
| Linux x86_64 | `voelin-<version>-linux-x86_64.tar.gz` | unpack; `bin/voelin` plus desktop file and icon (prefix layout: `tar -xzf … --strip-components=1 -C ~/.local`), libvpx and libdav1d in `lib/`; `bin/voelin-install-deps` installs what comes from the system (FFmpeg, VA-API drivers, PipeWire, the desktop portal, a keyring) with apt, dnf, pacman or zypper |
| | `voelin_<version>_amd64.deb` | `sudo apt install ./voelin_<version>_amd64.deb` (Ubuntu 24.04+, Debian 13+); apt installs the libraries it links and, by default, the recommended FFmpeg, VA-API, PipeWire, portal and keyring packages |
| | `voelin.flatpak` (release workflow only) | `flatpak install --user voelin.flatpak` |
| Linux server | `tsgw_<version>_amd64.deb` | `sudo apt install ./tsgw_<version>_amd64.deb`, then configure and start it ([gateway-admin.md](gateway-admin.md#install)) |
| | `tsgw-<version>-linux-x86_64.tar.gz` | unpack; `bin/tsgw`, the systemd unit and the example config |
| | `tsgw-image.tar.gz` (release workflow only) | `docker load -i tsgw-image.tar.gz` |
| Windows x86_64 | `voelin-<version>-windows-x86_64.zip` | unpack; `voelin.exe` with FFmpeg's LGPL DLLs next to it (libvpx and dav1d are linked in) |
| | `voelin-<version>-setup.exe` | run it (per-machine install, uninstaller in Settings → Apps) |
| Android | `voelin-<version>-android-debug.apk` | `adb install …` or open it on the phone (arm64-v8a and x86_64) |
| | `voelin-<version>-android-release.apk` | only with signing configured ([release.md](release.md#android-apk-signing)) |
Each package run also writes `SHA256SUMS-<platform>`. Nothing is code-signed
yet: Windows SmartScreen warns about the installer, and the debug APK is
signed with a debug key (fine for testing, not for the Play Store).
The gateway's image can also be built directly:
`docker build --ssh default -f crates/voelin-gateway/Dockerfile -t tsgw .`
(`--ssh default`: see [Locally with Docker](#locally-with-docker)).
Gitea at [git.faumaray.ru](https://git.faumaray.ru) builds the same package
types through `.gitea/workflows/release.yml`: manual runs produce one
`voelin-packages` artifact; `v*` tag pushes also attach the packages to a
draft release. Windows packages there use MinGW rather than MSVC. See
[Gitea releases](release.md#gitea-releases) for signing and publishing,
and [runner setup](ci.md#gitea-release-runner) for host requirements.
## From releases
`.github/workflows/release.yml` builds every package:
- **A version tag** `v*` (`git tag -s v0.2.0 && git push origin v0.2.0`): the
packages and a `SHA256SUMS` are attached to a **draft** GitHub release once
every package is built (no checks run; run CI by hand first); review and
publish it by hand ([release.md](release.md#checklist)).
- **By hand**, for a build to test without a release: Actions → Release → Run
workflow (or `gh workflow run release.yml --ref <branch>`). The packages are
uploaded as artifacts, kept for 90 days: `voelin-linux-x86_64` (the app's and
the gateway's Linux packages), `voelin-windows-x86_64`,
`voelin-flatpak-x86_64`, `voelin-android` and `tsgw-image`.
```sh
gh workflow run release.yml --ref main
gh run list --workflow release.yml --limit 3
gh run download <run id> --dir dist
```
The Windows packages use the MSVC toolchain, libvpx and dav1d from vcpkg, and
FFmpeg's LGPL shared build from BtbN/FFmpeg-Builds
(`scripts/fetch-ffmpeg-windows.sh`, checked against the release's checksums). The
Android job builds a signed release APK only when the repository has the
signing secrets (`ANDROID_KEYSTORE_BASE64`, `VOELIN_SIGNING_STORE_PASSWORD`,
`VOELIN_SIGNING_KEY_ALIAS`, `VOELIN_SIGNING_KEY_PASSWORD`).
`.github/workflows/docker.yml` builds the Docker files below for every
release tag and by hand (Actions → Docker builds → Run workflow), and uploads
their output as `docker-linux`, `docker-windows` and `docker-android`.
## Locally with Docker
Needs Docker 23+ (BuildKit) or Docker Desktop, and about 15 GB of free disk
per platform (toolchains plus the build cache). From the repository root:
```sh
scripts/docker-build.sh linux # → dist/linux/
scripts/docker-build.sh windows # → dist/windows/
scripts/docker-build.sh android # → dist/android/
scripts/docker-build.sh # all three
```
The same with plain Docker, e.g. `docker build --ssh default -f docker/linux.Dockerfile -o dist/linux .`.
**The builds need an ssh-agent that holds a key able to read the private
VoelinProtocol repository** ([below](#depending-on-voelinprotocol)): Cargo
fetches it inside the image, through the agent that `--ssh default` hands to the
build. The key stays in the agent; it is not copied into the image or the build
cache. `scripts/docker-build.sh` passes `--ssh default` itself and stops with a
message when `ssh-add -l` shows no agent or no key (`eval "$(ssh-agent -s)"`,
then `ssh-add` your key). The server's host key comes from
`.gitea/known_hosts` ([ci.md](ci.md#voelinprotocol-access)).
Rebuilds are incremental: the cargo registry, `target/` and Gradle live in
BuildKit cache mounts (`docker builder prune` frees them).
| Dockerfile | Builds | Notes |
|---|---|---|
| `docker/linux.Dockerfile` | the app's and the gateway's `.tar.gz` and `.deb` on Ubuntu 24.04 | the binaries need glibc 2.39+ and the libraries the `.deb` lists |
| `docker/windows.Dockerfile` | `.zip` and the NSIS installer | cross-compiled for `x86_64-pc-windows-gnu` with mingw-w64 and static libvpx and dav1d, FFmpeg's LGPL DLLs alongside; works on Windows 10 and 11 |
| `docker/android.Dockerfile` | debug APK | SDK, NDK and cargo-ndk as in CI; `--build-arg ABIS=arm64-v8a,x86_64,armeabi-v7a` picks the ABIs |
Options go after the platform, straight to `docker build`:
```sh
scripts/docker-build.sh android --build-arg ABIS=arm64-v8a
scripts/docker-build.sh android --build-arg APK=release \
--secret id=keystore,src=release.jks --secret id=signing,src=signing.env
```
For the signed release APK, `signing.env` holds `VOELIN_SIGNING_STORE_PASSWORD=…`,
`VOELIN_SIGNING_KEY_ALIAS=…` and `VOELIN_SIGNING_KEY_PASSWORD=…`. Secrets are not
stored in the image or the build cache.
**Behind a proxy:** `scripts/docker-build.sh` passes `HTTPS_PROXY`,
`HTTP_PROXY` and `NO_PROXY` on to the build and uses host networking when
the proxy is on localhost. If the proxy inspects TLS, set
`BUILD_CA_CERT=/path/to/proxy-ca.pem` so the builds trust it.
## Locally without Docker
- **Rust:** 1.95, the channel `rust-toolchain.toml` pins; `rustup` installs it
on the first `cargo` run in the checkout. The workspace's `rust-version` is
1.95 too, the oldest Rust the GPUI front end's libraries build with (they
call `std::hint::cold_path`, stable since 1.95.0), so a distribution's older
`rustc` does not build the workspace.
- **Linux:** the packages from the table above need
`sudo apt install libasound2-dev libfontconfig1-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb1-dev libvpx-dev libdav1d-dev libpipewire-0.3-dev libspa-0.2-dev libclang-dev cmake dpkg-dev patchelf`,
then `cargo build --release --locked -p voelin-ui -p voelin-gateway`
and `scripts/package.sh linux`.
- **The GPUI front end** (`cargo build -p voelin-gpui --release`, under construction,
in no package yet) builds with the same development packages, which include
`libxkbcommon-x11-dev` and `libxcb1-dev` (it links `libxkbcommon-x11` and
`libxcb`, as `readelf -d` on the binary shows; the list above did not have
their development packages before). At run time it needs those libraries installed, opens `libwayland-client`,
the Vulkan loader (`libvulkan.so.1`) and `libEGL.so.1` by name, and draws
through wgpu: a Vulkan driver (Mesa's RADV, ANV or NVK, NVIDIA's) or OpenGL,
and in a virtual machine or a remote desktop Mesa's lavapipe
(`mesa-vulkan-drivers`) in software. X11 needs a window manager for
fullscreen and close requests.
- **Windows:** [packaging/windows/README.md](../packaging/windows/README.md)
(MSVC, vcpkg libvpx and dav1d, NSIS), then
`bash scripts/fetch-ffmpeg-windows.sh ffmpeg && FFMPEG_DLL_DIR=ffmpeg bash scripts/package.sh windows`
from Git Bash.
- **Android:** [android.md](android.md) (SDK, NDK, cargo-ndk), then
`cd android && ./gradlew assembleDebug` and `scripts/package.sh android`.
- **Flatpak:** [packaging/README.md](../packaging/README.md#flatpak).
On a trusted machine with rootful Docker,
`scripts/flatpak-build.sh` writes `dist/flatpak/voelin.flatpak` using the
release builder image. It requires a privileged container for Flatpak's
nested sandbox; do not use it on an untrusted build host.
## Depending on VoelinProtocol
`voelin-store` uses `voelin-identity` (the identity blobs, the account-bound
`KeyStore` and the sign-out rules), `voelin-core` uses `voelin-proto` (the
session seam `voelin_proto::link` and the v1 messages), and almost every
crate uses `voelin-model` (the domain model and the replica of the protocol's
entities), all from the **private** VoelinProtocol repository, as Cargo git
dependencies in the workspace `Cargo.toml`:
```toml
[workspace.dependencies]
voelin-identity = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", tag = "v0.2.0" }
voelin-proto = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", tag = "v0.2.0" }
voelin-model = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", tag = "v0.2.0" }
```
They are pinned by the protocol's release tag, all three at the same one
(`v0.2.0` is the first tag with the protocol crates; VoelinProtocol's README,
"Releases", says how to pin, and its `CHANGELOG.md`, "For consumers", what a
move changes). Moving to a newer release means changing the `tag` of all three,
making what its "For consumers" list asks of this repository, and committing
the resulting `Cargo.lock` together with `THIRD_PARTY_NOTICES.md`, which
`scripts/notices.sh` regenerates (the CI notices job fails on a stale one). The
lock then has one revision of each crate, and `spikes/gpui/Cargo.toml` pins
`voelin-model` at the same tag with a lock of its own.
Cargo fetches it over SSH, so the machine needs an SSH key that can read
VoelinProtocol (an `ssh-agent` or a `~/.ssh/config` entry for
`git.faumaray.com`); if Cargo's built-in git client cannot use your SSH setup,
set `net.git-fetch-with-cli = true` in `~/.cargo/config.toml`.
`voelin-identity` builds AWS-LC from source (`aws-lc-sys`), which needs a C
compiler (gcc or clang) and cmake.
`deny.toml` allows this one git source.
**CI and the Docker builds read it with a read-only SSH deploy key.** The key
is registered on VoelinProtocol and stored as the repository secret
`VOELIN_PROTOCOL_DEPLOY_KEY`; the Gitea workflows write it to `~/.ssh` (CI) or
load it into an ssh-agent (release builds), the server's host key comes from the
committed `.gitea/known_hosts`, and Cargo is told to fetch with the system git
(`CARGO_NET_GIT_FETCH_WITH_CLI=true`) because its built-in git client ignores
`~/.ssh/config`. The Docker builds use the same key through
`docker build --ssh default` (see above). What was set up, how to re-check the
host key's fingerprint and what each failure means:
[ci.md](ci.md#voelinprotocol-access). A runner of your own gets the same setup
from the workflows; the alternative to a deploy key is an access token (rewrite
the SSH URL to HTTPS with
`git config --global url."https://<token>@git.faumaray.com/".insteadOf ssh://gitea@git.faumaray.com/`
and set `CARGO_NET_GIT_FETCH_WITH_CLI=true`), which these workflows do not
use. More in VoelinProtocol's `docs/development.md` ("Depending on
VoelinProtocol").
### Working with a sibling VoelinProtocol checkout
To change the protocol and this client together, check VoelinProtocol out next
to this repository (`Projects/Voelin/VoelinProtocol` beside
`Projects/Voelin/VoelinClient`) and redirect the git dependency to it with a
per-developer `.cargo/config.toml` in the root of this repository:
```toml
# VoelinClient/.cargo/config.toml (per developer, never committed)
[patch."ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git"]
voelin-identity = { path = "../VoelinProtocol/crates/voelin-identity" }
voelin-proto = { path = "../VoelinProtocol/crates/voelin-proto" }
voelin-model = { path = "../VoelinProtocol/crates/voelin-model" }
```
- Relative paths in a Cargo config file resolve from the directory that
contains `.cargo`, so `../VoelinProtocol` is the sibling checkout. (A git
worktree of this repository, such as `.wt/<name>`, uses the matching number
of `../` or an absolute path.)
- The URL must be spelled exactly as in the workspace `Cargo.toml`.
- `/.cargo/` is in `.gitignore`: the file is yours and is never committed.
- With the patch active Cargo rewrites `Cargo.lock` (the patched crates lose
their git `source`). Do not commit that: run `git checkout Cargo.lock` before
committing, or remove the file and run `cargo update -p voelin-identity -p voelin-proto -p voelin-model`
after changing the `rev` (for all three crates). CI builds with `--locked` and has no patch.