proc-daemon 1.1.2

High-performance async daemon framework for Rust services: cross-platform signal handling, graceful shutdown, subsystem lifecycle management, hot-reload config, and structured logging. Tokio-first.
# proc-daemon v1.1.2 — Feature-Matrix CI Fix

**Date:** 2026-05-19
**Compare:** `v1.1.1...v1.1.2`

## Headline

A focused patch fixing a regression introduced by v1.1.1's doctest
refresh, plus three latent build issues exposed by re-running the
feature-matrix CI against the cleaned-up doctests. No public API
changes. No behavior change in any path that builds today.
Consumers can upgrade with `cargo update -p proc-daemon`.

The v1.1.1 doc audit rewrote the lib.rs root doctests to use
`#[tokio::main] async fn main()` so they double-check the canonical
usage pattern. That change is correct under any feature combination
that includes `tokio` (the default), but the
`Feature Testing (console)`, `Feature Testing (metrics)`,
`Feature Testing (json-logs)`, `Feature Testing (async-std)`,
`Feature Testing (async-std metrics)`,
`Feature Testing (async-std console json-logs metrics)`, and
`Feature Testing ` (empty) jobs all run
`cargo test --workspace --no-default-features --features "..."`,
which also runs `--doc` tests. Without `tokio` enabled, the
doctests fail to resolve `tokio` and reject `async fn main`. CI
went red on seven feature combos in
[run 26076349168](https://github.com/jamesgober/proc-daemon/actions/runs/26076349168).

While diagnosing that, two pre-existing bugs in the
runtime-less-but-Windows code path surfaced (only reachable under
`cargo build --no-default-features` on Windows; CI's
feature-test matrix runs on Ubuntu, so it never reached them).
Folded both into this patch.

## What changed

### Fixed — lib.rs doctests are now feature-tolerant

Both `Quick Start` doctests in `src/lib.rs` are wrapped with hidden
`#[cfg(feature = "tokio")]` attributes on the items that reference
`tokio::*`, and a hidden
`#[cfg(not(feature = "tokio"))] fn main() {}` fallback. The
rendered docs are unchanged — users see the canonical
`#[tokio::main] async fn main()` shape. Internally, when the test
is compiled without the `tokio` feature, all the `tokio`-using
items are excluded and only the empty `main()` fallback remains.

```text
//! ```no_run
//! use proc_daemon::{Daemon, ShutdownHandle};
//! …
//! # #[cfg(feature = "tokio")]
//! async fn my_service(…) { … }
//!
//! # #[cfg(feature = "tokio")]
//! #[tokio::main]
//! async fn main() -> proc_daemon::Result<()> { … }
//! # #[cfg(not(feature = "tokio"))]
//! # fn main() {}
//! ```
```

**Migration:** none. End-user docs are unaffected.

### Fixed — `SignalHandler::handle_windows_signals` on no-runtime

`src/signal.rs` declares
`async fn handle_windows_signals(&self) -> Result<()>` with two
cfg-gated bodies (`tokio` and `async-std`). When neither feature
was enabled on Windows, both bodies were excluded, leaving the
function with an empty body that returned `()` instead of
`Result<()>`. Added an explicit
`#[cfg(not(any(feature = "tokio", feature = "async-std")))]`
branch returning `Ok(())` with a comment noting the daemon must be
driven by programmatic shutdown in that configuration.

CI never caught this because `Feature Testing` jobs run on
`ubuntu-latest`, where `cfg(windows)` is `false` and the entire
block is excluded.

**Migration:** none. The bug was unreachable from any tested
configuration; the fix makes the no-runtime / Windows build
compile cleanly for the first time.

### Fixed — missing `Arc` import in async-std Windows path

`src/signal.rs::handle_windows_signals_async_std` referenced
`Arc::new(...)` and `Arc::clone(...)` without `use std::sync::Arc`
in scope. Same blind-spot as above — only reachable under
`cargo build --no-default-features --features "async-std"` on
Windows. Added the import.

### Fixed — unused-variable warnings under runtime-less builds

`subsystem.rs::stop_subsystem`'s `subsystem_name` and
`resources.rs::Drop::drop`'s `handle` are each consumed only by
runtime-gated `#[cfg(feature = "tokio")]` /
`#[cfg(feature = "async-std")]` blocks below their definition.
When neither runtime feature is enabled, the `let` bindings are
unused — clippy/rustc warned, but the warnings didn't fail
builds. Both bindings are now correctly cfg-gated so the
computation is skipped entirely under runtime-less builds.

## Verification

Local matrix (Windows 11, `x86_64-pc-windows-msvc`, Rust 1.95.0):

All seven feature combinations that failed on the v1.1.1 commit
now pass locally:

- `cargo test --doc --no-default-features` ✓ (no features)
- `cargo test --doc --no-default-features --features "console"`- `cargo test --doc --no-default-features --features "metrics"`- `cargo test --doc --no-default-features --features "json-logs"`- `cargo test --doc --no-default-features --features "async-std"`- `cargo test --doc --no-default-features --features "async-std metrics"`- `cargo test --no-default-features --features "async-std console json-logs metrics"` ✓ (38 unit + 5 integration + 5 doctests)

Existing combos continue to pass:

- `cargo test --no-default-features --features "tokio"`- `cargo test --no-default-features --features "tokio metrics"`- `cargo test --no-default-features --features "tokio console json-logs"`- `cargo test --all-features` ✓ (39 unit + 5 integration + 5 doctests)
- `cargo clippy --all-targets -- -D warnings`- `cargo fmt --check`- `cargo audit` ✓ (3 documented allow-listed advisories)
- `cargo doc --no-deps`- `cargo doc --no-deps --no-default-features --features "<docs.rs feature set>"`
## Migration from `1.1.1`

No source-level migration required.
`cargo update -p proc-daemon` is sufficient.

If you opted into v1.1.1 specifically for the docs.rs fix, v1.1.2
is strictly additive — the docs.rs metadata change from v1.1.1 is
unchanged, and docs.rs will build v1.1.2 the same way.

## Stability commitment

`1.1.2` is a patch release. No public surface change. No MSRV
change (stays at `1.82.0`). No dependency change.

## Release ceremony

```bash
git tag -a v1.1.2 -m "Release v1.1.2 — Feature-Matrix CI Fix"
git push origin main
git push origin v1.1.2

cargo publish -p proc-daemon

cargo search proc-daemon | head -3
```

GitHub release title: `v1.1.2 — Feature-Matrix CI Fix`.
Not tagged as pre-release.

---

**Full Changelog:** https://github.com/jamesgober/proc-daemon/compare/v1.1.1...v1.1.2