mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-10 17:10:18 -10:00
fix(build): compile the sleep guard on Android and the other no-op Unixes
The release-candidate android-arm64 build ond5cfae1failed with `function spawn is never used`: Android is Unix but neither macOS nor Linux, so `start_inhibitor` is the no-op arm and nothing calls `spawn`, which `-D warnings` rejects. The helper and the `Command`/`Stdio` imports now carry the same macOS/Linux gate as their only callers; `Child` stays Unix-wide for the field and the Drop. Present on main since919d602(2026-09-19); the last green candidate run predates it. Validation: `cargo fmt --all -- --check` clean; Linux compilation is unchanged. Judged by re-dispatching release-candidate.yml on this head. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0134iUMxmGuXiG1LzPgfZVnv
This commit is contained in:
1 file changed
+6
-2
@@ -28,7 +28,11 @@
|
||||
//! awake forever, which is worse than the problem this solves.
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::process::{Child, Command, Stdio};
|
||||
use std::process::Child;
|
||||
// Only the macOS and Linux inhibitors spawn anything; every other Unix
|
||||
// (Android, the BSDs, illumos) is a no-op and would see these as dead.
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
/// An idle-sleep assertion held for as long as this value lives.
|
||||
pub struct SleepGuard {
|
||||
@@ -105,7 +109,7 @@ fn start_inhibitor() -> Option<Child> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
fn spawn(program: &str, args: &[&str]) -> Option<Child> {
|
||||
Command::new(program)
|
||||
.args(args)
|
||||
|
||||
Reference in new issue
Block a user