CMake build problem for version 3.4.0 to 4.2.1 on Debian and Ubuntu

For code related discussions and questions
Post Reply
etbe42
New user
Posts: 2
Joined: 16 Nov 2021, 11:12

CMake build problem for version 3.4.0 to 4.2.1 on Debian and Ubuntu

Post by etbe42 »

I'm one of the Debian Developers who maintains the warzone2100 package (included in Debian and copied from Debian to Ubuntu and other Debian derived distributions). Currently Debian has 3.3.0. I want to update Debian to 4.2.1 (or any version later than 3.3.0) but I have compile errors.

/usr/bin/ld: src/CMakeFiles/warzone2100.dir/data.cpp.o: in function
`dataAudioCfgLoad(char const*, void**)':
./debian/build/../../src/data.cpp:605: undefined reference to
`ParseResourceFile(PHYSFS_File*)'

Above is what seems to be the root cause of the problem, which appears to be due to lib/gamelib/audp_parser.ypp not being compiled due to CMake stuff I don't understand.

I've attached the debian.tar.xz file for 4.2.1 for anyone who would like to have a go at it. I could also provide a debian.tar.xz file for 3.4.0 if someone wants to try that (same problem but less disk space and compile time needed).

If anyone has a suggestion on how to approach this then please let me know. The problem occurs when compiling on Debian/Bullseye (amd64), Debian/Unstable (amd64), and Ubuntu/Focal (arm64). The problem is related to CMake, 3.4.0 was the first version using CMake and the first version to have this compile problem.
Attachments
warzone2100_4.2.1-0.debian.tar.xz
(23.75 KiB) Downloaded 199 times
pastdue
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 339
Joined: 13 Aug 2017, 17:44

Re: CMake build problem for version 3.4.0 to 4.2.1 on Debian and Ubuntu

Post by pastdue »

Thanks for taking a look at this!

From a very quick look at the archive, it seems there are various fairly old patches. It is also deleting a bunch of lexer and parser cpp/h files... If you don't remove those files you will have a lot more success.

CI builds every commit on Ubuntu (and many other distros), and the CMake "CPack" configuration can even generate .deb files (which we also distribute for Ubuntu 18 and 20). In fact, I believe there's a way to have CPack generate separate warzone2100 and warzone2100-data .DEBs.

(I'm not sure what if any changes might be needed to make that work for your purposes?)

A note: It looks like the lexer / parser cpp+h files were checked-in back in 2013, and some manual fixes / edits have been applied in the many years since. There has been a reduction in the number of these files, and about half the ones listed for removal in the "rules" file no longer exist. For the remainder, it should be possible to move a lot of the warning suppression / fixes to CMake configuration (and/or the .lpp/.ypp files), and support generating from the .lpp/.ypp files again, but this hasn't happened yet.
etbe42
New user
Posts: 2
Joined: 16 Nov 2021, 11:12

Re: CMake build problem for version 3.4.0 to 4.2.1 on Debian and Ubuntu

Post by etbe42 »

Thanks for the comment. I've uploaded version 4.2.1 to Debian that builds without removing the flex/bison output.

https://github.com/Warzone2100/warzone2100/issues/2425

I filed the above bug report with a request to have the CMake configuration run flex/bison if necessary as the old Automake configuration used to do.

https://bugs.debian.org/cgi-bin/bugrepo ... ug=1000301

I also filed the above Debian bug report against the Debian package because it doesn't run flex/bison as it should.
Post Reply