Add macOS cross-compilation support for GuruRMM agent

Enables building macOS agents (Intel and Apple Silicon) on Linux server
without requiring Mac hardware. Successfully tested on M3 MacBook Air.

Changes:
- Configure rustls for macOS builds (easier cross-compilation)
- Keep native-tls for Windows/Linux (Windows 7 compatibility)
- Add osxcross linker configuration for both architectures
- Create build-macos.sh script for automated builds
- Document complete setup in MACOS_BUILD.md

Technical Details:
- Build server: 172.16.3.30 (Ubuntu 22.04)
- Toolchain: osxcross 1.5 with macOS SDK 14.5
- Targets: x86_64-apple-darwin, aarch64-apple-darwin
- Binary sizes: ~3.5M (Intel), ~3.1M (ARM64)
- Build time: ~90 seconds per target

Tested: Successfully connected to wss://rmm-api.azcomputerguru.com/ws
Agent ID: 6177bcac-e046-4166-ac76-a6db68a363ab

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 20:03:35 -07:00
parent 459f6b36d5
commit 53cadd0f97
4 changed files with 349 additions and 5 deletions

View File

@@ -19,13 +19,9 @@ tokio = { version = "1", features = ["full"] }
# System information (cross-platform metrics)
sysinfo = "0.31"
# WebSocket client (native-tls for Windows 7/2008R2 compatibility)
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
# WebSocket - futures utilities
futures-util = "0.3"
# HTTP client (fallback/registration) - native-tls for Windows 7/2008R2 compatibility
reqwest = { version = "0.12", default-features = false, features = ["json", "native-tls"] }
# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
@@ -66,6 +62,19 @@ local-ip-address = "0.6"
# Async file operations
tokio-util = "0.7"
# Platform-specific TLS dependencies
[target.'cfg(not(target_os = "macos"))'.dependencies]
# WebSocket client - native-tls for Windows/Linux (Windows 7 compatibility)
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
# HTTP client - native-tls for Windows 7/2008R2 compatibility
reqwest = { version = "0.12", default-features = false, features = ["json", "native-tls"] }
[target.'cfg(target_os = "macos")'.dependencies]
# WebSocket client - rustls for macOS (easier cross-compilation)
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-native-roots"] }
# HTTP client - rustls for macOS
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls-native-roots", "blocking"] }
[target.'cfg(windows)'.dependencies]
# Windows service support (optional, only for native-service feature)
windows-service = { version = "0.7", optional = true }