<div align="center">
# Apex Build π―π¦
_The Apex Cross-Compilator_
**apex** is a Rust cross-compilation tool that simplifies building for multiple targets. Automatic toolchain management, intelligent container usage, and zero-configuration cross-compilation.
</div>
## π― What is apex?
Cross-compilation in Rust shouldn't be painful. **apex** automates the entire process:
- **Detects** what you need automatically
- **Installs** toolchains and dependencies
- **Builds** for any target with one command
- **Uses containers** only when necessary (includes embedded runtime)
## β¨ Features (Planned)
- π― **Zero Configuration** - Works out of the box for most targets
- π§ **Auto-Detection** - Figures out what toolchains you need
- π³ **Smart Containers** - Uses native builds when possible, containers when needed
- β‘ **Fast** - Parallel builds, intelligent caching
- π **Many Targets** - Linux, Windows, macOS, mobile, embedded
- π€ **CI/CD Ready** - Perfect for GitHub Actions, GitLab CI
- π¦ **Embedded Runtime** - No Docker Desktop required (uses youki)
## π§ Status
**Work in Progress** - Early development
Current version: `0.1.0-alpha`
## π Quick Example (Planned API)
```bash
# Initialize cross-compilation for your project
apex init
# Add target platforms
apex target add windows linux macos
# Check what's needed
apex doctor
# β
windows-x86_64: Ready
# β linux-arm64: Missing linker (install: apt install gcc-aarch64-linux-gnu)
# β οΈ macos-aarch64: Requires macOS host for native compilation
# Build for all configured targets
apex build --all
# Build for specific target
apex build --target x86_64-pc-windows-gnu
# Or use as cargo wrapper
apex cargo build --target x86_64-pc-windows-gnu
```
## π¦ Installation
```bash
# Not yet published - coming soon!
cargo install apex
# Or build from source:
git clone https://github.com/yourusername/apex
cd apex
cargo build --release
```
## πΊοΈ Roadmap
### Phase 1: Core (Current)
- [ ] Target detection and validation
- [ ] Toolchain management
- [ ] Basic native cross-compilation
- [ ] Configuration system
### Phase 2: Containers
- [ ] Embedded container runtime (youki)
- [ ] Docker/Podman fallback
- [ ] Image caching
- [ ] Native-first strategy
### Phase 3: Advanced
- [ ] Build profiles (release-all, embedded, mobile)
- [ ] Parallel builds
- [ ] Dependency management (OpenSSL, SQLite, etc.)
- [ ] Custom target definitions
### Phase 4: Integration
- [ ] GitHub Actions integration
- [ ] GitLab CI templates
- [ ] Pre-built binaries distribution
- [ ] GUI/TUI interface
## π― Supported Targets
See [TARGETS.md](TARGETS.md) for the complete list.
**Tier 1 (Native builds):**
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-pc-windows-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
**Tier 2 (Container builds):**
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- x86_64-pc-windows-msvc
- wasm32-unknown-unknown
**Tier 3 (Specialized):**
- Mobile (Android, iOS)
- Embedded (ARM Cortex-M)
## π οΈ How It Works
```
βββββββββββββββββββββββββββββββββββ
β apex build --target windows β
ββββββββββββββ¬βββββββββββββββββββββ
β
βΌ
βββββββββββββββββ
β Can compile β
β natively? β
βββββ¬ββββββββ¬ββββ
β β
YESβ βNO
β β
βΌ βΌ
ββββββββββ ββββββββββββββββββββ
β Native β β Need container? β
β build β β Check deps... β
ββββββββββ ββββββ¬ββββββββββββββ
β
βΌ
βββββββββββββββββ
β Use youki β
β (embedded) β
βββββββββββββββββ
```
## π Usage Examples
### Basic Cross-Compilation
```bash
# Build for Windows from Linux
apex build --target x86_64-pc-windows-gnu
# Build for Linux ARM
apex build --target aarch64-unknown-linux-gnu
# Build for all targets
apex build --all
```
### Configuration File
```toml
# apex.toml
[targets]
default = ["x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu"]
[profiles.release-all]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-gnu",
"x86_64-apple-darwin",
]
[build]
parallel = true
cache = true
[container]
runtime = "auto" # auto, youki, docker, podman
use-when = "target.os != host.os"
```
### CI/CD Integration
```yaml
# .github/workflows/build.yml
name: Cross-Platform Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install apex
run: cargo install apex
- name: Build all targets
run: apex build --all
- name: Upload artifacts
run: apex release --upload
```
## π¨ Design Goals
**Make cross-compilation boring (in a good way):**
- β
**Just Worksβ’** - Sensible defaults for everything
- β
**Fast** - Native when possible, containerized when needed
- β
**Smart** - Detects and suggests solutions automatically
- β
**Transparent** - Shows exactly what it's doing
- β
**Flexible** - Override any behavior when needed
## π Comparison
| **Native builds** | β
First | β | β οΈ Via Zig | β
|
| **Container fallback** | β
| β
| β | β |
| **No Docker required** | β
youki | β | β
| β
|
| **Auto-setup** | β
| β | β οΈ | β |
| **Native deps** | β
Planned | β οΈ | β | β οΈ |
| **CI/CD templates** | β
Planned | β οΈ | β | β |
## π€ Contributing
Contributions welcome! This project is in early stages.
**How to help:**
- π Report issues or suggest features
- π» Submit PRs for bug fixes or features
- π Improve documentation
- π― Test on different platforms
- π§ Add support for new targets
## π License
[MIT](./LICENSE)
## π Acknowledgments
Inspired by:
- [cross](https://github.com/cross-rs/cross) - Container-based cross-compilation
- [cargo-zigbuild](https://github.com/rust-cross/cargo-zigbuild) - Zig linker approach
- [xwin](https://github.com/Jake-Shadle/xwin) - Windows SDK management
- [youki](https://github.com/containers/youki) - Container runtime in Rust
---
**apex** - *The apex cross-compilator for Rust* π―π¦
*Status: π§ Pre-alpha - Architecture planning*
**Star** β this repo to follow development!