[GH-ISSUE #1631] cmd: darwin build fails with undefined maybeRunAsService/sigHandlerConfigReload #1137

Open
opened 2026-05-07 00:30:30 +02:00 by BreizhHardware · 1 comment

Originally created by @XYenon on GitHub (Mar 2, 2026).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1631

🐞 Describe the bug

Building the server-enabled CLI on macOS fails due to missing Darwin-specific symbol implementations in the cmd package.

cmd/serve.go unconditionally calls maybeRunAsService and sigHandlerConfigReload, but neither is available for Darwin builds, causing compilation to fail.

💻 Components impacted

ntfy server (CLI build path), specifically make cli-darwin-server

💡 Screenshots and/or logs

Reproduction command:

make cli-darwin-server

Build output:

# heckel.io/ntfy/v2/cmd
cmd/serve.go:509:26: undefined: maybeRunAsService
cmd/serve.go:517:5: undefined: sigHandlerConfigReload
make: *** [cli-darwin-server] Error 1

🔮 Additional context

Root cause appears to be build tags:

cmd/serve.go calls both functions unconditionally.
cmd/serve_windows.go only builds on windows && !noserver.
cmd/serve_unix.go only builds on linux || dragonfly || freebsd || netbsd || openbsd (Darwin missing).

This likely regressed when Windows service support was introduced (commit 6d5cc6ae).

Originally created by @XYenon on GitHub (Mar 2, 2026). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1631 :lady_beetle: **Describe the bug** Building the server-enabled CLI on macOS fails due to missing Darwin-specific symbol implementations in the `cmd` package. `cmd/serve.go` unconditionally calls `maybeRunAsService` and `sigHandlerConfigReload`, but neither is available for Darwin builds, causing compilation to fail. :computer: **Components impacted** ntfy server (CLI build path), specifically `make cli-darwin-server` :bulb: **Screenshots and/or logs** Reproduction command: ```bash make cli-darwin-server ``` Build output: ``` # heckel.io/ntfy/v2/cmd cmd/serve.go:509:26: undefined: maybeRunAsService cmd/serve.go:517:5: undefined: sigHandlerConfigReload make: *** [cli-darwin-server] Error 1 ``` :crystal_ball: **Additional context** Root cause appears to be build tags: `cmd/serve.go` calls both functions unconditionally. `cmd/serve_windows.go` only builds on `windows && !noserver`. `cmd/serve_unix.go` only builds on `linux || dragonfly || freebsd || netbsd || openbsd` (Darwin missing). This likely regressed when Windows service support was introduced (commit 6d5cc6ae).
Author
Owner

@aisamu commented on GitHub (Apr 1, 2026):

Hi! I just ran into this.

I've been working around it locally by adding || darwin to the build constraint in cmd/serve_unix.go:

-//go:build linux || dragonfly || freebsd || netbsd || openbsd
+//go:build linux || dragonfly || freebsd || netbsd || openbsd || darwin

I've been running the server for a couple hours on the default configuration.
Both web and phone notifications triggered as usual, and no errors on server logs.
Nothing indicating breakage so far!

Thanks for this superb project!

<!-- gh-comment-id:4171985976 --> @aisamu commented on GitHub (Apr 1, 2026): Hi! I just ran into this. I've been working around it locally by adding `|| darwin` to the build constraint in `cmd/serve_unix.go`: ```diff -//go:build linux || dragonfly || freebsd || netbsd || openbsd +//go:build linux || dragonfly || freebsd || netbsd || openbsd || darwin ``` I've been running the server for a couple hours on the default configuration. Both web and phone notifications triggered as usual, and no errors on server logs. Nothing indicating breakage so far! Thanks for this superb project!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#1137
No description provided.