Jump to content

Building latest revision is currently broken for Linux


Riesi
 Share

Recommended Posts

Okey so all issues that libxml2 wanted to fix are on their latest upstream now.

Only remaining fix is for the function pointer that changed. They suggested that 0ad should fix this. They also linked a commit from WebKit fixing it.
https://github.com/WebKit/WebKit/commit/1bad176b2496579d760852c80cff3ad9fb7c3a4b

I used this patch as a base for the same issue on the 0ad side.
Casting the function pointer to `xmlStructuredErrorFunc` would have also worked, but it would be less clean in my opinion.

Error:

../../../source/ps/XML/RelaxNG.cpp:162:50: error: invalid conversion from ‘void (*)(void*, xmlErrorPtr)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
  162 |         xmlRelaxNGSetValidStructuredErrors(ctxt, &relaxNGErrorHandler, NULL);
      |                                                  ^~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  void (*)(void*, xmlErrorPtr) {aka void (*)(void*, _xmlError*)}

../../../source/ps/XML/Xeromyces.cpp:59:41: error: invalid conversion from ‘void (*)(void*, xmlErrorPtr)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   59 |         xmlSetStructuredErrorFunc(NULL, &errorHandler);
      |                                         ^~~~~~~~~~~~~
      |                                         |
      |                                         void (*)(void*, xmlErrorPtr) {aka void (*)(void*, _xmlError*)}

libxml2_fix.patch

Edited by Riesi
  • Thanks 3
Link to comment
Share on other sites

Thank you for the work.

I don't like preprocessor directives. We could go for:

void errorHandler(void* UNUSED(userData), std::conditional_t<LIBXML_VERSION >= 21200, const xmlError, xmlError>* error)

Also that wouldn't introduce duplication.

@hyperion Does Fcollada also have an issue with newer lxbxml2 version? I get this errors:

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);
      |                       ^~~~~~~~~~~~~~

 

Link to comment
Share on other sites

20 minutes ago, phosit said:

I don't like preprocessor directives. We could go for:

void errorHandler(void* UNUSED(userData), std::conditional_t<LIBXML_VERSION >= 21200, const xmlError, xmlError>* error)

As long as it's not the cast variant of solving this I'd be fine with either.

 

21 minutes ago, phosit said:

@hyperion Does Fcollada also have an issue with newer lxbxml2 version?

Looking at the linked ticket a future 2.12.3 should no longer have any issue, still technically it's a downstream bug, just that the fallout was unexpectedly large and the missing headers where injected back upstream. So I'd add the parser header regardless as this also allows the use of all 2.12.x releases.

Link to comment
Share on other sites

1 hour ago, hyperion said:
1 hour ago, phosit said:

@hyperion Does Fcollada also have an issue with newer lxbxml2 version?

Looking at the linked ticket a future 2.12.3 should no longer have any issue, still technically it's a downstream bug, just that the fallout was unexpectedly large and the missing headers where injected back upstream. So I'd add the parser header regardless as this also allows the use of all 2.12.x releases.

Right i used 2.12.1

Can you upload a patch? (I'm shy of patching libraries)

1 hour ago, vladislavbelov said:

It seems a bit less readable to me and it'll be inconsistent anyway as we can't use such approach everywhere. But I don't mind in that particular case.

To address the readability issue we could use a temporary/using.

using MaybeConstXmlError = std::conditional_t<LIBXML_VERSION >= 21200, const xmlError, xmlError>;
void errorHandler(void* UNUSED(userData), MaybeConstXmlError* error)
Link to comment
Share on other sites

5 hours ago, phosit said:

Can you upload a patch? (I'm shy of patching libraries)

Is correct but might be incomplete.

Edit: tested to be complete, builds with 2.11.5, 2.12.1, 2.12.2 and git HEAD.

 

5 hours ago, phosit said:

To address the readability issue we could use a temporary/using.

using MaybeConstXmlError = std::conditional_t<LIBXML_VERSION >= 21200, const xmlError, xmlError>;
void errorHandler(void* UNUSED(userData), MaybeConstXmlError* error)

Don't think this improves readability over your first suggestion. It's not complexity that is the issue just that people aren't used to it in this context so it takes an extra one or two seconds to mentally parse, at least for me. The greater than char in the greater than equal token doesn't help ;) Whether or not the tradeoff vs. not using the preprocessor is worth it I don't know.

Edited by hyperion
Link to comment
Share on other sites

  • 3 weeks later...

An update on the situation: I can now successfully compile the latest Git version of 0 A.D. again without any errors, on the latest snapshot of Manjaro Linux. However I can't run it due to a missing library issue.

/home/mircea/Games/0ad/0ad_GIT/binaries/system/pyrogenesis: error while loading shared libraries: libicui18n.so.73: cannot open shared object file: No such file or directory

I have the ICU package installed. However my version is 74.2-1: I take it Pyrogenesis needs to be updated to use this newer version?

Edited by MirceaKitsune
Link to comment
Share on other sites

1 hour ago, MirceaKitsune said:

An update on the situation: I can now successfully compile the latest Git version of 0 A.D. again without any errors, on the latest snapshot of Manjaro Linux. However I can't run it due to a missing library issue.

/home/mircea/Games/0ad/0ad_GIT/binaries/system/pyrogenesis: error while loading shared libraries: libicui18n.so.73: cannot open shared object file: No such file or directory

I have the ICU package installed. However my version is 74.2-1: I take it Pyrogenesis needs to be updated to use this newer version?

Try cleaning workspaces and rebuilding.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...