Open seadra opened 10 months ago
Adding -DDEVILUTIONX_SYSTEM_LIBFMT=OFF
seems to be working as a workaround. However, running make
, the compilation itself fails with the message
In file included from /home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-build/cmake_stdheaders_generator/cmake_stdheaders_generator/future:10:
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:355:17: error: ‘__async_result_of’ was not declared in this scope; did you mean ‘std::__async_result_of’?
355 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~~~~~~~~~~~~~~~~
| std::__async_result_of
/usr/x86_64-w64-mingw32/include/c++/13.1.0/future:197:11: note: ‘std::__async_result_of’ declared here
197 | using __async_result_of = typename __invoke_result<
| ^~~~~~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:355:48: error: template argument 1 is invalid
355 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:702:17: error: ‘__async_result_of’ was not declared in this scope; did you mean ‘std::__async_result_of’?
702 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~~~~~~~~~~~~~~~~
| std::__async_result_of
/usr/x86_64-w64-mingw32/include/c++/13.1.0/future:197:11: note: ‘std::__async_result_of’ declared here
197 | using __async_result_of = typename __invoke_result<
| ^~~~~~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:702:48: error: template argument 1 is invalid
702 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:805:17: error: ‘__async_result_of’ was not declared in this scope; did you mean ‘std::__async_result_of’?
805 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~~~~~~~~~~~~~~~~
| std::__async_result_of
/usr/x86_64-w64-mingw32/include/c++/13.1.0/future:197:11: note: ‘std::__async_result_of’ declared here
197 | using __async_result_of = typename __invoke_result<
| ^~~~~~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:805:48: error: template argument 1 is invalid
805 | friend future<__async_result_of<_Fn, _Args...>> async (std::launch, _Fn &&, _Args&&...);
| ^~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:848:18: error: ‘class mingw_stdthread::future<mingw_stdthread::detail::Empty> mingw_stdthread::future<mingw_stdthread::detail::Empty>::future’ is private within this context
848 | shared_future (future<void> && source) noexcept
| ^~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:416:7: note: declared private here
416 | class shared_future : future<T>
| ^~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:853:36: error: ‘class mingw_stdthread::future<mingw_stdthread::detail::Empty> mingw_stdthread::future<mingw_stdthread::detail::Empty>::future’ is private within this context
853 | shared_future<void> & operator= (future<void> && source) noexcept
| ^~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:416:7: note: declared private here
416 | class shared_future : future<T>
| ^~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:924:8: error: ‘uses_allocator’ is not a class template
924 | struct uses_allocator<promise<T>, Alloc> : std::true_type
| ^~~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:1025:3: error: redefinition of ‘template<class Function, class ... Args> std::future<typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Types>::type ...>::type> std::async(Function&&, Args&& ...)’
1025 | async(Function&& f, Args&&... args)
| ^~~~~
/usr/x86_64-w64-mingw32/include/c++/13.1.0/future:1828:5: note: ‘template<class _Fn, class ... _Args> std::future<typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Types>::type ...>::type> std::async(_Fn&&, _Args&& ...)’ previously declared here
1828 | async(_Fn&& __fn, _Args&&... __args)
| ^~~~~
/home/user/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.future.h:1042:3: error: redefinition of ‘template<class Function, class ... Args> std::future<typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Types>::type ...>::type> std::async(launch, Function&&, Args&& ...)’
1042 | async(std::launch policy, Function&& f, Args&&... args)
| ^~~~~
/usr/x86_64-w64-mingw32/include/c++/13.1.0/future:1794:5: note: ‘template<class _Fn, class ... _Args> std::future<typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Types>::type ...>::type> std::async(launch, _Fn&&, _Args&& ...)’ previously declared here
1794 | async(launch __policy, _Fn&& __fn, _Args&&... __args)
| ^~~~~
make[2]: *** [Source/CMakeFiles/libdevilutionx.dir/build.make:1277: Source/CMakeFiles/libdevilutionx.dir/dvlnet/abstract_net.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/user/devilutionX-1.5.1/Source/platform/locale.cpp: In lambda function:
/home/user/devilutionX-1.5.1/Source/platform/locale.cpp:127:33: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
127 | return std::move(IetfToPosix(utf8Buffer));
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/devilutionX-1.5.1/Source/platform/locale.cpp:127:33: note: remove ‘std::move’ call
make[1]: *** [CMakeFiles/Makefile2:2272: Source/CMakeFiles/libdevilutionx.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
The instructions are for Debian and Fedora, not Arch.
Since the CI is successfully building it looks like a system specific issue: https://github.com/diasurgical/devilutionX/actions/runs/7495821381/job/20406635578
Adding -DDEVILUTIONX_SYSTEM_LIBFMT=OFF seems to be working as a workaround.
Probably the version installed on your system is incompatible.
Regarding the other issues, try GCC 10 since that is what is currently being used on the test build.
I don't have a working install of Arch and find the install process to much of a hazel for me to maintain support for it, so I'm going to close this issue, but you are welcome to contribute an improvements to the guide and build scripts that can help it work better for Arch setups.
If you need help, I would suggest the Discord chat or Discussion section.
I'm OK with switching to other distributions so can we re-open this?
I installed Debian 12.4.0 to test the instructions since you say it works on Debian, but unfortunately it doesn't. The compilation fails with the following error:
[ 65%] Built target SDL_image
In file included from /home/user/Downloads/devilutionX-1.5.1/build/_deps/mingw-std-threads-build/cmake_stdheaders_generator/cmake_stdheaders_generator/thread:10,
from /home/user/Downloads/devilutionX-1.5.1/build/_deps/libzt-src/ext/concurrentqueue/concurrentqueue.h:71,
from /home/user/Downloads/devilutionX-1.5.1/build/_deps/libzt-src/src/Events.cpp:24:
/home/user/Downloads/devilutionX-1.5.1/build/_deps/mingw-std-threads-src/mingw.thread.h:330:24: error: ‘class mingw_stdthread::thread’ conflicts with a previous declaration
330 | using mingw_stdthread::thread;
| ^~~~~~
In file included from /usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++/stop_token:35,
from /usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++/thread:40,
from /home/user/Downloads/devilutionX-1.5.1/build/_deps/mingw-std-threads-build/cmake_stdheaders_generator/cmake_stdheaders_generator/thread:9:
/usr/lib/gcc/x86_64-w64-mingw32/12-win32/include/c++/bits/std_thread.h:61:9: note: previous declaration ‘class std::thread’
61 | class thread
| ^~~~~~
cc1plus: note: unrecognized command-line option ‘-Wno-everything’ may have been intended to silence earlier diagnostics
gmake[2]: *** [_deps/libzt-build/CMakeFiles/zt-static.dir/build.make:107: _deps/libzt-build/CMakeFiles/zt-static.dir/src/Events.cpp.obj] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2209: _deps/libzt-build/CMakeFiles/zt-static.dir/all] Error 2
This suggests there is an issue with mingw threading library that needs to be fixed eventually since distros won't maintain gcc 10 forever.
The build you linked to is Ubuntu 22.04.3 LTS, which uses gcc 10 according to you. Current Arch has gcc 13.1, current release of Debian (and presumably Ubuntu) has gcc 12 in their mingw packages.
I'm OK with switching to other distributions so can we re-open this?
If someone can figure out what's going on with the MinGW threading library, that would be great. I believe this issue is related. https://github.com/meganz/mingw-std-threads/issues/79
Sadly, there's been no update since Aug 2021. But it looks like a handful of projects have come up with workarounds.
Operating System
Linux x64
DevilutionX version
1.5.1
Describe
Following the compilation instructions from here. Several issues:
Packaging/windows/mingw-prep64.sh
doesn't handle zlib as claimed, manually installed the packagemingw-w64-zlib
from AUR (I'm on Arch Linux).cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DDEVILUTIONX_SYSTEM_BZIP2=OFF
fails withTo Reproduce
Follow the build instructions from here
Expected Behavior
Successful build
Additional context
No response