Skip to content

Fix headless builds on macOS and Windows#3826

Open
dtinth wants to merge 3 commits into
jamulussoftware:mainfrom
dtinth:fix/headless-macos-windows
Open

Fix headless builds on macOS and Windows#3826
dtinth wants to merge 3 commits into
jamulussoftware:mainfrom
dtinth:fix/headless-macos-windows

Conversation

@dtinth

@dtinth dtinth commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Short description of changes

Three one-line fixes so that CONFIG+=headless compiles (and links) on macOS and Windows, as it already does on Linux.

CHANGELOG: Build: Fixed headless builds (CONFIG+=headless) not compiling on macOS and Windows.

Context: Fixes an issue?

Fixes: #3825

Does this change need documentation? What needs to be documented and how?

No.

Status of this Pull Request

Working implementation, CI-verified..

What is missing until this pull request can be merged?

Nothing known.

  • Verified in a fork with a headless client/server build-and-connect job on all three platforms:
    • failing before
      • macOS: fatal error: 'QMessageBox' file not found, then Undefined symbols … qt_set_sequence_auto_mnemonic(bool)
      • Windows: error C2027: use of undefined type 'QApplication'
    • green after with only these three commits.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

AUTOBUILD: Please build all targets

dtinth-claw Bot and others added 3 commits July 23, 2026 13:51
The include is not referenced anywhere in src/sound/coreaudio-mac/ and
breaks CONFIG+=headless builds on macOS, where the widgets module is not
available.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH
The #ifdef _WIN32 block runs in headless builds too, but <QApplication>
is only included when HEADLESS is not defined, so headless Windows
builds fail to compile. applicationDirPath() is a static inherited from
QCoreApplication, so this is behavior-neutral in GUI builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH
A third headless-on-macOS gap, found once the sound.h fix let the
headless build reach the link stage: main.cpp calls
qt_set_sequence_auto_mnemonic() unconditionally on Q_OS_MACOS, but the
symbol only resolves when QtWidgets is linked -- so a plain
CONFIG+=headless build fails at link time with "symbol(s) not found
for architecture arm64". Menu-accelerator mnemonics are meaningless
without a GUI, so gate both the extern declaration and the call site
behind !defined(HEADLESS) as well.

mac/activity.h and the CActivity app-nap-prevention machinery stay
unconditional for macOS -- headless servers/clients still want nap
prevention, only the mnemonic bits are GUI-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HGdLtGxMrbExBFG3aReNAH
Copilot AI review requested due to automatic review settings July 23, 2026 09:22
@ann0see ann0see added this to Tracking Jul 23, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Jul 23, 2026
@ann0see ann0see added this to the Release 4.0.0 milestone Jul 23, 2026
@ann0see ann0see added bug Something isn't working macOS macOS runtime issue Windows Windows runtime issue AI AI generated or potentially AI generated labels Jul 23, 2026
@ann0see ann0see moved this from Triage to Waiting on Team in Tracking Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CONFIG+=headless builds on macOS and Windows by removing/guarding GUI-only Qt usage so headless targets compile and link consistently across platforms.

Changes:

  • Removed an unnecessary QMessageBox include from the macOS CoreAudio sound header to avoid QtWidgets dependency in headless builds.
  • Guarded macOS mnemonic-key enabling (qt_set_sequence_auto_mnemonic) so it’s not referenced in headless builds.
  • Switched Windows applicationDirPath() usage from QApplication to QCoreApplication so headless builds don’t require QApplication.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/sound/coreaudio-mac/sound.h Drops a QtWidgets header include that breaks headless compilation on macOS.
src/main.cpp Avoids QtWidgets-only symbols/types in headless builds on macOS/Windows.

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

Comment thread src/sound/coreaudio-mac/sound.h

@ann0see ann0see 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.

macOS works fine. Needed to compile it twice - probably it didn't create qrc_qmake_qmake_qm_files.cpp first, but not part of this PR...

error: Build input file cannot be found: '/private/tmp/jamulus/qrc_qmake_qmake_qm_files.cpp'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'Jamulus' from project 'Jamulus')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI generated or potentially AI generated bug Something isn't working macOS macOS runtime issue Windows Windows runtime issue

Projects

Status: Waiting on Team

Development

Successfully merging this pull request may close these issues.

headless doesn't compile on macOS/Windows

3 participants