Skip to content

Fix temporary service plist suffix - #23878

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
oxsean:services-run-temp-plist-suffix
Sep 8, 2026
Merged

Fix temporary service plist suffix#23878
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
oxsean:services-run-temp-plist-suffix

Conversation

@oxsean

@oxsean oxsean commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #23869.

launchctl bootstrap rejects plist contents loaded from a path without a
.plist suffix with exit status 5. The temporary file introduced for
brew services run in #23869 did not specify a suffix, so macOS could not
bootstrap the generated service file.

This gives that Tempfile a .plist suffix and extends the existing test to
assert both the suffix and cleanup behaviour.

@MikeMcQuaid, I am very sorry I missed the required .plist suffix in
#23869. I reproduced the failure locally and tested this correction against
the real macOS launchctl, not only the mocked unit path:

  • the same valid test plist failed with status 5 without the suffix and loaded
    successfully with the suffix;
  • after applying this change to a Homebrew checkout on current main,
    brew services run cc-connect succeeded;
  • launchctl print showed the generated .plist path and all values from
    ~/.homebrew/services/cc-connect.env;
  • the temporary plist was removed after bootstrap while the service remained
    running.

Steps to reproduce the regression on macOS before this change:

mkdir -p "${HOMEBREW_USER_CONFIG_HOME:-$HOME/.homebrew}/services"
echo 'CC_LOG_MAX_BACKUPS=3' > "${HOMEBREW_USER_CONFIG_HOME:-$HOME/.homebrew}/services/cc-connect.env"
brew services run cc-connect

The last command fails while executing launchctl bootstrap against a
temporary path without a .plist suffix.

Verification:

./bin/brew tests --only=services/cli:1228
./bin/brew lgtm --online

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

OpenAI Codex (GPT-5) was used to prepare and test this follow-up under the
contributor's direction. The diff was reviewed, the regression test was run
red then green, the full brew lgtm --online gate passed and the change was
verified with a live macOS launchctl service run as described above.


@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Sep 8, 2026
Merged via the queue into Homebrew:main with commit 64e2134 Sep 8, 2026
52 checks passed
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