Skip to content

Conversation

@einrobin
Copy link
Contributor

Since sd-notify uses unix stuff, it's not possible to build it on anything that's not unix. This PR adds cfg(unix) where sd-notify is being used.

Tested the moq-relay on Debian 13 in a systemd service to verify it's still working.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 27, 2025

Walkthrough

Changes across rs/hang-cli and rs/moq-relay configure systemd readiness notifications for Unix platforms only. In Cargo.toml files, the sd-notify dependency is relocated from the general dependencies section to target-specific cfg(unix) dependencies. Correspondingly, source files apply #[cfg(unix)] conditional compilation attributes to systemd notification calls in client.rs, server.rs, and main.rs, ensuring the notification code compiles exclusively on Unix-like systems.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding platform-specific conditional compilation for sd-notify on Unix systems only.
Description check ✅ Passed The description is directly related to the changeset, explaining why the cfg(unix) conditionals are needed and providing testing evidence on Debian 13.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bca027a and 0a29ed3.

📒 Files selected for processing (5)
  • rs/hang-cli/Cargo.toml
  • rs/hang-cli/src/client.rs
  • rs/hang-cli/src/server.rs
  • rs/moq-relay/Cargo.toml
  • rs/moq-relay/src/main.rs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

In Rust crates, tests should be integrated within source files using inline test modules

Files:

  • rs/hang-cli/src/client.rs
  • rs/moq-relay/src/main.rs
  • rs/hang-cli/src/server.rs
rs/**/Cargo.toml

📄 CodeRabbit inference engine (CLAUDE.md)

For Rust development, use the workspace configuration in rs/Cargo.toml

Files:

  • rs/hang-cli/Cargo.toml
  • rs/moq-relay/Cargo.toml
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: moq-dev/moq PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T04:00:14.871Z
Learning: Applies to rs/**/Cargo.toml : For Rust development, use the workspace configuration in `rs/Cargo.toml`
📚 Learning: 2025-12-10T04:00:14.871Z
Learnt from: CR
Repo: moq-dev/moq PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T04:00:14.871Z
Learning: Applies to rs/**/Cargo.toml : For Rust development, use the workspace configuration in `rs/Cargo.toml`

Applied to files:

  • rs/hang-cli/Cargo.toml
  • rs/moq-relay/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Check
🔇 Additional comments (5)
rs/moq-relay/src/main.rs (1)

49-51: LGTM! Proper platform-specific gating.

The #[cfg(unix)] attribute correctly gates the systemd notification for Unix platforms only, aligning with the dependency change in Cargo.toml.

rs/hang-cli/src/client.rs (1)

19-21: LGTM! Consistent platform-specific gating.

The conditional compilation attribute is correctly applied, matching the pattern used across the codebase.

rs/hang-cli/src/server.rs (1)

30-32: LGTM! Proper Unix-specific compilation guard.

The systemd notification is correctly gated for Unix platforms only, consistent with the dependency configuration.

rs/hang-cli/Cargo.toml (1)

35-36: LGTM! Consistent dependency configuration.

The Unix-specific dependency section is correctly configured, matching the approach in moq-relay. The same cross-platform compilation verification suggested for moq-relay applies here.

rs/moq-relay/Cargo.toml (1)

38-39: LGTM! Verify cross-platform compilation.

The dependency relocation to a Unix-specific target section is correctly implemented. To ensure the change achieves its goal of enabling Windows builds, consider verifying compilation on a non-Unix platform.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated
Copy link
Collaborator

I figured it was a no-op on other platforms, but this works too.

@kixelated kixelated merged commit 373bb36 into moq-dev:main Dec 27, 2025
1 check passed
@moq-bot moq-bot bot mentioned this pull request Dec 27, 2025
@einrobin einrobin deleted the feature/windows-build branch December 27, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants