-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat: add Android/Termux support and stable file locking #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add missing tempfile::Builder import in clipboard_paste.rs - Remove unnecessary parentheses in chat_composer.rs - Update diff render snapshot for improved line wrapping Fixes compilation error where Builder was used but not imported. Resolves test failures due to updated diff rendering behavior.
I thought this was stable in 1.89? https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#stabilized-apis |
- Remove fd-lock dependency and use stabilized std::fs::File::lock APIs - Fix platform compatibility issues on Windows and Linux gnu targets - Maintain same retry logic and advisory file locking behavior - Fully compatible with Rust 1.89+ stable file locking features
You're absolutely right! Thank you for pointing that out. I initially used I've just updated the implementation in commit 6a29eb8 to use the stabilized standard library APIs ( |
- Use conditional compilation for file locking on Windows - Windows doesn't distinguish between shared/exclusive locks in try_lock_shared - Maintains same retry logic and advisory locking behavior across platforms
@pchuri I just enabled Relatedly, could you please split this into two PRs: one for the file lock stuff and one for gating the |
- Use platform-specific file locking APIs for better Windows compatibility - Unix systems use try_lock_shared() for advisory read locks - Windows systems use try_lock() due to different lock semantics - Remove trailing whitespace to fix cargo fmt violations
@bolinfest Done! I've split this into two separate PRs as requested:
Both PRs are rebased on the latest main branch that includes the uninlined_format_args changes from #2845. This should make the review process much cleaner and faster. Thank you for the guidance on splitting these concerns |
Closing this PR in favor of two separate PRs that address distinct concerns:
This provides cleaner separation of concerns and easier review process as requested by @bolinfest. |
This PR fixes Android/Termux builds and replaces nightly file locking with a stable approach.
Why
Changes
arboard
undercfg(all(unix, not(target_os = "android")))
.clipboard_paste.rs
returning a clearClipboardUnavailable
error.std::fs::File::try_lock()
inmessage_history.rs
for advisory file locks.Technical Details
Android Support
arboard
crate doesn't support Android/Termux, causing compilation failurescfg(all(unix, not(target_os = "android")))
File Locking Migration
std::fs::File::try_lock()
andtry_lock_shared()
(Rust 1.89+)Impact
Validation
just fmt
andjust fix -p codex-core
/-p codex-tui
.cargo test -p codex-tui
: all pass after snapshot update.cargo check --target aarch64-linux-android -p codex-tui
: arboard dependency correctly gated