proc-daemon 1.1.0

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.0.1 — Maintenance & Audit Patch

**Date:** 2026-05-18
**Compare:** `v1.0.0...v1.0.1`

## Headline

A maintenance patch closing the gap between what the `1.0.0`
release notes claimed and what actually shipped, restoring
Windows builds under `--all-features`, clearing the post-release
security advisory backlog, and tuning crate metadata for
crates.io discoverability. No public API changes. MSRV
unchanged at `1.82.0`. Consumers can upgrade with
`cargo update -p proc-daemon`.

Three corrections at the audit boundary fix issues the `1.0.0`
release left on the table:

1. The `pprof` optional dep was declared at the manifest's top
   level instead of being target-gated to `cfg(unix)`. `pprof`
   relies on POSIX libc types (`pthread_t`, `siginfo_t`,
   `ucontext_t`) that don't exist on Windows. As a result,
   `cargo build --all-features` failed to compile on Windows
   with 13 errors inside `pprof`'s sources.
2. The `1.0.0` CHANGELOG advertised a `pprof 0.13 → 0.14.1`
   bump to resolve `RUSTSEC-2024-0408` (unsound
   `std::slice::from_raw_parts` usage). The bump was written
   into the changelog but never applied to `Cargo.toml`. The
   advisory was still active against the published `1.0.0`.
3. Rust 1.95 stabilized two new clippy lints
   (`map_unwrap_or`, `duration_suboptimal_units`) that fire on
   `1.0.0`'s code. The README claims CI runs
   `cargo clippy --all-features --all-targets -- -D warnings`,
   so any toolchain upgrade past 1.94 would turn CI red.

`1.0.1` fixes all three: `pprof` moves under
`[target.'cfg(unix)'.dependencies]`, `pprof` is actually bumped
to `0.14` (clearing `RUSTSEC-2024-0408`), and every new clippy
warning is resolved. On top of the corrections, `1.0.1` ships:

- A refactor of `src/profiling.rs` that splits the
  pprof-backed CPU profiler (Unix-only) from the dhat-backed
  heap profiler (cross-platform).
- 21 latent Windows-feature clippy errors cleaned up —
  raw-pointer borrows replaced with `std::ptr::addr_of_mut!`,
  `as` casts replaced with `u64::from` / `u32::try_from`,
  inlined `format!` args, missing `# Errors` rustdoc sections
  added, attribute ordering corrected on the `windows` IPC
  module. These were never reachable by `1.0.0`'s Linux-only
  CI clippy run.
- A coordinated batch of semver-compatible dependency bumps
  (`tokio` 1.37 → 1.52, `arc-swap` 1.7 → 1.9,
  `parking_lot` 0.12 → 0.12.5, `dashmap` 6.0 → 6.2,
  `once_cell` 1.19 → 1.21, `fastrand` 2.0 → 2.4,
  `proptest` (dev) 1.6 → 1.11).
- Crate metadata tuned for crates.io discoverability —
  description rewritten to lead with "async daemon framework"
  and mention Tokio, `systemd` keyword (misleading; no systemd
  integration) replaced with `async`, `network-programming`
  category (incorrect; no networking code) and
  `development-tools` (too generic) replaced with
  `asynchronous` and `command-line-utilities`.
- An MSRV CI backstop — `indexmap 2.14.0` was published after
  `1.0.0` and requires the `edition2024` Cargo feature which
  Cargo 1.82 cannot parse. The MSRV check now pins
  `indexmap = 2.10.0` after `cargo generate-lockfile`.
- A `Security Audit` CI job correction — the `1.0.0` workflow
  had a malformed step that ran `actions/checkout@v4` instead
  of installing the Rust toolchain.

## What changed

### Fixed — Windows `--all-features` build

`pprof` moved from a top-level optional dep to
`[target.'cfg(unix)'.dependencies]`. The `profiling` feature
still exposes the CPU profiler on Unix; on Windows the feature
is now a no-op as far as code generation is concerned (no
profiler types are exported). `heap-profiling` (dhat) is
unaffected and remains cross-platform.

`src/profiling.rs` refactored: the `CpuProfiler` type now
lives in a `#[cfg(all(feature = "profiling", unix))]` `cpu`
submodule and is re-exported only on Unix. The module
declaration in `src/lib.rs` widened from
`#[cfg(feature = "profiling")]` to
`#[cfg(any(feature = "profiling", feature = "heap-profiling"))]`
so heap profiling is reachable when only `heap-profiling` is
enabled.

**Migration:** none. Consumers who enabled `profiling` on
Windows in `1.0.0` could not build; they will now see the
expected "feature unavailable on this target" experience.

