Bug 158302 - libxml type issue in 7.6.3.2
Summary: libxml type issue in 7.6.3.2
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.3.2 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.2.0 target:7.6.5
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-21 17:33 UTC by Gwyn Ciesla
Modified: 2024-04-15 09:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
libxml2 fixes patch (14.34 KB, patch)
2023-11-27 00:07 UTC, Douglas Reno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gwyn Ciesla 2023-11-21 17:33:19 UTC
Compilation of 7.6.3.2 release fails with libxml2 2.12.0:

/builddir/build/BUILD/libreoffice-7.6.3.2/sax/source/fastparser/fastparser.cxx: In function ‘rtl::OUString {anonymous}::lclGetErrorMessage(xmlParserCtxtPtr, std::u16string_view, sal_Int32)’:
/builddir/build/BUILD/libreoffice-7.6.3.2/sax/source/fastparser/fastparser.cxx:582:44: error: invalid conversion from ‘const xmlError*’ {aka ‘const _xmlError*’} to ‘xmlErrorPtr’ {aka ‘_xmlError*’} [-fpermissive]
  582 |     xmlErrorPtr error = xmlCtxtGetLastError( ctxt );
      |                         ~~~~~~~~~~~~~~~~~~~^~~~~~~~
      |                                            |
      |                                            const xmlError* {aka const _xmlError*}
S=/builddir/build/BUILD/libreoffice-7.6.3.2 && I=$S/instdir && W=$S/workdir &&  readelf -d $I/program/libuno_purpenvhelpergcc3.so.3 | grep SONAME > $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports.tmp; gcc-nm  --dynamic --extern-only --defined-only --format=posix $I/program/libuno_purpenvhelpergcc3.so.3 | cut -d' ' -f1-2 >> $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports.tmp && if cmp -s $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports.tmp  $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports; then rm $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports.tmp; else mv $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports.tmp  $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports && touch -r $I/program/libuno_purpenvhelpergcc3.so.3  $W/LinkTarget/Library/libuno_purpenvhelpergcc3.so.3.exports; fi
S=/builddir/build/BUILD/libreoffice-7.6.3.2 && I=$S/instdir && W=$S/workdir &&  readelf -d $I/program/libxmlreaderlo.so | grep SONAME > $W/LinkTarget/Library/libxmlreaderlo.so.exports.tmp; gcc-nm  --dynamic --extern-only --defined-only --format=posix $I/program/libxmlreaderlo.so | cut -d' ' -f1-2 >> $W/LinkTarget/Library/libxmlreaderlo.so.exports.tmp && if cmp -s $W/LinkTarget/Library/libxmlreaderlo.so.exports.tmp  $W/LinkTarget/Library/libxmlreaderlo.so.exports; then rm $W/LinkTarget/Library/libxmlreaderlo.so.exports.tmp; else mv $W/LinkTarget/Library/libxmlreaderlo.so.exports.tmp  $W/LinkTarget/Library/libxmlreaderlo.so.exports && touch -r $I/program/libxmlreaderlo.so  $W/LinkTarget/Library/libxmlreaderlo.so.exports; fi
/builddir/build/BUILD/libreoffice-7.6.3.2/helpcompiler/source/HelpLinker.cxx: In function ‘bool compileExtensionHelp(const rtl::OUString&, std::u16string_view, std::u16string_view, sal_Int32, const rtl::OUString*, std::u16string_view, HelpProcessingErrorInfo&)’:
/builddir/build/BUILD/libreoffice-7.6.3.2/helpcompiler/source/HelpLinker.cxx:879:41: error: invalid conversion from ‘void (*)(void*, xmlErrorPtr)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
  879 |     xmlSetStructuredErrorFunc( nullptr, StructuredXMLErrorFunction );
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                         |
      |                                         void (*)(void*, xmlErrorPtr) {aka void (*)(void*, _xmlError*)}
In file included from /usr/include/libxml2/libxml/valid.h:15,
                 from /usr/include/libxml2/libxml/parser.h:17,
                 from /builddir/build/BUILD/libreoffice-7.6.3.2/helpcompiler/inc/HelpCompiler.hxx:30,
                 from /builddir/build/BUILD/libreoffice-7.6.3.2/helpcompiler/source/HelpLinker.cxx:20:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note:   initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Comment 1 Douglas Reno 2023-11-27 00:07:54 UTC
Created attachment 191050 [details]
libxml2 fixes patch

Two of our users at Linux From Scratch have developed a patch to fix this problem. It applies a patch to a few external tarballs and then includes some changes for Libreoffice's source code itself. The patch has been tested on Libreoffice 7.6.3.2 and libxml2-2.12.1.
Comment 2 Miklos Vajna 2023-11-27 07:22:52 UTC
Oh, I see the description of the bug, then prepared https://gerrit.libreoffice.org/c/core/+/159980 to fix this on master. In the meantime comment 1 appeared. :-)

The gerrit one just fixes the system-libs case, which is probably what the description mentions.

Douglas: I see xmlsec upstream already has fixes merged; could you please submit the cmis and langtag fixes to the upstream projects?

In the meantime, let me take this bug for the libreoffice piece.
Comment 3 Commit Notification 2023-11-27 15:09:48 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c8f7408db73d2f2ccacb25a2b4fef8dfebdfc6cb

tdf#158302 fix build against system-libxml-2.12

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Miklos Vajna 2023-11-27 15:10:55 UTC
Fixed on master.

Gwyn: could you confirm that the problem you see is fixed if you pick the above patch to your 7.6 build?
Comment 5 Gwyn Ciesla 2023-11-27 17:51:40 UTC
I had to refactor one piece of the patch to apply to 7.6.3.2, and it still fails:

https://kojipkgs.fedoraproject.org//work/tasks/2557/109622557/build.log
Comment 6 Andreas Radke 2023-11-27 18:26:24 UTC
The patch applied well here (Arch) against 7.6.3.2 without modifications and build finished against systemd libxml2 (2.12.1) and libxslt.
Comment 7 Miklos Vajna 2023-11-28 07:51:28 UTC
(In reply to Gwyn Ciesla from comment #5)
> I had to refactor one piece of the patch to apply to 7.6.3.2, and it still
> fails:
> 
> https://kojipkgs.fedoraproject.org//work/tasks/2557/109622557/build.log

Could you please file a follow-up bug for CppunitTest_unoxml_domtest failing with libxml-2.12?

That needs further investigation, it's something deeper, not just a build failure. Thanks.
Comment 8 Gwyn Ciesla 2023-11-28 19:02:44 UTC
Done, thanks!

https://bugs.documentfoundation.org/show_bug.cgi?id=158423
Comment 9 Commit Notification 2024-01-05 13:29:58 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/764890a53cea2ccb6d2fb6d8c7edb5e1c91ecdc0

tdf#158302 fix build against system-libxml-2.12

It will be available in 7.6.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Amos Keister 2024-04-15 09:54:39 UTC
(In reply to Commit Notification from comment #9)
> Miklos Vajna committed a patch related to this issue.
> It has been pushed to "libreoffice-7-6":
> 
> https://git.libreoffice.org/core/commit/https://geometry-dash-online.com
> 764890a53cea2ccb6d2fb6d8c7edb5e1c91ecdc0
> 
> tdf#158302 fix build against system-libxml-2.12
> 
> It will be available in 7.6.5.
> 
> The patch should be included in the daily builds available at
> https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> information about daily builds can be found at:
> https://wiki.documentfoundation.org/Testing_Daily_Builds
> 
> Affected users are encouraged to test the fix and report feedback.

Thanks for the answer.