kmatheussen / radium

A graphical music editor. A next generation tracker.
http://users.notam02.no/~kjetism/radium/
GNU General Public License v2.0
844 stars 36 forks source link

Race condition in Makefile (libgig) #1340

Closed Teteros closed 3 years ago

Teteros commented 3 years ago

When trying to compile 5.9.69

./compile_to_tmp.sh g++ -mfpmath=sse -msse2 audio/SoundFonts.cpp -D__STDC_FORMAT_MACROS=1 -c `cat buildtype.opt` -Ibin/packages/gc-7.4.16/include -IQt/ -I /usr/include/python2.7 `cat flagopts.opt`  -Werror=array-bounds -msse2 -fomit-frame-pointer -DFOR_LINUX -DQT_X11EXTRAS_LIB -I/usr/include/qt/QtX11Extras -I/usr/include/qt -I/usr/include/qt/QtCore -DQT_GUI_LIB -I/usr/include/qt/QtGui -DQT_CORE_LIB   -DWITH_FAUST_DEV -DWITH_PD  -I ~/SDKs/VST_SDK/VST2_SDK/ -I ~/SDKs/vstsdk2.4/ -I/usr/include/vst36 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unknown-pragmas -fno-strict-aliasing -Wmissing-field-initializers -Wnull-dereference -DTHREADED_OPENGL=1 -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -fmax-errors=5  -DUSE_QT5 -Wmissing-declarations -DNDEBUG  -Wno-parentheses -Wno-deprecated-declarations  -std=gnu++17 -Wno-register -DUSE_QT4 -DUSE_QIMAGE_BUFFER=1 `/usr/bin/pkg-config --cflags Qt5Gui --cflags Qt5Network --cflags Qt5OpenGL --cflags Qt5Widgets --cflags Qt5WebKitWidgets --cflags Qt5WebKit --cflags Qt5Concurrent` -I/tmp/radium/aur/src/radium-6.9.69/bin/packages/qhttpserver-master/src -I/tmp/radium/aur/src/radium-6.9.69/bin/packages/QScintilla_gpl-2.10.8/Qt4Qt5 -DQHTTPSERVER_EXPORT  -fPIC   -I/tmp/radium/aur/src/radium-6.9.69/bin/packages/libgig/src
audio/SoundFonts.cpp:30:10: fatal error: ../bin/packages/libgig/src/SF.h: No such file or directory
   30 | #include "../bin/packages/libgig/src/SF.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:2490: /tmp/radium_objects/SoundFonts.o] Error 1

I figured the issue is an outdated path here:

https://github.com/kmatheussen/radium/blob/30b8e4b29913cc15f4977e29b7495a9ee114ac48/audio/SoundFonts.cpp#L30

which could be simplified to #include "SF.h" as

https://github.com/kmatheussen/radium/blob/30b8e4b29913cc15f4977e29b7495a9ee114ac48/Makefile.Qt#L2489 already includes the path. (this should probably be -I$(LIBGIG_PATH) rather than hardcoded actually)

But this doesn't fix the issue as what seems to be happening is that the libgig archive extraction is ran as a parallel task along with the rest of the build, so it looks like SoundFonts.cpp attempted to compile before libgig was extracted.

Maybe the extraction of libgig-4.2.0.tar.bz2 should be put back in bin/packages/build.sh, as it was done before 91d6a7a08546b9632b592386d0ec8abec42c5f62 ?

kmatheussen commented 3 years ago

I think cc687a6 should fix it.