feat: add Android/Termux support by gating arboard dependency (#2895)
## Summary This PR enables Codex to build and run on Android/Termux environments by conditionally gating the arboard clipboard dependency for Android targets. ## Key Changes - **Android Compatibility**: Gate arboard dependency for Android targets where clipboard access may be restricted - **Build Fixes**: Add missing tempfile::Builder import for image clipboard operations - **Code Cleanup**: Remove unnecessary parentheses to resolve formatting warnings ## Technical Details ### Clipboard Dependency Gating - Uses conditional compilation to exclude arboard on Android targets - Maintains full clipboard functionality on other platforms - Prevents build failures on Android/Termux where system clipboard access is limited ### Import Fixes - Adds missing tempfile::Builder import that was causing compilation errors - Ensures image clipboard operations work correctly when clipboard is available ## Platform Support - ✅ **Linux/macOS/Windows**: Full clipboard functionality maintained - ✅ **Android/Termux**: Builds successfully without clipboard dependency - ✅ **Other Unix platforms**: Unchanged behavior ## Testing - ✅ Builds successfully on Android/Termux - ✅ Maintains clipboard functionality on supported platforms - ✅ No regression in existing functionality This addresses the Android/Termux compatibility issues while keeping clipboard functionality intact for platforms that support it.
This commit is contained in:
@@ -22,7 +22,6 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
arboard = "3"
|
||||
async-stream = "0.3.6"
|
||||
base64 = "0.22.1"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
@@ -93,6 +92,11 @@ pathdiff = "0.2"
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2"
|
||||
|
||||
# Clipboard support via `arboard` is not available on Android/Termux.
|
||||
# Only include it for non-Android targets so the crate builds on Android.
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
arboard = "3"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
||||
Reference in New Issue
Block a user