Riesi Posted November 24, 2023 Report Share Posted November 24, 2023 (edited) Hello! I am regularly playing 0ad with a friend. We decided to always play the latest Windows autobuild. This means I have to compile that revision for Linux. And lately a few build issues due to missing includes or --pendantic not being happy happened. Attached is a patch to fix the current build issues. Hopefully someone can apply this fix upstream. I tried to figure out how to contribute, but Phabricator doesn't send me the verification email for my account. Hopefully I can make an account when the transition away from SVN and Phabricator is complete. I was reading in the git transition thread that Gitea and CI is coming together, so a commit breaking Linux compilation should be less likely after that. Kind regards, Riesi linux_build_fixes.patch Edited November 24, 2023 by Riesi 1 Quote Link to comment Share on other sites More sharing options...
phosit Posted November 25, 2023 Report Share Posted November 25, 2023 I also use Linux. I didn't encounter this error untill you mentioned it. I don't get it all the times. Propably it's because of the precompiled header. We already use CI. Quote Link to comment Share on other sites More sharing options...
Stan` Posted November 25, 2023 Report Share Posted November 25, 2023 If you commit, gotta credit. Quote Link to comment Share on other sites More sharing options...
phosit Posted November 25, 2023 Report Share Posted November 25, 2023 30 minutes ago, Stan` said: If you commit, gotta credit. sure Quote Link to comment Share on other sites More sharing options...
hyperion Posted November 25, 2023 Report Share Posted November 25, 2023 What needs fixing the most is not being able to register on phab. 1 Quote Link to comment Share on other sites More sharing options...
Riesi Posted November 26, 2023 Author Report Share Posted November 26, 2023 Hmm seems like I dont even get mails from the bug tracker anymore. Maybe the wildfiregames email server has issues in general. Quote Link to comment Share on other sites More sharing options...
Stan` Posted November 28, 2023 Report Share Posted November 28, 2023 @Itms @implodedok Quote Link to comment Share on other sites More sharing options...
ShadowOfHassen Posted November 28, 2023 Report Share Posted November 28, 2023 On 26/11/2023 at 5:30 AM, Riesi said: Hmm seems like I dont even get mails from the bug tracker anymore. Maybe the wildfiregames email server has issues in general. Both I and @Gurken Khan haven't gotten forum notification emails. So it could be the email Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 30, 2023 Report Share Posted November 30, 2023 On 24/11/2023 at 6:00 PM, Riesi said: And lately a few build issues due to missing includes or --pendantic not being happy happened. Attached is a patch to fix the current build issues. Hopefully someone can apply this fix upstream. Could you also attach your warnings and errors? Quote Link to comment Share on other sites More sharing options...
Riesi Posted November 30, 2023 Author Report Share Posted November 30, 2023 Sure! Ok it was not -pendantic but just the compiler telling me that its related to -permissive. build_errors.txt Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 30, 2023 Report Share Posted November 30, 2023 1 hour ago, Riesi said: Ok it was not -pendantic but just the compiler telling me that its related to -permissive. Could you share your OS and compiler version? On 24/11/2023 at 6:00 PM, Riesi said: I was reading in the git transition thread that Gitea and CI is coming together, so a commit breaking Linux compilation should be less likely after that. That shouldn't affect the compilation process, since it depends on a platform not CI infrastructure itself. Quote Link to comment Share on other sites More sharing options...
Riesi Posted November 30, 2023 Author Report Share Posted November 30, 2023 $ inxi -SMGxx System: Host: REalArch Kernel: 6.6.3-arch1-1 arch: x86_64 bits: 64 compiler: gcc 13.2.1 Desktop: KDE Plasma v: 5 tk: Qt v: 5.15.11 wm: i3 dm: startx Distro: Arch Linux  Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 30, 2023 Report Share Posted November 30, 2023 1 hour ago, Riesi said: $ inxi -SMGxx System: Host: REalArch Kernel: 6.6.3-arch1-1 arch: x86_64 bits: 64 compiler: gcc 13.2.1 Desktop: KDE Plasma v: 5 tk: Qt v: 5.15.11 wm: i3 dm: startx Distro: Arch Linux Thank you! Quote Link to comment Share on other sites More sharing options...
phosit Posted December 1, 2023 Report Share Posted December 1, 2023 Curiously i don't get an error about the xml-validator stuff. I made a patch about thous errors I get. @Riesi I added you as "Riesi" to the credits. Is this ok for you? Do you also want your name? 1 Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 1, 2023 Author Report Share Posted December 1, 2023 Thank you for making the upstream patch! I am fine with "Riesi" as the credit. Could the "invalid conversion" errors be from a newer GCC version (13.2.1)? As for "#include <libxml/parser.h>" I am not sure why I get the error about missing declarations and you seemingly don't. It would be great if all errors would be fixed upstream, but I am ok carrying fixes locally for a while too. Until a better solution is found. Thanks again! Quote Link to comment Share on other sites More sharing options...
phosit Posted December 1, 2023 Report Share Posted December 1, 2023 7 minutes ago, Riesi said: Could the "invalid conversion" errors be from a newer GCC version (13.2.1)? No, I also use GCC 13.2.1 from the arch repo I'll reinstall the complete git repo this weekend to see if that yields more errors. (Probably ./clean-workspace.sh didn't clean everything) 1 Quote Link to comment Share on other sites More sharing options...
phosit Posted December 2, 2023 Report Share Posted December 2, 2023 Ok i reinstaled the git repo, but still don't get the xml error. If there is no objection i'll commit it as is. Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 2, 2023 Author Report Share Posted December 2, 2023 Yeah its better to get some of the issues fixed than to wait to repro the others too. Thanks again! Â Quote Link to comment Share on other sites More sharing options...
MirceaKitsune Posted December 3, 2023 Report Share Posted December 3, 2023 I presume this is the same issue I've been having? I could compile well on Linux for a long time, but suddenly the process no longer works! I thought it's an update in 0 A.D. Git, it may as well be something that changed in my Linux distro (I use Manjaro KDE). For me the error is: make: *** [Makefile:271: output/debug/FCollada/FUtils/FUXmlDocument.o] Error 1 make: *** Waiting for unfinished jobs.... ./build.sh: line 28: die: command not found ERROR: FCollada build failed  Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted December 3, 2023 Report Share Posted December 3, 2023 58 minutes ago, MirceaKitsune said: I presume this is the same issue I've been having? I could compile well on Linux for a long time, but suddenly the process no longer works! I thought it's an update in 0 A.D. Git, it may as well be something that changed in my Linux distro (I use Manjaro KDE). For me the error is: make: *** [Makefile:271: output/debug/FCollada/FUtils/FUXmlDocument.o] Error 1 make: *** Waiting for unfinished jobs.... ./build.sh: line 28: die: command not found ERROR: FCollada build failed It seems different from the original post. Could you share a full log (with the Collada compilation error)? Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 3, 2023 Author Report Share Posted December 3, 2023 I also encounter new errors now:  ../../../source/collada/XMLFix.cpp: In function ‘void FixBrokenXML(const char*, const char**, size_t*)’: ../../../source/collada/XMLFix.cpp:169:25: error: ‘xmlParseMemory’ was not declared in this scope 169 | xmlDocPtr doc = xmlParseMemory(text, (int)textSize); | ^~~~~~~~~~~~~~ make[1]: *** [Collada.make:162: obj/Collada_Release/XMLFix.o] Error 1 make[1]: *** Waiting for unfinished jobs.... ../../../source/collada/CommonConvert.cpp: In constructor ‘FColladaErrorHandler::FColladaErrorHandler(std::string&)’: ../../../source/collada/CommonConvert.cpp:59:9: error: ‘xmlSetGenericErrorFunc’ was not declared in this scope 59 | xmlSetGenericErrorFunc(&xmlErrors, &errorHandler); | ^~~~~~~~~~~~~~~~~~~~~~ ../../../source/collada/CommonConvert.cpp: In destructor ‘FColladaErrorHandler::~FColladaErrorHandler()’: ../../../source/collada/CommonConvert.cpp:68:9: error: ‘xmlSetGenericErrorFunc’ was not declared in this scope 68 | xmlSetGenericErrorFunc(NULL, NULL); | ^~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [Collada.make:138: obj/Collada_Release/CommonConvert.o] Error 1 Which can be fixed by:  diff --git a/source/collada/XMLFix.cpp b/source/collada/XMLFix.cpp index 2f1d67770e..39b8b08855 100644 --- a/source/collada/XMLFix.cpp +++ b/source/collada/XMLFix.cpp @@ -23,6 +23,8 @@ #include "FUtils/FUXmlParser.h" +#include <libxml/parser.h> + /* Things that are fixed here: diff --git a/source/collada/CommonConvert.cpp b/source/collada/CommonConvert.cpp index 391fcf47f6..2a57cea395 100644 --- a/source/collada/CommonConvert.cpp +++ b/source/collada/CommonConvert.cpp @@ -30,6 +30,7 @@ #include <cassert> #include <algorithm> +#include <libxml/xmlerror.h> void require_(int line, bool value, const char* type, const char* message) {  Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 4, 2023 Author Report Share Posted December 4, 2023 On 03/12/2023 at 4:51 AM, vladislavbelov said: It seems different from the original post. Could you share a full log (with the Collada compilation error)? I think I reproduced their errors: First error: FCollada/FUtils/FUXmlDocument.cpp: In constructor ‘FUXmlDocument::FUXmlDocument(FUFileManager*, const fchar*, bool)’: FCollada/FUtils/FUXmlDocument.cpp:39:39: error: ‘xmlParseMemory’ was not declared in this scope 39 | xmlDocument = xmlParseMemory((const char*) fileData, (int)fileLength); | ^~~~~~~~~~~~~~ FCollada/FUtils/FUXmlDocument.cpp: In constructor ‘FUXmlDocument::FUXmlDocument(const char*, size_t)’: FCollada/FUtils/FUXmlDocument.cpp:67:23: error: ‘xmlParseMemory’ was not declared in this scope 67 | xmlDocument = xmlParseMemory(data, (int)length); | ^~~~~~~~~~~~~~ In file included from FCollada/FMath/FMath.h:44, from FCollada/FUtils/FUtils.h:81: Second error: FColladaPlugins/FArchiveXML/FArchiveXML.cpp: In member function ‘virtual bool FArchiveXML::EndExport(fm::vector<unsigned char>&)’: FColladaPlugins/FArchiveXML/FArchiveXML.cpp:515:34: error: ‘xmlAllocOutputBuffer’ was not declared in this scope; did you mean ‘xmlOutputBuffer’? 515 | xmlOutputBufferPtr buf = xmlAllocOutputBuffer(NULL); | ^~~~~~~~~~~~~~~~~~~~ | xmlOutputBuffer FColladaPlugins/FArchiveXML/FArchiveXML.cpp:519:24: error: ‘xmlOutputBufferGetSize’ was not declared in this scope; did you mean ‘xmlOutputBufferPtr’? 519 | outData.resize(xmlOutputBufferGetSize(buf) * sizeof(xmlChar)); | ^~~~~~~~~~~~~~~~~~~~~~ | xmlOutputBufferPtr FColladaPlugins/FArchiveXML/FArchiveXML.cpp:520:33: error: ‘xmlOutputBufferGetContent’ was not declared in this scope; did you mean ‘xmlOutputBufferPtr’? 520 | memcpy(outData.begin(), xmlOutputBufferGetContent(buf), outData.size()); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | xmlOutputBufferPtr FColladaPlugins/FArchiveXML/FArchiveXML.cpp:526:9: error: ‘xmlOutputBufferClose’ was not declared in this scope; did you mean ‘xmlOutputBufferPtr’? 526 | xmlOutputBufferClose(buf); | ^~~~~~~~~~~~~~~~~~~~ | xmlOutputBufferPtr In file included from FCollada/FCDocument/FCDocument.h:27, from FColladaPlugins/FArchiveXML/FArchiveXML.h:21: Fixing the first error is simple:  diff --git a/libraries/source/fcollada/src/FCollada/FUtils/FUXmlDocument.cpp b/libraries/source/fcollada/src/FCollada/FUtils/FUXmlDocument.cpp index 5349249a87..2acf93006e 100644 --- a/libraries/source/fcollada/src/FCollada/FUtils/FUXmlDocument.cpp +++ b/libraries/source/fcollada/src/FCollada/FUtils/FUXmlDocument.cpp @@ -13,6 +13,8 @@ #include "FUFile.h" #include "FCDocument/FCDocument.h" +#include <libxml/parser.h> + #define MAX_FILE_SIZE 10240000 // // FUXmlDocument The second is hard because the file has mixed line endings with a few lines not being CRLF but instead LF and `patch` not being happy when applying. Imho the file should be fixed to either pure CRLF or LF. Following patch needs to be applied in binary mode to not break on a "different line endings" error: diff --git a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp index af67478960..99b64b9925 100644 --- a/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp +++ b/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp @@ -77,7 +77,7 @@ #include "FCDocument/FCDVersion.h" #include "FUtils/FUXmlDocument.h" - +#include <libxml/xmlIO.h> // // Constants //  Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 4, 2023 Author Report Share Posted December 4, 2023 Something really is fishy about libxml2 with all these errors popping up all over the place. Quote Link to comment Share on other sites More sharing options...
hyperion Posted December 4, 2023 Report Share Posted December 4, 2023 What version of libxml2 are you using and is it an install from your package manager and with no local build in path? Quote Link to comment Share on other sites More sharing options...
Riesi Posted December 4, 2023 Author Report Share Posted December 4, 2023 2 minutes ago, hyperion said: What version of libxml2 are you using and is it an install from your package manager and with no local build in path? I am using the one from my distro's (Arch) package manager, yes. libxml2 2.12.1-1 Looking at the PKGBUILD file they base it on this commit: git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=f4ac9926a463ecb628f73049e4fd7ecced8fb7cf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.