RGCC is a robust, distributed compilation utility designed for remote building of C/C++ projects. Engineered with a zero-bloat architecture, it securely offloads the compilation compute from resource-constrained developer environments (e.g., lightweight laptops, Raspberry Pi, or Android/Termux) to a dedicated, high-performance remote build server.
- End-to-End Encryption: AES-256-GCM protects your source code and binaries during transmission.
- Secure Key Exchange (ECDH + HKDF): Dynamic Elliptic-Curve Diffie-Hellman handshake for generating ephemeral session keys without transmitting them over the network.
- Stateless Session Tickets: Server memory is protected from DDoS and memory leaks. The server does not maintain session states in its RAM.
- MITM Protection: Automatic mixing of a Pre-Shared
auth_tokeninto the key derivation process to block Man-In-The-Middle attacks. - Lightweight & Highly Portable: Designed with a minimal footprint to run smoothly on low-power devices like Raspberry Pi, old laptops, or even Android via Termux.
Warning
We intentionally avoided heavy frameworks (like FastAPI or Pydantic) that require complex C/Rust toolchains during installation. If a device can run standard Python, it can run RGCC. [!NOTE] While the server itself is lightweight, compilation speed depends entirely on your project's complexity and the hardware it's running on. Large C++ projects will still take time on mobile CPUs.
To maintain the principles of loose coupling and minimal resource utilization, RGCC is divided into discrete client and server domains via [project.optional-dependencies]. You should only install the components necessary for your specific node.
You can leverage pip to install the package directly into your Python environment without manually synchronizing the repository.
For the Developer Node (Client):
This provisions the global rgcc CLI tool and terminal UI dependencies.
pip install "git+https://github.com/whaiman/remote-compiler.git#egg=remote-compiler[client]"For the Build Node (Server): This provisions the Starlette/Uvicorn server dependencies.
pip install "git+https://github.com/whaiman/remote-compiler.git#egg=remote-compiler[server]"Note: The core cryptography and configuration primitives (shared/) are automatically resolved in both pipelines.
git clone https://github.com/whaiman/remote-compiler.git
cd remote-compiler
# Install specific domains:
pip install ".[client]"
pip install ".[server]"On the dedicated compiling node, start the build server. Ensure gcc, g++, or clang are locally accessible in the system path.
rgcc-serverOn the initial boot, the server drops a server_config.yaml file in the execution directory containing cryptographically secure credentials.
# server_config.yaml
server:
auth_token: <auto-generated-url-safe-base64-token> # <-- Retain this string.
host: 0.0.0.0
port: 4444
# Cross-compilation & Compiler definitions
compilers:
clang++:
default_args: ["-fcolor-diagnostics"]
platforms:
win64:
target: "x86_64-w64-mingw32" # Clang --target override
sysroot: "/usr/x86_64-w64-mingw32" # Clang --sysroot definition
args: ["-static", "-fuse-ld=lld", "-static-libgcc", "-static-libstdc++"]
clang:
platforms:
win64:
target: "x86_64-w64-mingw32"
args: ["-static", "-fuse-ld=lld"]
# ... gcc / g++ toolchains ...Warning
Security Policy Constraint: The server evaluates inbound compilation requests against an internal whitelist of compiler binaries (e.g., gcc, clang). Unrecognized toolchains passed by the client will implicitly fail payload execution to prevent Remote Code Execution (RCE).
On the local machine, trigger a dummy run to generate client_config.yaml or scaffold it yourself.
Establish cryptographic trust by synchronizing the client to the build node:
- Map
endpointto the build server's resolvable IP or FQDN. - Bind the
auth_tokenderived from theserver_config.yaml.
# client_config.yaml
client:
endpoint: http://192.168.1.50:4444
auth_token: <paste-token-from-the-server-here>The CLI recursively tracks local headers and orchestrates the payload.
# Standard compilation using ambient platform defaults
rgcc compile sample/main.cpp
# Target specific output binaries and language standards
rgcc compile sample/main.cpp -o my_renderer --std c++20
# Override target heuristics for cross-compilation (linux -> win64)
rgcc compile sample/main.cpp --platform win64Leverage the TUI to mutate toolchains dynamically and hydrate persistent configuration logic (build.json).
rgcc compile sample/main.cpp -iFor complex topologies, declare state within a JSON-serialized manifest. Generate via rgcc init or interactive mode.
{
"compiler": "clang++",
"standard": "c++20",
"entry_point": "sample/main.cpp",
"output": "main.exe",
"platform": "win64",
"flags": ["-Wall", "-O3", "-static"],
"defines": ["DEBUG=1"]
}Note: Transient lifecycle attributes (SHA-256 checksum logic, UTC chron timestamps, recursive source graphs) are extrapolated natively at runtime to enforce deterministic payloads.
# Abstract syntax evaluation (no linkage)
rgcc compile sample/main.cpp --compile-only
# Local packaging validation (no wire transfer)
rgcc compile sample/main.cpp --dry-runAll resultant compilation artifacts (.out / .exe, SDTOUT logs, telemetry manifests) are automatically pipelined back to the developer node and extracted securely into the local dist/ directory (leveraging TarSlip mitigation).
Contributions are welcomed via standard git workflows. By leveraging structural design patterns (SOLID) and Pythonic rigor, RGCC scales dynamically.
- Fork the repository
- Checkout your feature branch (
git checkout -b feature/RefactorArchitecture) - Commit discrete changes (
git commit -m 'Adopt Domain-Driven Design for compiler backend') - Push (
git push origin feature/RefactorArchitecture) - Open a Pull Request
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
You are free to use, modify, and distribute this software, but any modified version - including versions run over a network - must also be released under the AGPL-3.0 with its full source code made available. See the LICENSE file for details.