Skip to content

bundle: split missing service manager handling#22076

Open
MikeMcQuaid wants to merge 1 commit intomainfrom
bundle-services-os-specific-missing-manager
Open

bundle: split missing service manager handling#22076
MikeMcQuaid wants to merge 1 commit intomainfrom
bundle-services-os-specific-missing-manager

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • warn and continue when Linux lacks systemctl, which is common in containers and other non-systemd environments
  • keep macOS failing fast because a missing launchctl indicates a broken setup rather than an expected configuration
  • cover the shared fallback plus macOS and Linux specific behaviour

Closes #21828 (replaces and implements feedback and fixes merge conflicts)


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Used OpenAI Codex with manual review and tweaks.


Copilot AI review requested due to automatic review settings April 24, 2026 11:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Homebrew::Bundle::Brew::Services.started_services to split the “no service manager available” handling so Linux can warn-and-continue when systemctl is missing (common in containers), while macOS continues to fail fast when launchctl is missing.

Changes:

  • Refactor started_services to delegate missing-daemon-manager behavior to started_services_without_daemon_manager.
  • Add a Linux-specific override that warns and returns [] when systemctl is missing.
  • Expand specs to cover shared fallback behavior plus macOS vs. Linux handling.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/bundle/brew_services.rb Introduces started_services_without_daemon_manager and routes missing manager behavior through it; loads OS-specific extension.
Library/Homebrew/extend/os/bundle/brew_services.rb Adds OS dispatch require for the Bundle BrewServices extension.
Library/Homebrew/extend/os/linux/bundle/brew_services.rb Implements Linux override that warns and returns an empty list when no daemon manager is available.
Library/Homebrew/test/bundle/brew_services_spec.rb Adds coverage for the fallback method and Linux/macOS-specific behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/extend/os/bundle/brew_services.rb Outdated
- warn and continue when Linux lacks `systemctl`, which is common in
  containers and other non-systemd environments
- keep macOS failing fast because a missing `launchctl` indicates a
  broken setup rather than an expected configuration
- cover the shared fallback plus macOS and Linux specific behaviour
@MikeMcQuaid MikeMcQuaid force-pushed the bundle-services-os-specific-missing-manager branch from 53f11cc to 4a89b37 Compare April 24, 2026 13:59
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 24, 2026 14:29
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