### Fixed — `RUSTSEC-2024-0408` actually resolved

`pprof` bumped `0.13 → 0.14`. The `1.0.0` changelog said this
was already done; it wasn't. Verified by `cargo audit` —
`RUSTSEC-2024-0408` no longer appears in the warning set.

### Fixed — Rust 1.95 clippy lints

Eight warnings cleared:

- `src/config.rs` worker-threads helper — `map(...).unwrap_or(...)`
  `map_or(...)`.
- `src/daemon.rs` rotating-file-writer constructor — same
  pattern.
- `src/config.rs` and `src/subsystem.rs` test code —
  `Duration::from_millis(N_000)``Duration::from_secs(N)`.

### Fixed — latent Windows-feature lints

Twenty-one errors that the `1.0.0` Linux-only CI never reached
have been cleared. The library now passes
`cargo clippy --all-features --all-targets -- -D warnings`
on Windows under the `windows-monitoring` feature.

Key changes in `src/resources.rs` (Win32 ToolHelp / Process
code):

- `&mut local` passed to FFI replaced with
  `std::ptr::addr_of_mut!` to avoid the
  `implicit_borrow_as_raw_pointer` lint.
- `as u32` / `as u64` casts replaced with `u32::try_from` and
  `u64::from` to avoid the `cast_lossless` and
  `cast_possible_truncation` lints.
- `format!("...{}...", x)` inlined to `format!("...{x}...")`
  per `uninlined_format_args`.
- `CloseHandle` return values explicitly bound to `_` rather
  than silently dropped.
- `filetime_to_ns` now takes `FILETIME` by value (8 bytes —
  pass-by-ref was a lint hit).

Key changes in `src/ipc.rs` (Windows named pipes):

- Inner / outer attribute ordering corrected on the `windows`
  IPC module.
- Every `Result`-returning function has a `# Errors` rustdoc
  section.
- Removed the unused `async` qualifier on `connect()` — the
  function is synchronous (`ClientOptions::new().open(...)`).

### Fixed — README accuracy

- Removed broken links to `./dev/release-notes/v1.0.0.md` and
  `CONTRIBUTING.md` — neither file is in-tree.
- Replaced the bogus `cargo unsafe-all-targets` invocation
  (not a real command) with `cargo geiger`.
- Corrected the test-count claim from "46/46" to the actual
  "36 unit + 5 integration" on default features, with a note
  for `--all-features` (39 + 5 + 3 doc tests).
- Install snippets bumped to `proc-daemon = "1.0.1"`.

### Fixed — `Security Audit` CI job

The job had a step labeled `Security audit` that incorrectly
ran `actions/checkout@v4` instead of installing the toolchain.
The Rust toolchain install step never executed, so `cargo
audit` could not be invoked on a properly configured runner.
Corrected to a clean `actions/checkout@v4` → `dtolnay/rust-toolchain@stable`
→ `cargo install cargo-audit` → `cargo audit` sequence.

### Changed — crate metadata

| Field           | Before                                                                       | After                                                                                                                                                                                  |
| --------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description** | "A foundational framework for building high-performance, resilient daemon services in Rust. Handles all the boilerplate for signal handling, graceful shutdown, logging, and configuration." | "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." |
| **Keywords**    | `daemon`, `cross-platform`, `systemd`, `process`, `service`                  | `daemon`, `async`, `cross-platform`, `process`, `service`                                                                                                                              |
| **Categories**  | `os::unix-apis`, `os::windows-apis`, `development-tools`, `network-programming`, `concurrency` | `os::unix-apis`, `os::windows-apis`, `asynchronous`, `concurrency`, `command-line-utilities`                                                                                          |

Rationale: `systemd` was misleading — the crate has no
systemd-specific integration (no `sd_notify`, no socket
activation, no service-unit helpers). `network-programming`
was incorrect — there is no protocol code, no socket
abstraction beyond Unix-domain IPC scaffolding. `asynchronous`
is exactly the right home; `command-line-utilities` is
accurate because daemons are CLI-launched services.

### Changed — dependency bumps (semver-compatible)

| Crate         | From  | To     |
| ------------- | ----- | ------ |
| `tokio`       | 1.37  | 1.52   |
| `arc-swap`    | 1.7   | 1.9    |
| `parking_lot` | 0.12  | 0.12.5 |
| `dashmap`     | 6.0   | 6.2    |
| `once_cell`   | 1.19  | 1.21   |
| `fastrand`    | 2.0   | 2.4    |
| `pprof`       | 0.13  | 0.14   |
| `proptest` *(dev)* | 1.6 | 1.11 |

Major-version bumps (`thiserror 1 → 2`, `metrics 0.17 → 0.24`,
`notify 6 → 8`, `toml 0.8 → 1`, `nix 0.29 → 0.31`,
`windows 0.58 → 0.62`) are deferred to `v2.0.0` because they
touch public error variants and config types.

### Changed — `.cargo/audit.toml` documented

The allowlist now carries a per-entry rationale comment.
`RUSTSEC-2025-0052` (async-std discontinued) and
`RUSTSEC-2024-0384` (instant unmaintained) remain allow-listed
because they still appear in `Cargo.lock` via the optional
`async-std` feature path. `RUSTSEC-2026-0097` (rand soundness
via proptest, dev-only) is newly added since the dev-dep
bumped to a version that pulls in `rand 0.9`. All three
allowances are tagged for removal in `v2.0.0`.

### New — `.dev/V2-ROADMAP.md`

Local-only working document (the `.dev/` directory is
gitignored) tracking the v2.0.0 plan: API modernization
(`async fn` in `Subsystem::run`), the deferred dep majors,
async-std retirement, performance polish enabled by breaking
changes, and CI cleanup.

## Verification

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

- `cargo build` (default features) ✓
- `cargo build --no-default-features --features "tokio toml metrics console json-logs config-watch ipc mimalloc high-res-timing scheduler-hints lockfree-coordination mmap-config heap-profiling full windows-monitoring"`- `cargo build --all-features` (Windows) ✓ — **was failing in `1.0.0`**
- `cargo fmt --check`- `cargo clippy --all-targets -- -D warnings` (default features) ✓
- `cargo clippy --no-default-features --features "tokio toml metrics console json-logs config-watch ipc mimalloc high-res-timing scheduler-hints lockfree-coordination mmap-config heap-profiling full windows-monitoring" --all-targets -- -D warnings`- `cargo doc --no-deps`- `cargo test --all-features`**39 unit + 5 integration + 3 doc tests pass, 0 failed**.
- `cargo audit` ✓ exit 0 (three documented allowed advisories).

CI matrix re-runs on `ubuntu-latest`, `macos-latest`,
`windows-latest` across the feature combinations plus the
dedicated `MSRV Check`, `Security Audit`, `Documentation`,
`Code Quality`, `Miri (Memory Safety)`, and
`Performance Benchmarks` jobs.

## Migration from `1.0.0`

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

- Consumers who enabled `profiling` on Windows in `1.0.0`
  could not build at all. Post-upgrade the feature is
  correctly Unix-gated — the CPU profiler is not exported on
  Windows. If you depended on `proc_daemon::profiling::CpuProfiler`
  in Windows-only code, that code never compiled. Use
  `heap-profiling` (cross-platform, dhat-backed) or a
  Windows-native profiler.
- Downstream audit configs that allow-listed
  `RUSTSEC-2025-0052` or `RUSTSEC-2024-0384` because of this
  crate's tree should keep those entries — they still appear
  in `Cargo.lock` via the optional `async-std` feature path.
- Downstream consumers who pin `pprof` themselves at `0.13`
  for compatibility should bump to `0.14`.

## Stability commitment

`1.0.1` is a patch release per the policy implicit in `1.0.0`:

- **Patch (`1.0.x`)** — bug fixes, security fixes, dep bumps
  inside semver-compatible ranges, doc improvements,
  CI / build / metadata changes. No new public items, no
  removals, no signature changes.
- **Minor (`1.x.0`)** — additions to the public surface, new
  opt-in features, internal performance work that doesn't
  change behavior. MSRV bumps allowed.
- **Major (`2.0.0`)** — anything that removes / renames /
  changes the signature of a public symbol, retires a feature
  flag, or adds a non-opt-in runtime dep.

The next planned patch line continues to be `1.0.x`. A
`1.1.0` minor and a `2.0.0` major are tracked separately —
see `.dev/V2-ROADMAP.md`.

## Release ceremony

```bash
# After the version bump + CHANGELOG + tag prep:
git tag -a v1.0.1 -m "Release v1.0.1 — Maintenance & Audit Patch"
git push origin main
git push origin v1.0.1

# Publish.
cargo publish -p proc-daemon

# Verify the index updated.
cargo search proc-daemon | head -3
```

GitHub release title: `v1.0.1 — Maintenance & Audit Patch`.
Not tagged as pre-release.

---

**Full Changelog:** https://github.com/jamesgober/proc-daemon/compare/v1.0.0...v1.0.1