[Issue Report]: Build Error: CMake "assets/fonts" copy not completing before other threads begin compilation
envgap__diasurgical__DevilutionX-8223
01 / FAILURE SIGNATURE
As reported upstream
This lead to the following error:
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
fc1d447918d3568582ea6970c6506e37b610c634- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
diasurgical/DevilutionX #8223 · read the original issue
### Operating System
Linux x64
### DevilutionX version
Custom build (please specify commit ID)
### Describe
Gentoo Linux x86_64 6.17.3-gentoo
GCC x86_64-pc-linux-gnu-15
DevilutionX v1.6.0-dev-Release-[fc1d44791](https://github.com/diasurgical/devilutionX/commit/fc1d447918d3568582ea6970c6506e37b610c634)
cmake version 4.1.2
Today I built the master branch of DevilutionX using the following command:
```
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
taskset -c 0-31 cmake --build build -j 32 --clean-first
```
This lead to the following error:
```
gmake[2]: *** No rule to make target 'assets/fonts/12-00.clx', needed by 'test/CMakeFiles/text_render_integration_test_resources'. Stop.
gmake[1]: *** [CMakeFiles/Makefile2:9160: test/CMakeFiles/text_render_integration_test_resources.dir/all] Error 2
[ 31%] Copying fixtures/levels/l4data/diab1.dun
gmake[1]: *** Waiting for unfinished jobs....
[ 31%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/core/timeouts.c.o
[ 31%] Copying fixtures/levels/l4data/diab2a.dun
[ 32%] Building CXX object test/CMakeFiles/crawl_benchmark.dir/crawl_benchmark.cpp.o
[ 32%] Copying fixtures/levels/l4data/diab2b.dun
[ 32%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/core/udp.c.o
[ 32%] Copying fixtures/levels/l4data/diab3a.dun
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/bridgeif.c.o
[ 34%] Copying fixtures/levels/l4data/diab3b.dun
[ 34%] Copying fixtures/levels/l4data/diab4a.dun
[ 34%] Built target libdevilutionx_codec
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/bridgeif_fdb.c.o
[ 34%] Copying fixtures/levels/l4data/diab4b.dun
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/ethernet.c.o
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/lowpan6.c.o
[ 34%] Built target libdevilutionx_ticks
[ 34%] Copying fixtures/levels/l4data/vile1.dun
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/lowpan6_ble.c.o
[ 34%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/lowpan6_common.c.o
[ 34%] Copying fixtures/levels/l4data/warlord.dun
[ 34%] Copying fixtures/levels/l4data/warlord2.dun
[ 35%] Copying fixtures/memory_map/additionalMissiles.txt
[ 35%] Copying fixtures/memory_map/game.txt
[ 35%] Copying fixtures/memory_map/hero.txt
[ 35%] Copying fixtures/memory_map/item.txt
[ 35%] Copying fixtures/memory_map/itemPack.txt
[ 35%] Building C object _deps/libzt-build/CMakeFiles/lwip_pic.dir/ext/lwip/src/netif/zepif.c.o
[ 35%] Copying fixtures/memory_map/level.txt
[ 35%] Copying fixtures/memory_map/levelSeed.txt
[ 35%] Copying fixtures/memory_map/lightning.txt
[ 35%] Copying fixtures/memory_map/missile.txt
[ 36%] Copying fixtures/memory_map/monster.txt
[ 36%] Copying fixtures/memory_map/object.txt
[ 36%] Copying fixtures/memory_map/portal.txt
[ 36%] Copying fixtures/memory_map/quest.txt
[ 36%] Copying fixtures/memory_map/player.txt
[ 36%] Copying fixtures/timedemo/WarriorLevel1to2/demo_0.dmo
[ 36%] Copying fixtures/timedemo/WarriorLevel1to2/demo_0_reference_spawn_0.sv
[ 36%] Linking CXX static library lib/libzt_pic.a
[ 36%] Copying fixtures/timedemo/WarriorLevel1to2/spawn_0.sv
[ 36%] Copying fixtures/txtdata/cr.tsv
[ 37%] Copying fixtures/txtdata/crlf.tsv
[ 37%] Copying fixtures/txtdata/empty_with_utf8_bom.tsv
[ 37%] Copying fixtures/txtdata/empty.tsv
[ 37%] Copying fixtures/txtdata/lf.tsv
[ 37%] Copying fixtures/txtdata/lf_no_trail.tsv
[ 37%] Copying fixtures/txtdata/sample.tsv
[ 37%] Copying fixtures/txtdata/utf8_bom.tsv
[ 37%] Linking C static library lib/liblwip_pic.a
[ 37%] Built target zt_pic
[ 37%] Built target devilutionx_copied_fixtures
[ 37%] Built target lwip_pic
[ 37%] Built target libdevilutionx_random
[ 37%] Linking CXX static library libSDL_audiolib.a
[ 37%] Built target SDL_audiolib
[ 37%] Linking CXX executable ../crawl_benchmark
[ 37%] Built target crawl_benchmark
[ 37%] Linking CXX executable ../rectangle_test
[ 37%] Linking CXX executable ../utf8_test
[ 37%] Linking CXX executable ../str_cat_test
[ 37%] Built target rectangle_test
In function ‘copy’,
inlined from ‘_S_copy’ at /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/basic_string.h:453:21,
inlined from ‘_M_mutate’ at /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/basic_string.tcc:368:15,
inlined from ‘_M_append’ at /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/basic_string.tcc:455:17,
inlined from ‘append’ at /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/basic_string.h:1570:18,
inlined from ‘StrAppend’ at /home/paul/Games/devilutionX-git/Source/utils/str_cat.hpp:144:12,
inlined from ‘StrCat’ at /home/paul/Games/devilutionX-git/Source/utils/str_cat.hpp:200:11,
inlined from ‘TestBody’ at /home/paul/Games/devilutionX-git/test/str_cat_test.cpp:17:2:
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/char_traits.h:429:56: warning: ‘__builtin_memcpy’ reading between 16 and 9223372036854775806 bytes from a region of size 3 [-Wstringop-overread]
429 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
| ^
/home/paul/Games/devilutionX-git/Source/utils/str_cat.hpp: In member function ‘TestBody’:
/home/paul/Games/devilutionX-git/Source/utils/str_cat.hpp:142:14: note: source object ‘buf’ of size 3
142 | char buf[MaxNumDigits<T>];
| ^
[ 38%] Linking CXX static library lib/libzto_pic.a
[ 38%] Built target str_cat_test
[ 38%] Built target zto_pic
[ 38%] Built target utf8_test
gmake: *** [Makefile:146: all] Error 2
```
My next step was to disable the GCC warning to see if it would compile, i.e.:
`cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wno-stringop-overread"`
But this only lead to a vague message:
`gmake: *** [Makefile:146: all] Error 2`
When I scrolled up and noticed the missing font error, I checked the assets/fonts directory and none of the .clx files were inside of the folder.
However, by compiling in single-threaded mode everything works flawlessly and all of the fonts are placed in the assets/fonts folder as expected. Everything error related to str_cat.hpp went away on its own.
My working command was this:
`cmake --build build --clean-first`
There may be some sort of race condition happening here in the build process, where the other threads are compiling code before the asset copy is fully completed.
### To Reproduce
```
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
taskset -c 0-31 cmake --build build -j 32 --clean-first
```
### Expected Behavior
Asset dependencies copied before starting code compilation
### Additional context
_No response_04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]