Bug 149653 - Build fails with poppler >= 22.03
Summary: Build fails with poppler >= 22.03
Status: RESOLVED MOVED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-21 10:22 UTC by Rajeesh KV
Modified: 2022-06-25 07:26 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rajeesh KV 2022-06-21 10:22:23 UTC
A GfxFont API change introduced in Poppler 22.04 causes the build to fail.


The root cause is that signature of method GfxFont::readEmbFontFile is changed as follows:

-unsigned char *GfxFont::readEmbFontFile(XRef *xref, int *len)
+std::vector<unsigned char> GfxFont::readEmbFontFile(XRef *xref)


which is used in the file `sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx`.

See discussion at [1] for some details.


[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/a6b2442e37cc00534bcdca7c83366a0fa0501157#note_1435294
Comment 1 Rajeesh KV 2022-06-23 10:42:28 UTC
Build also fails with Poppler 22.03 due to (private) API changes with following error:

/builddir/build/BUILD/libreoffice-7.3.4.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx: In function 'int main(int, char**)':
/builddir/build/BUILD/libreoffice-7.3.4.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:143:35: error: no matching function for call to 'PDFDoc::PDFDoc(GooString*&, GooString*&, GooString*&)'
  143 |                  pUserPasswordStr );
      |                                   ^
In file included from /builddir/build/BUILD/libreoffice-7.3.4.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:43,
                 from /builddir/build/BUILD/libreoffice-7.3.4.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:20:
/usr/include/poppler/PDFDoc.h:371:5: note: candidate: 'PDFDoc::PDFDoc()'
  371 |     PDFDoc();
      |     ^~~~~~
/usr/include/poppler/PDFDoc.h:371:5: note:   candidate expects 0 arguments, 3 provided
/usr/include/poppler/PDFDoc.h:139:14: note: candidate: 'PDFDoc::PDFDoc(BaseStream*, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)'
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:139:33: note:   no known conversion for argument 1 from 'GooString*' to 'BaseStream*'
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |                     ~~~~~~~~~~~~^~~~
/usr/include/poppler/PDFDoc.h:132:14: note: candidate: 'PDFDoc::PDFDoc(std::unique_ptr<GooString>&&, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)'
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:132:50: note:   no known conversion for argument 1 from 'GooString*' to 'std::unique_ptr<GooString>&&'
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/builddir/build/BUILD/libreoffice-7.3.4.2/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:147:35: error: no matching function for call to 'PDFDoc::PDFDoc(GooString*&, GooString*&, GooString*&)'
  147 |                  pUserPasswordStr );
      |                                   ^
/usr/include/poppler/PDFDoc.h:371:5: note: candidate: 'PDFDoc::PDFDoc()'
  371 |     PDFDoc();
      |     ^~~~~~
/usr/include/poppler/PDFDoc.h:371:5: note:   candidate expects 0 arguments, 3 provided
/usr/include/poppler/PDFDoc.h:139:14: note: candidate: 'PDFDoc::PDFDoc(BaseStream*, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)'
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:139:33: note:   no known conversion for argument 1 from 'GooString*' to 'BaseStream*'
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |                     ~~~~~~~~~~~~^~~~
/usr/include/poppler/PDFDoc.h:132:14: note: candidate: 'PDFDoc::PDFDoc(std::unique_ptr<GooString>&&, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)'
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:132:50: note:   no known conversion for argument 1 from 'GooString*' to 'std::unique_ptr<GooString>&&'
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
Comment 2 Roman Kuznetsov 2022-06-23 20:20:24 UTC
Rajeesh, what will happen if you will try to build the latest master?

Michael, I saw your +2 in this Poppler related patch https://gerrit.libreoffice.org/c/core/+/136261

Could you please look at this one too?
Comment 3 Xisco Faulí 2022-06-24 08:40:37 UTC
Hi Rajeesh KV,
Since this is an issue related to the building process and not to the software itself, please, send an email to the development mailing list: https://wiki.documentfoundation.org/Development/Mailing_List
Comment 4 Rajeesh KV 2022-06-24 10:18:42 UTC
(In reply to Roman Kuznetsov from comment #2)
> Rajeesh, what will happen if you will try to build the latest master?

I did not try with master. I was trying to update poppler in Fedora COPR (https://copr.fedorainfracloud.org/coprs/rajeeshknambiar/poppler/builds/); where at least TeXLive and LibreOffice need to be built in tandem (due to libpoppler.so.nnn dependency). Hit the error after 6 hours into building or so.

I will try to build the master branch, but I’m afraid it would require a number of hoops to jump (to create a release tarball, generate localization if any, etc.).

Good to know that update to Poppler 22.06 is already in the works! (Sorry I checked gerrit first to find if there is work in progress, but I missed it).
Comment 5 Rajeesh KV 2022-06-25 07:26:15 UTC
I am happy to report that the patch here (https://gerrit.libreoffice.org/c/core/+/136261) fixes the build with poppler 22.06 (both GfxFont and PDFDoc issues).

You can find the build log at https://download.copr.fedorainfracloud.org/results/rajeeshknambiar/poppler/fedora-36-x86_64/04561828-libreoffice/builder-live.log.gz