LanguageMachines / libfolia

FoLiA library for C++
https://proycon.github.io/folia
GNU General Public License v3.0
15 stars 7 forks source link

Compiling against libxml2-2.9.1 fails on CentOS 7 #50

Closed proycon closed 1 year ago

proycon commented 1 year ago

Latest stable libfolia fails to compile on CentOS 7 (pretty old, I know) against libxml2-2.9.1 (2013, so old as well):

  folia_impl.cxx: In member function ‘virtual folia::FoliaElement* folia::AbstractElement::parseXml(const xmlNode*)’:
  folia_impl.cxx:3400:38: error: invalid conversion from ‘const xmlNode*’ {aka ‘const _xmlNode*’} to ‘xmlNodePtr’ {aka ‘_xmlNode*’} [-fpermissive]
   3400 |     int sp = xmlNodeGetSpacePreserve(node);
        |                                      ^~~~
        |                                      |
        |                                      const xmlNode* {aka const _xmlNode*}
  In file included from /usr/local/include/ticcutils/XMLtools.h:34,
                   from folia_impl.cxx:42:
  /usr/include/libxml2/libxml/tree.h:1081:39: note:   initializing argument 1 of ‘int xmlNodeGetSpacePreserve(xmlNodePtr)’
   1081 |   xmlNodeGetSpacePreserve (xmlNodePtr cur);
        |                            ~~~~~~~~~~~^~~

Still, libfolia advertises libxml2 2.6.16 or later...

Ref: https://github.com/proycon/python-ucto/actions/runs/3950834083/jobs/6763898599#step:5:1472

proycon commented 1 year ago

I manually compiled and installed libxml2 2.9.9 (Jan 2019) and that works.

proycon commented 1 year ago

I updated the minimum version to one below (2.9.8, 2017) in commit 3ca60c6741ad36fd6e1a439e150205a56179f9e9, as I suspect that'll also work based on the changelog (not tested though)

proycon commented 1 year ago

Correction: I tried 2.9.14, not 2.9.9, so whether 2.9.8 works is a bit more speculative.. at least it's better than what we had (2.6.something)

kosloot commented 1 year ago

I'm sorry I didn't check libxml2 releases versions that last 10 years or so It's API is stable in general.

But that said: The end of life dates for CentOS 7 and 8 are as follows: CentOS 8 - December 31, 2021. CentOS 7 - June 30, 2024. So you have a point in supporting 7 for one more year. But the only reasonable way is, imho, to add missing or updated versions to your CentOS packages (like you did for libxml2 and libtar) That can of course be a pita. Forcing all other versions to outdated versions is undesirable. And a bigger pita, I am sure.

kosloot commented 1 year ago

Correction: I tried 2.9.14, not 2.9.9, so whether 2.9.8 works is a bit more speculative.. at least it's better than what we had (2.6.something)

This breaks all builds on MacOS using GitHub actions. We should lower the version somewhat... 2.9.4 seems available on MacoS

proycon commented 1 year ago

Fixed in dc20f61ac06706daa08583567bf6d502ca7bde6e