mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
280 stars 19 forks source link

Parallel build fails sometimes #72

Closed ALTracer closed 1 year ago

ALTracer commented 1 year ago

I tried packaging ocp-0.2.90 for Gentoo, referring to old 0.1.20 ebuild and modern eclasses.

When bumping to 0.2.100 today, I noticed sometimes emake -j5 fails on stuff/ttf.c because of missing CFLAGS with -I/usr/include/freetype2, or on libSDL2-dependent translation units. emake -j1 works, so it's not a dependency/linker problem. I found the new libcjson dependency since 0.2.93 and unifont dir flag rename on my own.

I stopped to include (and check) 0.2.99 ebuild as a known good, because Makefiles underwent major changes between 0.2.99 and 0.2.100, apparently.

https://github.com/mywave82/opencubicplayer/blob/5062815fc1210f856724164b61d5f9421356a896/stuff/Makefile#L234-L236

Here are my ebuilds, for any Gentoo daily drivers interested: https://github.com/ALTracer/altracer-overlay/tree/master/media-sound/ocp

Snippet of failing build log: /var/log/portage/build/media-sound/ocp-0.2.100:20221008-134035.log.gz

make[1]: Leaving directory '/var/tmp/portage/media-sound/ocp-0.2.100/work/ocp-0.2.100/playtimidity'
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I./ -march=native -O2 -pipe -fPIC -Wall   -c -o stuff/poutput-fb.o stuff/poutput-fb.c
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-c64-CIA-tod.o libsidplayfp-git/src/c64/CIA/tod.cpp -c
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I.././ x11-common.c -o x11-common.o -c
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I.././ -I/usr/include/SDL2 -D_REENTRANT  poutput-sdl2.c -o poutput-sdl2.o -c
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-c64-mmu.o libsidplayfp-git/src/c64/mmu.cpp -c
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I./ -march=native -O2 -pipe -fPIC -Wall   -c -o stuff/x11-common.o stuff/x11-common.c
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-c64-VIC_II-mos656x.o libsidplayfp-git/src/c64/VIC_II/mos656x.cpp -c
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I./ -march=native -O2 -pipe -fPIC -Wall   -c -o stuff/ttf.o stuff/ttf.c
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-EventScheduler.o libsidplayfp-git/src/EventScheduler.cpp -c
stuff/ttf.c:37:10: fatal error: ft2build.h: No such file or directory
   37 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
compilation terminated.
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-mixer.o libsidplayfp-git/src/mixer.cpp -c
make: *** [<builtin>: stuff/ttf.o] Error 1
make: *** Waiting for unfinished jobs....
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I.././ ttf.c -o ttf.o -c -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 
x86_64-pc-linux-gnu-g++ -std=c++14 -I.././ -march=native -O2 -pipe -fPIC -Wall -Ilibbinio-git/src -Iadplug-git/src-DVERSION=\"2.3.4-beta\" -Dstricmp=strcasecmp -Ilibbinio-git/src  adplug-git/src/mid.cpp -o adplug_mid.o -c
x86_64-pc-linux-gnu-g++ -std=c++14 -DHAVE_CONFIG_H=1 -DSIDTUNE_NO_STDIN_LOADER=1 -DPACKAGE_NAME=\"sidplayfp\" -DVERSION=\"2.4.10\" -DPACKAGE_VERSION=\"2.4.10-1\" -DPACKAGE_URL=\"\" -march=native -O2 -pipe -fPIC -I./sidplayfp-config -I./libsidplayfp-git/src -o libsidplayfp-player.o libsidplayfp-git/src/player.cpp -c
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Wall -I.././ -march=native -O2 -pipe -fPIC -Wall poutput-swtext.c -o poutput-swtext.o -c

Notice the double global CFLAGS (-march=native -O2 -pipe) and next invocation of gcc successfully compiling the ttf.o with proper per-object CFLAGS.

mywave82 commented 1 year ago

Sorry for being slow. I will add dependencies on the directories so that it does not attempt to build the .o files directly from the project root folder.

mywave82 commented 1 year ago

Please reopen if there still are problems