Voice 25: Packaging and CI for voice (#86) #144

Manually merged
charles merged 0 commits from voice-25-packaging-ci into voice 2026-11-12 01:46:27 +00:00
Owner

What

Release packages and CI for the voice stack (Voice plan, Task 25; spec §10).

Clean-machine check in cargo xtask package (xtask/src/package/libs.rs, new). After the release build, package reads the libraries the binary needs before main from the file itself (ELF DT_NEEDED; PE import and delay-import tables, hand-parsed, bounds-checked, no new dependency), prints them (==> xtask package: loads ..., on Windows also delay-loads ...) and fails when one would be missing on a clean machine:

  • Linux: allowed are glibc, GCC's runtime and the declared libasound.so.2. Anything else would have to be bundled, so packaging fails and names it. Today's release binary loads libm.so.6, libasound.so.2, libgcc_s.so.1, libc.so.6, ld-linux-x86-64.so.2; libwebrtc is static.
  • Windows: refused are Visual C++ runtime DLLs, a load-time import of msdmo.dll or opengl32.dll, and any DLL that is neither an API set nor in the build machine's System32. The runner is Windows Server Core, the smallest Windows, so an exe that passes there loads on any Windows 10+.

Windows: the exe loads on Server Core (.cargo/config.toml). Run 161 showed that the voice test binaries die in the loader on the runner: msdmo.dll is missing (libwebrtc's own audio device module imports it). opengl32.dll (wgpu's GL backend, #93) is missing too. Both are now /DELAYLOADed, next to the existing +crt-static:

  • msdmo is never called, because LiveKit uses its own audio device and audio goes through cpal.
  • wgpu LoadLibrarys opengl32 itself first (wgpu-hal 27.0.4 gles/wgl.rs) and reports a missing one as an unavailable backend.

xtask package no longer sets RUSTFLAGS itself; the config applies to both tests and release, and the check refuses an exe built without it. xtask/tests/package.rs therefore no longer skips the launch check on the runner: the packaged exe must run --debug-info and exit 0 there, and must delay-load opengl32.dll.

Linux: the declared audio dependency. libasound.so.2 stays out of the AppImage, as the AppImage excludelist requires, because it must match the system's ALSA plugins. It is declared in four places:

  • AppRun: when ldd reports it missing, prints which package to install (Debian/Ubuntu 22.04, 24.04+, Fedora, Arch) and exits 127.
  • The README install section.
  • The release notes body.
  • LINUX_DECLARED.

Release workflow.

  • The Linux job now installs what webrtc-sys needs (libglib2.0-dev, clang 21, CXX=clang++-21). Before this change the release build could not compile with LiveKit.
  • New job linux-clean: downloads the AppImage from the draft into a bare ubuntu:22.04 that has only libasound2, verifies the checksum, and runs --appimage-extract-and-run --debug-info. publish now waits for it.
  • The Windows job already ran --debug-info on the runner. With the delay-loads it can pass there.

Windows CI disk (#51, #127):

  • CARGO_PROFILE_DEV_DEBUG=line-tables-only on the Windows job.
  • MIN_FREE_GB goes from 30 to 12.
  • New Report disk use step (always runs) prints the size of the target dirs and the free space of every drive.

Numbers behind the threshold:

  • The old threshold of 30 was above what C: ever has (logs of runs 156/161/163: 17.9-22.7 GB free after cleanup), so every run wiped and rebuilt cold.
  • With full debug info a cold voice build does not fit any more. Linux measures ~22 GB for cargo test --workspace (test binaries 450-830 MB each). On the runner C: went from 22.7 GB free to 6.7 GB between runs 161 and 163.
  • With line tables the same cold build is 8.8 GB, plus 2.8 GB for the packaging test's release build (Linux, CARGO_INCREMENTAL=0). 12 GB is therefore "a cold run fits".

Docs: README.md (runtime dependencies, clang 21 / libglib2.0-dev to build), xtask/README.md (package section), header of release.yaml.

Stacked on: voice-13-voice-livekit-interop

How it was tested

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally on the base (5550287) and with this branch.

  • Unit tests in libs.rs:

    • parsers against synthetic ELF64 and PE32+ files (load-time and delay imports);
    • every truncation of the ELF is an error and no truncation of the PE panics;
    • the real test binary (libc on Linux, kernel32 on Windows);
    • the allow and refuse rules for both OSes.
  • xtask/tests/package.rs:

    • the AppImage's loads line names libc and libasound;
    • AppRun with a stand-in ldd exits 127 and names libasound2 when the library is missing, and starts the client with its arguments when it is there;
    • Windows: the exe runs --debug-info with no skip, and the delay-loads line names opengl32.dll.
  • Clean machine, by hand (Docker): built with cargo xtask package --target linux inside ubuntu:22.04, using the release workflow's package list plus clang 21 from apt.llvm.org. The build printed loads libm.so.6, libasound.so.2, libgcc_s.so.1, libc.so.6, ld-linux-x86-64.so.2. Then --appimage-extract-and-run --debug-info in fresh ubuntu:22.04 containers:

    • with nothing installed: AppRun's libasound message, exit 127;
    • with only libasound2 installed: the report (os: ... Ubuntu 22.04.5 LTS, gpu: no adapter found), exit 0.

    The new linux-clean release job repeats this second case.

Deviations / for the reviewer

  • Not verified on Windows from here. No Windows machine is available to this agent. The delay-load flags, the import check against System32 and the --debug-info launch on Server Core are checked only by the Windows runner on this branch. If /DELAYLOAD does not take for an import, the check names the DLL.
  • Windows target-dir size is still not a measured Windows figure (#127). The threshold rests on the Linux measurement and the runner's free-space log lines. The new step prints the real sizes on every run, to retune against.
  • .cargo/config.toml is outside the task's file list. It is where the Windows rustflags already live (#128), and the delay-loads must apply to test binaries as well as the release exe.
  • deny.toml: no change needed (no new crate; cargo deny green).

Closes #86

🤖 Generated with Claude Code

## What Release packages and CI for the voice stack (Voice plan, Task 25; spec §10). **Clean-machine check in `cargo xtask package`** (`xtask/src/package/libs.rs`, new). After the release build, `package` reads the libraries the binary needs before `main` from the file itself (ELF `DT_NEEDED`; PE import and delay-import tables, hand-parsed, bounds-checked, no new dependency), prints them (`==> xtask package: loads ...`, on Windows also `delay-loads ...`) and fails when one would be missing on a clean machine: - Linux: allowed are glibc, GCC's runtime and the declared `libasound.so.2`. Anything else would have to be bundled, so packaging fails and names it. Today's release binary loads `libm.so.6, libasound.so.2, libgcc_s.so.1, libc.so.6, ld-linux-x86-64.so.2`; libwebrtc is static. - Windows: refused are Visual C++ runtime DLLs, a load-time import of `msdmo.dll` or `opengl32.dll`, and any DLL that is neither an API set nor in the build machine's `System32`. The runner is Windows Server Core, the smallest Windows, so an exe that passes there loads on any Windows 10+. **Windows: the exe loads on Server Core** (`.cargo/config.toml`). Run 161 showed that the voice test binaries die in the loader on the runner: `msdmo.dll` is missing (libwebrtc's own audio device module imports it). `opengl32.dll` (wgpu's GL backend, #93) is missing too. Both are now `/DELAYLOAD`ed, next to the existing `+crt-static`: - msdmo is never called, because LiveKit uses its own audio device and audio goes through cpal. - wgpu `LoadLibrary`s opengl32 itself first (wgpu-hal 27.0.4 `gles/wgl.rs`) and reports a missing one as an unavailable backend. `xtask package` no longer sets `RUSTFLAGS` itself; the config applies to both tests and release, and the check refuses an exe built without it. `xtask/tests/package.rs` therefore no longer skips the launch check on the runner: the packaged exe must run `--debug-info` and exit 0 there, and must delay-load `opengl32.dll`. **Linux: the declared audio dependency.** `libasound.so.2` stays out of the AppImage, as the AppImage excludelist requires, because it must match the system's ALSA plugins. It is declared in four places: - `AppRun`: when `ldd` reports it missing, prints which package to install (Debian/Ubuntu 22.04, 24.04+, Fedora, Arch) and exits 127. - The README install section. - The release notes body. - `LINUX_DECLARED`. **Release workflow.** - The Linux job now installs what `webrtc-sys` needs (`libglib2.0-dev`, clang 21, `CXX=clang++-21`). Before this change the release build could not compile with LiveKit. - New job `linux-clean`: downloads the AppImage from the draft into a bare `ubuntu:22.04` that has only `libasound2`, verifies the checksum, and runs `--appimage-extract-and-run --debug-info`. `publish` now waits for it. - The Windows job already ran `--debug-info` on the runner. With the delay-loads it can pass there. **Windows CI disk** (#51, #127): - `CARGO_PROFILE_DEV_DEBUG=line-tables-only` on the Windows job. - `MIN_FREE_GB` goes from 30 to 12. - New `Report disk use` step (always runs) prints the size of the target dirs and the free space of every drive. Numbers behind the threshold: - The old threshold of 30 was above what C: ever has (logs of runs 156/161/163: 17.9-22.7 GB free after cleanup), so every run wiped and rebuilt cold. - With full debug info a cold voice build does not fit any more. Linux measures ~22 GB for `cargo test --workspace` (test binaries 450-830 MB each). On the runner C: went from 22.7 GB free to 6.7 GB between runs 161 and 163. - With line tables the same cold build is 8.8 GB, plus 2.8 GB for the packaging test's release build (Linux, `CARGO_INCREMENTAL=0`). 12 GB is therefore "a cold run fits". Docs: `README.md` (runtime dependencies, clang 21 / `libglib2.0-dev` to build), `xtask/README.md` (package section), header of `release.yaml`. Stacked on: voice-13-voice-livekit-interop ## How it was tested - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally on the base (`5550287`) and with this branch. - Unit tests in `libs.rs`: - parsers against synthetic ELF64 and PE32+ files (load-time and delay imports); - every truncation of the ELF is an error and no truncation of the PE panics; - the real test binary (libc on Linux, kernel32 on Windows); - the allow and refuse rules for both OSes. - `xtask/tests/package.rs`: - the AppImage's `loads` line names libc and libasound; - `AppRun` with a stand-in `ldd` exits 127 and names `libasound2` when the library is missing, and starts the client with its arguments when it is there; - Windows: the exe runs `--debug-info` with no skip, and the `delay-loads` line names `opengl32.dll`. - **Clean machine, by hand (Docker)**: built with `cargo xtask package --target linux` inside `ubuntu:22.04`, using the release workflow's package list plus clang 21 from apt.llvm.org. The build printed `loads libm.so.6, libasound.so.2, libgcc_s.so.1, libc.so.6, ld-linux-x86-64.so.2`. Then `--appimage-extract-and-run --debug-info` in fresh `ubuntu:22.04` containers: - with nothing installed: AppRun's libasound message, exit 127; - with only `libasound2` installed: the report (`os: ... Ubuntu 22.04.5 LTS`, `gpu: no adapter found`), exit 0. The new `linux-clean` release job repeats this second case. ## Deviations / for the reviewer - **Not verified on Windows from here.** No Windows machine is available to this agent. The delay-load flags, the import check against `System32` and the `--debug-info` launch on Server Core are checked only by the Windows runner on this branch. If `/DELAYLOAD` does not take for an import, the check names the DLL. - **Windows target-dir size** is still not a measured Windows figure (#127). The threshold rests on the Linux measurement and the runner's free-space log lines. The new step prints the real sizes on every run, to retune against. - `.cargo/config.toml` is outside the task's file list. It is where the Windows rustflags already live (#128), and the delay-loads must apply to test binaries as well as the release exe. - `deny.toml`: no change needed (no new crate; `cargo deny` green). Closes #86 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(voice): LiveKit room and interop test
Some checks failed
ci / Linux (x86_64) (push) Failing after 50s
ci / Windows (x64) (push) Has been cancelled
6af1f4984b
LiveKitRoom implements Room on the LiveKit Rust SDK: auto-subscribe off, the
endpoint's path prefix kept, one muted microphone track from a native 48 kHz
source (RED on, DTX off, bitrate clamped to 8-510 kbit/s), remote audio from
native audio streams, room events mapped to RoomEvents, round-trip time from
the nominated ICE candidate pair. VoiceSession::livekit starts a session on it.
fluxer_voice::apm wraps WebRTC's audio processing module behind an i16
interface.

The interop tests run against a local livekit-server v1.12.0 behind an in-test
/livekit reverse proxy when FLUXER_LIVEKIT_TESTS=1; cargo xtask ci starts the
server with tools/livekit-test-server.sh. The Linux CI job installs clang 21
and the glib headers the SDK's build needs.

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(voice): keep data that arrives before its sender is announced
Some checks failed
ci / Windows (x64) (push) Has been cancelled
ci / Linux (x86_64) (push) Has been cancelled
2a9d5634c8
The advertisement a participant sends the moment it is connected reached the
others' data channels before its announcement reached their signalling
connections. The SDK reports such a packet without a sender, and the room
dropped it: data_round_trip_on_negotiation_topic failed against
livekit-server v1.12.0 every time. The room now keeps such packets (2 s, 32
packets, 256 KiB at most) and delivers them as the participant announced
next, 150 ms after the announcement and in order with what that participant
sends meanwhile; a second announcement within the 150 ms drops them, because
their sender is then uncertain.

Also:
- tools/livekit-test-server.sh is executable (the CI step runs it directly).
- room_receives_only_subscribed_tracks proves with the connection's received
  bytes (LiveKitRoom::bytes_received) that the server stops sending an
  unsubscribed track.
- New interop test: data sent on ParticipantJoined reaches the newcomer.
- xtask no longer passes the dev server's debug log (tokens included) on to
  the CI log.
- README names the WebRTC build the SDK fetches (webrtc-a545de4).

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(voice): never drop early data whose sender is known
Some checks failed
ci / Windows (x64) (push) Failing after 7m7s
ci / Linux (x86_64) (push) Has been cancelled
10e11040c7
A second arrival within the settle window dropped the whole claim,
including the packets the first newcomer had sent under its own name
while its unnamed ones waited. Only the packets without a sender are in
doubt: the named ones are now delivered at once, in order, when the
claim is given up (second arrival, or the participant leaving).

The round-trip probe moves to a task of its own, so that statistics
that stall (while reconnecting) no longer hold up room events and data.

Refs #74

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
build(windows): link the static C runtime, as libwebrtc does
Some checks failed
ci / Linux (x86_64) (push) Has been cancelled
ci / Windows (x64) (push) Has been cancelled
7c28fba480
The Windows link of fluxer-voice failed with LNK2038 (MT_StaticRelease against
MD_DynamicRelease) and LNK2005 between libcpmt and msvcprt.

Refs #74, #128

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/voice' into voice-13-voice-livekit-interop
Some checks failed
ci / Windows (x64) (push) Failing after 16m53s
ci / Linux (x86_64) (push) Successful in 29m32s
1678f3eb69
Merge remote-tracking branch 'origin/voice' into voice-13-voice-livekit-interop
All checks were successful
ci / Windows (x64) (push) Successful in 25m45s
ci / Linux (x86_64) (push) Successful in 31m19s
555028702d
Refs #86

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build: package voice dependencies
All checks were successful
ci / Linux (x86_64) (push) Successful in 13m11s
ci / Windows (x64) (push) Successful in 14m30s
894d27b536
xtask package reads the libraries the release binary needs at load time
(ELF DT_NEEDED, PE imports and delay imports) and refuses one a clean
machine may lack. Linux declares ALSA's libasound.so.2 (AppRun names the
package to install); Windows delay-loads msdmo.dll and opengl32.dll, which
Server Core lacks, so the exe starts on the runner. The release workflow
installs the LiveKit build requirements and starts the AppImage in a bare
ubuntu:22.04. Windows CI: line-tables-only debug info, MIN_FREE_GB 12 from
the measured cold-build size, and a disk report step.

Refs #86

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Voice 25 (packaging-ci), diff 5550287..894d27b

Plan step check. Linux and Windows both get a clean-machine check (xtask/src/package/libs.rs: ELF DT_NEEDED, PE import and delay-import tables), and xtask/tests/package.rs asserts it. The Windows --debug-info launch is no longer skipped on the runner. The Linux package declares libasound.so.2 in AppRun (exits 127 and names the package), the README and the release notes. The release.yaml linux-clean job starts the AppImage in a bare ubuntu:22.04 that has only libasound2, and publish waits for that job. The Windows cleanup threshold was retuned and a disk report step was added. Commit message build: package voice dependencies matches the plan. This task has no Interfaces block, so no other task's names are affected.

Invariants. No core, UI or crate dependency changes and no deny.toml change; the only new code is xtask code. Every parser read is bounds-checked, and malformed_files_are_errors_not_panics covers truncation and overflow. No tokens appear in code or logs: GITHUB_TOKEN is used only in headers.

Checked by hand:

  • opengl32.dll delay-load: wgpu-hal 27.0.4 gles/wgl.rs Instance::init calls LoadLibraryA("opengl32.dll") and returns an error before the first wglCreateContext, so a missing DLL shows up as an unavailable backend and not as a delay-load exception.
  • msdmo.dll delay-load: webrtc-sys 0.3.53 creates the platform ADM only through AcquirePlatformAdm() (PlatformAudio), and no crate in this repo uses PlatformAudio, so the DLL is never loaded.
  • linux-clean: VERSION is workflow-level env. LINUX_SUMS is the sha256sum line for $NAME, so --check works in the working directory. ${url#*://*/} strips scheme and host as intended. --debug-info starts with fluxer (debug_info.rs:54), so the grep matches.

Findings

  • minor: .forgejo/workflows/ci.yaml MIN_FREE_GB: 12 is based on Linux numbers (8.8 GB debug at line-tables-only plus 2.8 GB release). The plan asks for the Windows target dir to be measured. That is deferred to #127 through the new "Report disk use" step. Windows PDBs and import libs are likely larger, so 12 may be too tight for a cold Windows run. Retune it from the first report.
  • minor: release.yaml linux-clean downloads a draft asset from /attachments/<uuid> with the actions token. Forgejo accepts token auth on attachment downloads, but no run has used this path yet, so it is unverified until the first release dispatch. If it fails, the release stays a draft and nothing is published, so the failure is safe.
  • minor: libs::check_windows checks delay-loaded DLLs only for the load-time case. A future delay-load of a non-system DLL would pass the check and fail at first call. Today the list is only msdmo/opengl32, so this is not a problem now.
  • minor: none of the Windows changes (.cargo/config.toml /DELAYLOAD + delayimp.lib, the un-skipped launch check, the delay-loads assertion) could be run locally. The Windows runner must confirm them, as the implementer says.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh worktree on 894d27b (cold target dir) exited rc=0. tests/package.rs ran 4/4, including package_produces_appimage_on_linux and both apprun_* tests. All 9 libs::tests passed.

Verdict: APPROVE. No blocking findings and local ci is green. The Windows runner still has to confirm the delay-load and launch changes.

🤖 Generated with Claude Code

## Independent review: Voice 25 (packaging-ci), diff 5550287..894d27b **Plan step check.** Linux and Windows both get a clean-machine check (`xtask/src/package/libs.rs`: ELF DT_NEEDED, PE import and delay-import tables), and `xtask/tests/package.rs` asserts it. The Windows `--debug-info` launch is no longer skipped on the runner. The Linux package declares `libasound.so.2` in AppRun (exits 127 and names the package), the README and the release notes. The `release.yaml` `linux-clean` job starts the AppImage in a bare `ubuntu:22.04` that has only `libasound2`, and `publish` waits for that job. The Windows cleanup threshold was retuned and a disk report step was added. Commit message `build: package voice dependencies` matches the plan. This task has no Interfaces block, so no other task's names are affected. **Invariants.** No core, UI or crate dependency changes and no `deny.toml` change; the only new code is xtask code. Every parser read is bounds-checked, and `malformed_files_are_errors_not_panics` covers truncation and overflow. No tokens appear in code or logs: `GITHUB_TOKEN` is used only in headers. **Checked by hand:** - `opengl32.dll` delay-load: wgpu-hal 27.0.4 `gles/wgl.rs` `Instance::init` calls `LoadLibraryA("opengl32.dll")` and returns an error before the first `wglCreateContext`, so a missing DLL shows up as an unavailable backend and not as a delay-load exception. - `msdmo.dll` delay-load: webrtc-sys 0.3.53 creates the platform ADM only through `AcquirePlatformAdm()` (PlatformAudio), and no crate in this repo uses PlatformAudio, so the DLL is never loaded. - `linux-clean`: `VERSION` is workflow-level env. `LINUX_SUMS` is the `sha256sum` line for `$NAME`, so `--check` works in the working directory. `${url#*://*/}` strips scheme and host as intended. `--debug-info` starts with `fluxer ` (debug_info.rs:54), so the grep matches. **Findings** - minor: `.forgejo/workflows/ci.yaml` `MIN_FREE_GB: 12` is based on Linux numbers (8.8 GB debug at line-tables-only plus 2.8 GB release). The plan asks for the Windows target dir to be measured. That is deferred to #127 through the new "Report disk use" step. Windows PDBs and import libs are likely larger, so 12 may be too tight for a cold Windows run. Retune it from the first report. - minor: `release.yaml` `linux-clean` downloads a draft asset from `/attachments/<uuid>` with the actions token. Forgejo accepts token auth on attachment downloads, but no run has used this path yet, so it is unverified until the first release dispatch. If it fails, the release stays a draft and nothing is published, so the failure is safe. - minor: `libs::check_windows` checks delay-loaded DLLs only for the load-time case. A future delay-load of a non-system DLL would pass the check and fail at first call. Today the list is only `msdmo`/`opengl32`, so this is not a problem now. - minor: none of the Windows changes (`.cargo/config.toml` `/DELAYLOAD` + `delayimp.lib`, the un-skipped launch check, the delay-loads assertion) could be run locally. The Windows runner must confirm them, as the implementer says. **Local gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh worktree on 894d27b (cold target dir) exited **rc=0**. `tests/package.rs` ran 4/4, including `package_produces_appimage_on_linux` and both `apprun_*` tests. All 9 `libs::tests` passed. **Verdict: APPROVE.** No blocking findings and local ci is green. The Windows runner still has to confirm the delay-load and launch changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles manually merged commit 53e3d60b8b into voice 2026-11-12 01:46:27 +00:00
Sign in to join this conversation.
No description provided.