Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scsynth: linker error due to undefined reference to stopServerBootDelayWarningTimer() #4992

Closed
dvzrv opened this issue Jun 2, 2020 · 25 comments
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs.

Comments

@dvzrv
Copy link
Member

dvzrv commented Jun 2, 2020

Environment

  • SuperCollider version: current HEAD on develop
  • Operating system: Arch Linux
  • Other details (Qt version, audio driver, etc.):

Steps to reproduce

Build supercollider-git from the AUR (PKGBUILD currently not up-to-date) because unable to build ;-)

Expected vs. actual behavior

Excerpt from the build log, showing the linker error:

[ 27%] Building CXX object server/scsynth/CMakeFiles/scsynth.dir/scsynth_main.cpp.o
cd /build/supercollider-git/src/supercollider/build/server/scsynth && /usr/bin/c++  -DBOOST_CHRONO_HEADER_ONLY -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE -DBOOST_NO_AUTO_PTR -DBUILDING_SCSYNTH -DHAVE_AVAHI=1 -DNOVA_SIMD -DSC_AUDIO_API=SC_AUDIO_API_JACK -DSC_DATA_DIR=\"/usr/share/SuperCollider\" -DSC_FFT_FFTW -DSC_MEMORY_ALIGNMENT=32 -DSC_PLUGIN_DIR=\"/usr/lib/SuperCollider/plugins\" -DSC_PLUGIN_EXT=\".so\" -DUSE_RENDEZVOUS=1 -D_FORTIFY_SOURCE=2 -I/build/supercollider-git/src/supercollider/build/common -I/build/supercollider-git/src/supercollider/external_libraries -I/build/supercollider-git/src/supercollider/external_libraries/nova-simd -I/build/supercollider-git/src/supercollider/external_libraries/nova-tt -I/build/supercollider-git/src/supercollider/include/common -I/build/supercollider-git/src/supercollider/common -I/build/supercollider-git/src/supercollider/include/server -I/build/supercollider-git/src/supercollider/include/plugin_interface -I/build/supercollider-git/src/supercollider/server/scsynth/. -I/build/supercollider-git/src/supercollider/external_libraries/boost_sync/include -I/build/supercollider-git/src/supercollider/external_libraries/TLSF-2.4.6/src  -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -msse -mfpmath=sse -msse2 -O3 -DNDEBUG   -fschedule-insns2 -fomit-frame-pointer -Wreturn-type -fno-math-errno -fno-signaling-nans -fsigned-zeros -fno-associative-math -pthread -fvisibility=hidden -std=gnu++11 -o CMakeFiles/scsynth.dir/scsynth_main.cpp.o -c /build/supercollider-git/src/supercollider/server/scsynth/scsynth_main.cpp
[ 27%] Linking CXX executable scsynth
cd /build/supercollider-git/src/supercollider/build/server/scsynth && /usr/bin/cmake -E cmake_link_script CMakeFiles/scsynth.dir/link.txt --verbose=1
/usr/bin/c++  -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -msse -mfpmath=sse -msse2 -O3 -DNDEBUG  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now CMakeFiles/scsynth.dir/scsynth_main.cpp.o  -o scsynth  -Wl,-rpath,/build/supercollider-git/src/supercollider/build/server/scsynth: libscsynth.so.1.0.0 /usr/lib/libpthread.so ../../external_libraries/libtlsf.a /usr/lib/libdl.so /usr/lib/libsndfile.so /usr/lib/libavahi-common.so /usr/lib/libavahi-client.so /usr/lib/libjack.so /usr/lib/libboost_system.so /usr/lib/libboost_filesystem.so /lib/libfftw3f.so -lrt
/usr/bin/ld: CMakeFiles/scsynth.dir/scsynth_main.cpp.o: in function `scsynth_main(int, char**)':
scsynth_main.cpp:(.text+0xdc): undefined reference to `startServerBootDelayWarningTimer()'
/usr/bin/ld: scsynth_main.cpp:(.text+0x380): undefined reference to `stopServerBootDelayWarningTimer()'
collect2: error: ld returned 1 exit status
make[2]: *** [server/scsynth/CMakeFiles/scsynth.dir/build.make:115: server/scsynth/scsynth] Error 1
make[2]: Leaving directory '/build/supercollider-git/src/supercollider/build'
make[1]: *** [CMakeFiles/Makefile2:3118: server/scsynth/CMakeFiles/scsynth.dir/all] Error 2
make[1]: Leaving directory '/build/supercollider-git/src/supercollider/build'
make: *** [Makefile:183: all] Error 2
make: Leaving directory '/build/supercollider-git/src/supercollider/build'

Full build log:
supercollider-git-build.log

I assume this is related to the recent change in #4984.
I guess we're missing an include somewhere

@dvzrv dvzrv added the bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs. label Jun 2, 2020
@mossheim
Copy link
Contributor

mossheim commented Jun 2, 2020

i can't reproduce this on Arch Linux. is it at all possible the build directory or your ccache cache need to be cleaned? here's what i've tried:

  • build scsynth with Makefiles generator, debug
  • build scsynth with Makefiles generator, release
  • build scsynth with Ninja generator, debug

i also don't see anything about the current state of things that should cause a linker error, except perhaps that these functions are only used in scsynth_main, i.e. they are used in the scsynth target but not libscsynth.

perhaps you can take a look at my log and see what is different:

cmake_log.txt
make_log.txt

@mossheim
Copy link
Contributor

mossheim commented Jun 2, 2020

if i have more time after work and this is still an issue, i'll try using the AUR repo.

@dvzrv
Copy link
Member Author

dvzrv commented Jun 2, 2020

I'm building in a clean chroot using devtools' extra-x86_64-build.

The current PKGBUILD in use:

# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=supercollider-git
_name="supercollider"
pkgver=3.11.0.r371.g504ce0537b
pkgrel=1
pkgdesc="Environment and programming language for real time audio synthesis and algorithmic composition"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="https://supercollider.github.io/"
license=('GPL3')
depends=('gcc-libs' 'glibc'  'libx11' 'qt5-base' 'qt5-svg' 'qt5-webengine'
'qt5-websockets')
makedepends=('alsa-lib' 'avahi' 'boost' 'cmake' 'emacs' 'fftw' 'git' 'jack'
'libsndfile' 'abletonlink' 'qt5-tools' 'readline' 'systemd-libs' 'yaml-cpp')
checkdepends=('xorg-server-xvfb')
optdepends=('emacs: emacs interface'
            'gedit: gedit interface'
            'sc3-plugins: additional extension plugins for scsynth')
conflicts=('supercollider')
provides=('libscsynth.so' 'supercollider')
source=("git+https://github.com/${_name}/${_name}.git#branch=develop"
        "git+https://github.com/ableton/link.git"
        "git+https://github.com/${_name}/scel.git"
        "git+https://github.com/${_name}/scvim.git"
        "git+https://github.com/${_name}/hidapi.git"
        "git+https://github.com/${_name}/portaudio.git"
        "git+https://github.com/${_name}/yaml-cpp.git"
        "git+https://github.com/timblechmann/nova-simd.git"
        "git+https://github.com/timblechmann/nova-tt.git")
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

pkgver() {
  cd "${_name}"
  git describe --long --match 'Version-*' --tags | sed 's/Version-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_name}"
  git submodule init
  git config submodule.editors/sc-el.url "${srcdir}/scel"
  git config submodule.editors/scvim.url "${srcdir}/scvim"
  git config submodule.external_libraries/nova-simd.url "${srcdir}/nova-simd"
  git config submodule.external_libraries/nova-tt.url "${srcdir}/nova-tt"
  git config submodule.external_libraries/hidapi.url "${srcdir}/hidapi"
  git config submodule.external_libraries/portaudio_sc_org.url "${srcdir}/portaudio"
  git config submodule.external_libraries/portaudio_sc_org.branch "${_name}"
  git config submodule.external_libraries/yaml-cpp.url "${srcdir}/yaml-cpp"
  git config submodule.external_libraries/link.url "${srcdir}/link"
  git submodule update
}

build() {
  cd "${_name}"
  _carch="$(uname -m)"
  _cmake_args=""
  echo "$_carch architecture detected."
  case "$_carch" in
    "armv6l")
    export CFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard'
    export CXXFLAGS='-march=armv6 -mfpu=vfp -mfloat-abi=hard'
    _cmake_args="-DSSE=OFF \
                 -DSSE2=OFF \
                 -DSUPERNOVA=OFF \
                 -DNATIVE=OFF \
                 -DSC_QT=OFF \
                 -DSC_ED=OFF \
                 -DSC_IDE=OFF"
    ;;
    "armv7l")
    export CFLAGS='-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon'
    export CXXFLAGS='-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon'
    _cmake_args="-DSSE=OFF \
                 -DSSE2=OFF \
                 -DSUPERNOVA=OFF \
                 -DNATIVE=OFF \
                 -DSC_QT=OFF \
                 -DSC_ED=OFF \
                 -DSC_IDE=OFF"
    ;;
    *)
    cmake -DCMAKE_INSTALL_PREFIX='/usr' \
          -DCMAKE_BUILD_TYPE='None' \
          -DLIBSCSYNTH=ON \
          -DFORTIFY=ON \
          -DSC_VIM=OFF \
          -DSYSTEM_ABLETON_LINK=ON \
          -DSYSTEM_BOOST=ON \
          -DSYSTEM_YAMLCPP=ON \
          ${_cmake_args} \
          -Wno-dev \
          -B build \
          -S .
    ;;
  esac
  make VERBOSE=1 -C build
}

check() {
  cd "${_name}"
  xvfb-run make test VERBOSE=1 ARGS="-V" -C build || warning "Known failing tests: https://github.com/supercollider/supercollider/issues/3555"
}


package() {
  depends+=('libasound.so' 'libavahi-common.so' 'libavahi-client.so'
  'libboost_filesystem.so' 'libboost_program_options.so' 'libboost_regex.so'
  'libboost_thread.so' 'libfftw3f.so' 'libjack.so' 'libreadline.so'
  'libsndfile.so' 'libudev.so' 'libyaml-cpp.so')
  cd "${_name}"
  make DESTDIR="${pkgdir}/" install -C build
  install -vDm 644 {AUTHORS,{CHANGELOG,README,README_LINUX}.md} \
    -t "${pkgdir}/usr/share/doc/${pkgname}/"
}

I'll dig deeper into this later today, if I have time after work.

@geoffroymontel
Copy link
Contributor

Sorry, I don't have an Arch Linux with me but have you tried deleting the build folder before recompiling ?

@dvzrv
Copy link
Member Author

dvzrv commented Jun 2, 2020

I'm building in a clean chroot using devtools' extra-x86_64-build.

@geoffroymontel Everything is created from scratch on every build. No ccache, no leftovers from previous builds.

@dvzrv
Copy link
Member Author

dvzrv commented Jun 2, 2020

Seems the change broke the LIBSCSYNTH CMake option.
Without it it compiles. Will check the different places where it's in use later.

@geoffroymontel
Copy link
Contributor

Sorry then, it's my fault :(

@dvzrv
Copy link
Member Author

dvzrv commented Jun 2, 2020

@geoffroymontel no worries, stuff breaks. It's just software :)
Reminds me that I wanted to add a pull request for running one CI target against the shared lib build... :P

Okay, from what I understand is, that when building libscsynth.so SC_ServerBootDelayWarning.cpp.o is actually linked into it.
However, the linking of scsynth (the executable) fails due to not seeing those references in libscsynth.so. This works though, when it's linked into the static lib libscsynth.a.

Can't see yet, why that is not working when dynamically linking.

@mossheim
Copy link
Contributor

mossheim commented Jun 3, 2020

aha. we compile everything with -fvisibility=hidden, so the linker error is because those functions are not explicitly exported. but, probably the best thing to do is include this file in the scsynth executable target itself since it is intended to be used only in main, i.e. we wouldn't want to export it as part of libscsynth's public interface.

the shared lib build has actually been broken on macOS since Dec 2019 after #4499. that nobody has reported this, plus the fact that nobody has ever asked for a libsupernova.so or libsclang.so, make me skeptical about libscsynth.so. can you remind me again why you're using that option, i.e. why we shouldn't deprecate it immediately?

@dvzrv
Copy link
Member Author

dvzrv commented Jun 3, 2020

can you remind me again why you're using that option, i.e. why we shouldn't deprecate it immediately?

No particular reason, besides that it has been like this since I adopted the package a few years ago.
I was under the impression, that somehow anything in sc3-plugins would link against it, but that's apparently not the case.
I wonder if it is in use anywhere else.

@sonoro1234
Copy link
Contributor

sonoro1234 commented Jun 13, 2020

@brianlheim

the best thing to do is include this file in the scsynth executable target itself since it is intended to be used only in main

Yes please, I am facing the same issue building: undefined reference to startServerBootDelayWarningTimer() when building with LIBSCSYNTH

can you remind me again why you're using that option

It allows to use the internal server from any binding.

PR made

@mossheim
Copy link
Contributor

It allows to use the internal server from any binding.

can you elaborate? what project are you using it for?

also, i guess we should also add a way to configure supernova as a shared library as well then!

@sonoro1234
Copy link
Contributor

can you elaborate? what project are you using it for?

To being able to use internal server from Lua2SC (my client) I need to have libscsynth as a dll
I dont know if it is necessary from sclang

also, i guess we should also add a way to configure supernova as a shared library as well then!

supernova doesnt have internal server

@mossheim
Copy link
Contributor

ok, thanks!

@mossheim
Copy link
Contributor

Reminds me that I wanted to add a pull request for running one CI target against the shared lib build... :P

FYI @dvzrv i've added it here -- #4906

#5012 is merged, so i will close this and add a new issue for the macOS linking error! thanks @sonoro1234

@mossheim
Copy link
Contributor

Reminds me that I wanted to add a pull request for running one CI target against the shared lib build... :P

@dvzrv FYI i've added it here - #4906 !

@dvzrv
Copy link
Member Author

dvzrv commented Jun 13, 2020

awesome stuff man! Thanks so much!

@dvzrv
Copy link
Member Author

dvzrv commented Sep 3, 2020

@brianlheim hm, seems this one didn't make it into 3.11.1!
Unfortunately #5014 does not apply cleanly.

@dvzrv
Copy link
Member Author

dvzrv commented Sep 3, 2020

FWIW here's a modified version of the patch that applies on 3.11.1 (only the server/{scsynth,supernova}/CMakeLists.txt files had modifications):

From 993b6bc06aa4b9c6eaf47cfdd9363a28b1494b2c Mon Sep 17 00:00:00 2001
From: brianlheim <self@brianlheim.com>
Date: Sat, 13 Jun 2020 13:23:22 -0500
Subject: [PATCH 1/2] cmake: compile boost::filesystem with PIC

---
 external_libraries/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/external_libraries/CMakeLists.txt b/external_libraries/CMakeLists.txt
index 39330ff85c..5017abd891 100644
--- a/external_libraries/CMakeLists.txt
+++ b/external_libraries/CMakeLists.txt
@@ -58,6 +58,7 @@ if(NOT SYSTEM_BOOST) # we compile boost ourselves
 
 
 	if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+		target_compile_options(boost_filesystem_lib PRIVATE -fPIC)
 		target_compile_options(boost_thread_lib PRIVATE -fPIC)
 		target_link_libraries(boost_thread_lib rt)
 	endif()

From bdd624b40b9eacd6efcdccccc72879d044686b56 Mon Sep 17 00:00:00 2001
From: brianlheim <self@brianlheim.com>
Date: Sat, 13 Jun 2020 13:35:32 -0500
Subject: [PATCH 2/2] servers: separate out main-only EventLoop code

otherwise, we get linking errors on macOS

see also #5012, #5013
---
 common/SC_Apple.hpp             | 14 ------
 common/SC_Apple.mm              | 60 -------------------------
 common/SC_AppleEventLoop.hpp    | 34 ++++++++++++++
 common/SC_AppleEventLoop.mm     | 80 +++++++++++++++++++++++++++++++++
 common/SC_EventLoop.hpp         |  3 +-
 server/scsynth/CMakeLists.txt   |  8 +++-
 server/supernova/CMakeLists.txt |  9 +++-
 7 files changed, 131 insertions(+), 77 deletions(-)
 create mode 100644 common/SC_AppleEventLoop.hpp
 create mode 100644 common/SC_AppleEventLoop.mm

diff --git a/common/SC_Apple.hpp b/common/SC_Apple.hpp
index 958d097f36..c7e53e9fcc 100644
--- a/common/SC_Apple.hpp
+++ b/common/SC_Apple.hpp
@@ -23,19 +23,5 @@ namespace SC { namespace Apple {
 
 void disableAppNap();
 
-namespace EventLoop {
-
-// Setup the main application. This function must be called in the
-// main thread and before any other calls to Cocoa methods.
-void setup();
-// Run the event loop. This function must be called in the main thread.
-// It blocks until the event loop finishes.
-void run();
-// Ask the event loop to stop and terminate the program.
-// This function can be called from any thread.
-void quit();
-
-} // EventLoop
-
 } // namespace Apple
 } // namespace SC
diff --git a/common/SC_Apple.mm b/common/SC_Apple.mm
index a4e10a66cd..dbb7ddbb7d 100644
--- a/common/SC_Apple.mm
+++ b/common/SC_Apple.mm
@@ -42,65 +42,5 @@ void disableAppNap() {
     }
 }
 
-namespace EventLoop {
-
-static std::atomic_bool g_running;
-
-void setup() {
-    // The following code would transform the process into a foreground application.
-    // For now it's the plugin's responsibility to do this (early or lazily)
-    // because we don't want to always show an icon in the docker.
-    // ProcessSerialNumber psn = { 0, kCurrentProcess };
-    // TransformProcessType(&psn, kProcessTransformToForegroundApplication);
-
-    // Create NSApplication
-    [NSApplication sharedApplication];
-}
-
-void run() {
-#if 0
-    // this doesn't work...
-    [NSApp run];
-#else
-    // Kudos to https://www.cocoawithlove.com/2009/01/demystifying-nsapplication-by.html
-    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
-
-    [NSApp finishLaunching];
-    g_running = true;
-
-    while (g_running) {
-        [pool release];
-        pool = [[NSAutoreleasePool alloc] init];
-        NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
-                                            untilDate:[NSDate distantFuture]
-                                               inMode:NSDefaultRunLoopMode
-                                              dequeue:YES];
-        if (event) {
-            [NSApp sendEvent:event];
-            [NSApp updateWindows];
-        }
-    }
-    [pool release];
-#endif
-}
-
-void quit() {
-    // break from event loop instead of [NSApp terminate:nil]
-    g_running = false;
-    // send dummy event to wake up event loop
-    NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined
-                                        location:NSMakePoint(0, 0)
-                                   modifierFlags:0
-                                       timestamp:0
-                                    windowNumber:0
-                                         context:nil
-                                         subtype:0
-                                           data1:0
-                                           data2:0];
-    [NSApp postEvent:event atStart:NO];
-}
-
-} // EventLoop
-
 } // namespace Apple
 } // namespace SC
diff --git a/common/SC_AppleEventLoop.hpp b/common/SC_AppleEventLoop.hpp
new file mode 100644
index 0000000000..6f19bb2818
--- /dev/null
+++ b/common/SC_AppleEventLoop.hpp
@@ -0,0 +1,34 @@
+/************************************************************************
+ *
+ * Copyright 2019 Christof Ressi <info@christofressi.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ ************************************************************************/
+
+#pragma once
+
+namespace SC { namespace Apple { namespace EventLoop {
+
+// Setup the main application. This function must be called in the
+// main thread and before any other calls to Cocoa methods.
+void setup();
+// Run the event loop. This function must be called in the main thread.
+// It blocks until the event loop finishes.
+void run();
+// Ask the event loop to stop and terminate the program.
+// This function can be called from any thread.
+void quit();
+
+}}} // namespace SC::Apple::EventLoop
diff --git a/common/SC_AppleEventLoop.mm b/common/SC_AppleEventLoop.mm
new file mode 100644
index 0000000000..cfcf42ddfe
--- /dev/null
+++ b/common/SC_AppleEventLoop.mm
@@ -0,0 +1,80 @@
+/************************************************************************
+ *
+ * Copyright 2019 Christof Ressi <info@christofressi.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ ************************************************************************/
+
+#include "SC_AppleEventLoop.hpp"
+#include <atomic>
+
+#import <Cocoa/Cocoa.h>
+
+namespace SC { namespace Apple { namespace EventLoop {
+
+static std::atomic_bool g_running;
+
+void setup() {
+    // The following code would transform the process into a foreground application.
+    // For now it's the plugin's responsibility to do this (early or lazily)
+    // because we don't want to always show an icon in the docker.
+    // ProcessSerialNumber psn = { 0, kCurrentProcess };
+    // TransformProcessType(&psn, kProcessTransformToForegroundApplication);
+
+    // Create NSApplication
+    [NSApplication sharedApplication];
+}
+
+void run() {
+    // this doesn't work...
+    // [NSApp run];
+    // Kudos to https://www.cocoawithlove.com/2009/01/demystifying-nsapplication-by.html
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+    [NSApp finishLaunching];
+    g_running = true;
+
+    while (g_running) {
+        [pool release];
+        pool = [[NSAutoreleasePool alloc] init];
+        NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
+                                            untilDate:[NSDate distantFuture]
+                                               inMode:NSDefaultRunLoopMode
+                                              dequeue:YES];
+        if (event) {
+            [NSApp sendEvent:event];
+            [NSApp updateWindows];
+        }
+    }
+    [pool release];
+}
+
+void quit() {
+    // break from event loop instead of [NSApp terminate:nil]
+    g_running = false;
+    // send dummy event to wake up event loop
+    NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined
+                                        location:NSMakePoint(0, 0)
+                                   modifierFlags:0
+                                       timestamp:0
+                                    windowNumber:0
+                                         context:nil
+                                         subtype:0
+                                           data1:0
+                                           data2:0];
+    [NSApp postEvent:event atStart:NO];
+}
+
+}}} // namespace SC::Apple::EventLoop
diff --git a/common/SC_EventLoop.hpp b/common/SC_EventLoop.hpp
index 1d62b4de89..6e58208cc0 100644
--- a/common/SC_EventLoop.hpp
+++ b/common/SC_EventLoop.hpp
@@ -2,7 +2,7 @@
 
 #include <functional>
 #ifdef __APPLE__
-#    include "SC_Apple.hpp"
+#    include "SC_AppleEventLoop.hpp"
 #    include <thread>
 #endif
 
@@ -21,6 +21,7 @@ class EventLoop {
         SC::Apple::EventLoop::setup();
 #endif
     }
+
     // Run the event loop until 'waitFunction' returns.
     static void run(std::function<void()> waitFunction) {
 #ifdef __APPLE__
diff --git a/server/scsynth/CMakeLists.txt b/server/scsynth/CMakeLists.txt
index 0bab0f2c3a..0845d8721b 100644
--- a/server/scsynth/CMakeLists.txt
+++ b/server/scsynth/CMakeLists.txt
@@ -229,7 +229,13 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
 	target_link_libraries(libscsynth rt)
 endif()
 
-add_executable(scsynth scsynth_main.cpp)
+add_executable(scsynth
+    scsynth_main.cpp
+
+    # these files contain code only used in main()
+    ${CMAKE_SOURCE_DIR}/common/SC_ServerBootDelayWarning.cpp
+    $<$<BOOL:${APPLE}>: ${CMAKE_SOURCE_DIR}/common/SC_AppleEventLoop.mm >
+    )
 target_link_libraries(scsynth libscsynth)
 
 if (PTHREADS_FOUND)
diff --git a/server/supernova/CMakeLists.txt b/server/supernova/CMakeLists.txt
index d6423c75cb..4a3e2c8baf 100644
--- a/server/supernova/CMakeLists.txt
+++ b/server/supernova/CMakeLists.txt
@@ -201,7 +201,14 @@ if(WIN32)
 endif()
 
 
-add_executable(supernova server/main.cpp ${supernova_headers})
+add_executable(supernova
+    server/main.cpp
+    ${supernova_headers}
+
+    # these files contain code only used in main()
+    ${CMAKE_SOURCE_DIR}/common/SC_ServerBootDelayWarning.cpp
+    $<$<BOOL:${APPLE}>: ${CMAKE_SOURCE_DIR}/common/SC_AppleEventLoop.mm >
+    )
 target_link_libraries(supernova libsupernova)
 
 if(WIN32)

@mossheim
Copy link
Contributor

mossheim commented Sep 3, 2020

@dvzrv sorry about that, lots of things in motion. i will make sure it goes in for 3.11.2. ^^

@dvzrv
Copy link
Member Author

dvzrv commented Nov 16, 2020

Just a quick headsup: This change is not included in 3.11.2.

Here's a backport patch: dvzrv@9563fb5

@simonvanderveldt
Copy link
Contributor

simonvanderveldt commented Nov 25, 2020

Just a quick headsup: This change is not included in 3.11.2.

Here's a backport patch: dvzrv@9563fb5

Thanks! Ran into this as well with 3.11.2, expected it to be working, quiet surprised this fix was missing. Anyway, thanks for updating the patch, it's quiet an annoying one to rebase.

@mossheim
Copy link
Contributor

sorry again for this, i thought i had cherry-picked the fix but misread the comment above. in the future, it would be a huge help if more people tried to use the release candidates, since that's the main reason we make them available.

this is fixed in the upcoming 3.12.0.

@simonvanderveldt
Copy link
Contributor

@brianlheim No problem, mistakes happen :) Thanks for making sure it's in the next release!

I don't think we have anything in place for testing RC releases, for some packages we do have so called "live" ebuilds that install directly from version control/current HEAD but I'm not sure that would've helped here (I don't think we've run into issues with what's currently in develop).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
Projects
None yet
Development

No branches or pull requests

5 participants