Workspace Documentation
Overview
This document provides a high-level description of the workspace structure, which consists of multiple repositories used to build applications and their dependencies within the Kyber environment.
Each repository follows a consistent structure for build scripts, external dependencies, and third-party software integration. Some repositories depend on others, and certain repositories are designated as "main" repositories responsible for building final applications.
Repository Structure
All repositories in the workspace include the following components:
- Build Scripts: A set of
build-<platform>.shscripts (e.g.,build-linux.sh,build-windows.sh,build-macos.sh) that manage the build process for the repository on specific platforms. externalFolder: Contains git submodules that track internal forks of external dependencies, maintained for project-specific compatibility and modifications.contribFolder: Contains build scripts for third-party software, which can either:- Fetch official sources and apply patches.
- Use forks stored in the
externalfolder.
Key Repositories
The workspace includes the following repositories:
kymux: Implements a network stack using QUIC and WebTransport protocols.libkypc: Provides functionality to spawn processes and establish inter-process communication (IPC).txproto: An open-source streaming solution based on FFmpeg.avserver: Integratestxprotointo the Kyber environment for audio and video streaming.libkynput: Handles input capture and injection across supported platforms, including theinputservercomponent.controller: The server-side main process that processes client requests, utilizingkymux,avserver, andinputserver.libclient: The client-side component of the Kyber stack, integratingkymux,vlc, andlibkynput. Includes a video and audio player for web platforms.kyaudioreg: Used byvlcand thelibclientweb audio player for buffering to maintain low latency and handle audio drift.kywasmtime: Implementstokio::timefor web platforms.
Repository Dependencies
Some repositories depend on others within the workspace. Examples include:
controller: Depends onlibkynputandavserver.libclient: Depends onkymux,vlc, andlibkynput.kyaudioreg: Used byvlcand thelibclientweb audio player.
Dependencies are managed by the build system, which ensures sub-repositories are fetched and built in the correct order.
Main Repositories
The following repositories are designated as "main" repositories, responsible for building final applications:
kyber-desktop: Builds clients for Windows, Linux, and macOS.kyber-web: Builds the web-based client.kyber-android: Builds the Android client (published soon).kyber-ios: Builds the iOS client (published soon).
Each main repository contains a README.md file with detailed instructions specific to that repository.
Responsibilities of Main Repositories
Main repositories handle the following tasks:
-
Fetching Sub-Repositories:
- Retrieve required sub-repositories (e.g.,
kymux,libkynput,avserver) using git submodules or other dependency management mechanisms.
- Retrieve required sub-repositories (e.g.,
-
Generating
.cargo/cargo.toml:- Create a
.cargo/cargo.tomlfile to link shared Rust crates across sub-repositories, ensuring proper dependency resolution.
- Create a
-
Building Sub-Repositories:
- Orchestrate the build process for dependencies, ensuring sub-repositories are built in the correct order.
-
Building the Final Application:
- Compile and package the final application for the target platform(s).
Build Process
The build process for each repository includes the following steps:
-
Execute Platform-Specific Build Script:
- Run the appropriate
build-<platform>.shscript (e.g.,build-linux.sh) for the target platform to handle platform-specific configurations.
- Run the appropriate
-
Handle Third-Party Software:
- Use scripts in the
contribfolder to fetch and build third-party dependencies, either from official sources with patches or from forks in theexternalfolder.
- Use scripts in the
-
Resolve Dependencies:
- Fetch and build sub-repositories in the correct order to satisfy dependency requirements.
-
Build the Repository:
- Compile the repository's code, linking against dependencies as specified in the
.cargo/cargo.tomlfile (for Rust-based projects) or other build configurations.
- Compile the repository's code, linking against dependencies as specified in the
-
Package the Application (Main Repositories Only):
- Package the final application for distribution on the target platform(s).