jamulussoftware / jamulussoftware/jamulus

macOS: CONFIG+=serveronly needs two changes, not one

Abierto
#3,914 2 comentarios 0 reacciones 0 asignados Ver en GitHub
macOS needs documentation
Lenguaje dominante
C
Estrellas
1.1k
Forks
248
Merge medio
2 d 3 h
PR fusionados (30 d)
9

Descripción

**🤖 AI:** [#2551](https://github.com/jamulussoftware/jamulus/pull/2551) left macOS out of `CONFIG+=serveronly` with an open invitation — *"The MacOS build might be feasible but there were the bundle options already there and I've no way to check what's going on with the MacOS build. If someone else wants to have a go at that, add `DEFINES += SERVER_ONLY` and see if it works."* Now it is run on a Mac, at [`c862872e`](https://github.com/jamulussoftware/jamulus/commit/c862872e7beacdc8c9fd232cb33def2d93ee01d1), macOS 12.7.6, Qt 5.15.2, command-line qmake+make, x86_64.

**That change does most of it, and is not sufficient.** With `DEFINES += SERVER_ONLY` added to the [macx branch](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/Jamulus.pro#L176-L237) and nothing else, the define reaches every compile line and all 15 client-side undefined symbols go away. Nine remain, and every one of them is `CSoundBase`:

```
$ qmake Jamulus.pro CONFIG+=serveronly CONFIG+=headless && make -j2
Project MESSAGE: Restricting build to server-only due to CONFIG+=serveronly.
Project MESSAGE: Using CoreAudio.
[...]
Undefined symbols for architecture x86_64:
"CSoundBase::ReinitRequest(int)", referenced from:
CSound::deviceNotification(unsigned int, unsigned int, AudioObjectPropertyAddress const*, void*) in sound.o
"CSoundBase::staticMetaObject", referenced from:
CSound::staticMetaObject in moc_sound.o
"vtable for CSoundBase", referenced from:
CSoundBase::~CSoundBase() in sound.o
[6 further CSoundBase symbols, 9 in total]
ld: symbol(s) not found for architecture x86_64
```

The nine come from the second difference between the branches: the macx branch adds [`coreaudio-mac/sound.cpp`](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/Jamulus.pro#L235) unconditionally, while [`soundbase.cpp` is stripped](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/Jamulus.pro#L518-L521) platform-independently — so `CSound` is compiled without its base class. win32 does not hit this because its [ASIO sources](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/Jamulus.pro#L165-L169) sit inside the else-branch of its own `serveronly` test. So macOS needs two changes, not one: the missing define, and a `serveronly` guard around the CoreAudio sources. With both, a plain `CONFIG+=serveronly CONFIG+=headless` build links and runs:

```
$ qmake Jamulus.pro CONFIG+=serveronly CONFIG+=headless && make -j2
Project MESSAGE: Restricting build to server-only due to CONFIG+=serveronly.
Project MESSAGE: Server-only build: skipping CoreAudio.
[...]
$ Jamulus.app/Contents/MacOS/Jamulus --version
- Starting in server mode by default (due to compile time option)
*** Jamulus, Version 3.12.4dev-nogit
```

With neither change the option half-applies rather than being ignored: five platform-independent [`!contains(CONFIG, "serveronly")`](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/Jamulus.pro#L386) blocks strip client sources while `SERVER_ONLY` stays undefined, and the link fails with 24 undefined symbols.

No released artifact is affected: the macOS server app is built by [`mac/deploy_mac.sh`](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/mac/deploy_mac.sh#L274) with `CONFIG+=server_bundle` alone, which keeps both sound files — built at the same commit here, 0 errors, `JamulusServer` starts in server mode.

Documentation is affected either way: the [compile-time arguments table](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/COMPILING.md?plain=1#L196-L207) marks `server_bundle` *"macOS only"* and `jackonmac` *"on macOS"*, while `serveronly` carries no platform qualifier and its one worked example, [`qmake "CONFIG+=headless serveronly"`](https://github.com/jamulussoftware/jamulus/blob/c862872e7beacdc8c9fd232cb33def2d93ee01d1/COMPILING.md?plain=1#L64), sits under `## Linux`.

---

🤖 *This message was written by AI and reviewed by @mcfnord.*

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en Jamulus.pro con la lista de fuentes de macx y las condicionales serveronly existentes; después, revisa la tabla de argumentos en tiempo de compilación y el ejemplo de Linux de COMPILING.md. Ejecuta qmake con CONFIG+=serveronly CONFIG+=headless en macOS y verifica que el build server-only se enlace correctamente y que Jamulus.app/Contents/MacOS/Jamulus --version se inicie en modo servidor. Actualiza la documentación para describir correctamente la compatibilidad con macOS y las opciones relevantes.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, macos
Área
build-system
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
78/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.