Opened 19 months ago

Last modified 8 months ago

#67266 assigned defect

poppler: patch-poppler-gcc7-noexcept.diff fails to apply

Reported by: barracuda156 Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: mascguy (Christopher Nielsen), ballapete (Peter "Pete" Dyballa)
Port: poppler

Description

--->  Extracting poppler-23.04.0.tar.xz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work" && /opt/local/bin/xz -dc '/opt/local/var/macports/distfiles/poppler/poppler-23.04.0.tar.xz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Applying patches to poppler
--->  Applying patch-cmake_modules_PopplerMacros.cmake.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/poppler/files/patch-cmake_modules_PopplerMacros.cmake.diff'
patching file cmake/modules/PopplerMacros.cmake
--->  Applying patch-glib_CMakeFiles.txt-fix-include-ordering.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/poppler/files/patch-glib_CMakeFiles.txt-fix-include-ordering.diff'
patching file glib/CMakeLists.txt
--->  Applying patch-poppler-gcc7-noexcept.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/poppler/files/patch-poppler-gcc7-noexcept.diff'
patching file poppler/GfxFont.cc
patching file poppler/GfxFont.h
patching file poppler/CertificateInfo.cc
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file poppler/CertificateInfo.cc.rej
patching file poppler/CertificateInfo.h
Hunk #1 FAILED at 70.
1 out of 1 hunk FAILED -- saving rejects to file poppler/CertificateInfo.h.rej
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/poppler/files/patch-poppler-gcc7-noexcept.diff'
Exit code: 1
Error: Failed to patch poppler: command execution failed

Attachments (3)

poppler-gcc-1.diff (547 bytes) - added by rmottola (Riccardo) 19 months ago.
patch header part
poppler-gcc-2.diff (495 bytes) - added by rmottola (Riccardo) 19 months ago.
gcc patch part 2
patch-CMakeFiles.txt-fix-Gpgmepp.diff (344 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 months ago.
Patch to remove mandory "Gpgmepp" from CMakeLists.txt

Download all attachments as: .zip

Change History (24)

comment:1 Changed 19 months ago by ryandesign (Ryan Carsten Schmidt)

comment:2 Changed 19 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 19 months ago by rmottola (Riccardo)

I tried building without the patch with gcc7, I get this failure:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0/poppler/GfxFont.cc:183:13: error: function 'GfxFontLoc& GfxFontLoc::operator=(GfxFontLoc&&)' defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ''
:info:build  GfxFontLoc &GfxFontLoc::operator=(GfxFontLoc &&other) noexcept = default;
:info:build              ^~~~~~~~~~
:info:build /opt/local/var/macports/build/

so indeed something is still needed.

comment:4 Changed 19 months ago by rmottola (Riccardo)

I regenerated the patch, due to working in the work dir it is split in two.

However, I get this error:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0/poppler/GfxFont.cc: In member function 'std::optional<GfxFontLoc> GfxFont::locateFont(XRef*, PSOutputDev*)':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0/poppler/GfxFont.cc:660:24: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
:info:build                  return fontLoc;
:info:build                         ^~~~~~~
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.04.0/poppler/GfxFont.cc:671:16: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
:info:build          return fontLoc;
:info:build                 ^~~~~~~

Some clues?

Changed 19 months ago by rmottola (Riccardo)

Attachment: poppler-gcc-1.diff added

patch header part

Changed 19 months ago by rmottola (Riccardo)

Attachment: poppler-gcc-2.diff added

gcc patch part 2

comment:5 Changed 19 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ballapete added

Has duplicate #67331.

comment:6 Changed 19 months ago by ballapete (Peter "Pete" Dyballa)

It fails on PPC Tiger as well as on PPC Leopard.

comment:7 Changed 16 months ago by rmottola (Riccardo)

I applied the two patches provided, I have now link failure. Some ideas?

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc: In member function 'std::optional<GfxFontLoc> GfxFont::locateFont(XRef*, PSOutputDev*, GooString*)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:680:24: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
                 return fontLoc;
                        ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:691:16: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
         return fontLoc;
                ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:700:16: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
         return fontLoc;
                ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:731:24: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
                 return fontLoc;
                        ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:743:20: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
             return fontLoc;
                    ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:772:20: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
             return fontLoc;
                    ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc: In static member function 'static std::optional<GfxFontLoc> GfxFont::getExternalFont(GooString*, bool)':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-23.07.0/poppler/GfxFont.cc:834:12: error: could not convert 'fontLoc' from 'GfxFontLoc' to 'std::optional<GfxFontLoc>'
     return fontLoc;
            ^~~~~~~
make[2]: *** [CMakeFiles/poppler.dir/poppler/GfxFont.cc.o] Error 1

comment:8 Changed 16 months ago by barracuda156

FWIW, I have 23.07.0 installed, and I believe I did nothing special to fix it, using an existing port. So perhaps the error is specific to gcc7. If so, another reason, in addition to a broken ICU, to switch finally to modern GCC for older systems.

I can verify 23.07.0 build fine on PowerPC with gcc12 a bit later, rather do it on a faster machine.

comment:9 Changed 10 months ago by rmottola (Riccardo)

I am still stuck with this error, I tried using gcc also on intel because of clang failures

--->  Applying patch-poppler-gcc7-noexcept.diff
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.01.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/graphics/poppler/files/patch-poppler-gcc7-noexcept.diff'
patching file poppler/GfxFont.cc
Hunk #1 succeeded at 181 (offset 1 line).
patching file poppler/GfxFont.h
patching file poppler/CertificateInfo.cc
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file poppler/CertificateInfo.cc.rej
patching file poppler/CertificateInfo.h
Hunk #1 FAILED at 70.
1 out of 1 hunk FAILED -- saving rejects to file poppler/CertificateInfo.h.rej

comment:10 in reply to:  9 Changed 10 months ago by barracuda156

Replying to rmottola:

Just to be clear, the issue is still just a broken patch or regardless of the patch a broken build with gcc7?

Builds fine for me with gcc13 for ppc, but I cannot check on 10.5.8 at the moment.

comment:11 Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

The sources have partly changed, the kind of second half in patch-poppler-gcc7-noexcept.diff can be removed:

     34 --- poppler/CertificateInfo.cc.orig
     35 +++ poppler/CertificateInfo.cc
     36 @@ -39,7 +39,7 @@
     37 
     38  X509CertificateInfo::EntityInfo::EntityInfo(X509CertificateInfo::EntityInfo &&other) noexcept = default;
     39 
     40 -X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) noexcept = default;
     41 +X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) = default;
     42 
     43  X509CertificateInfo::X509CertificateInfo() : ku_extensions(KU_NONE), cert_version(-1), is_self_signed(false) { }
     44 
     45 --- poppler/CertificateInfo.h.orig
     46 +++ poppler/CertificateInfo.h
     47 @@ -70,7 +70,7 @@
     48          ~EntityInfo();
     49 
     50          EntityInfo(EntityInfo &&) noexcept;
     51 -        EntityInfo &operator=(EntityInfo &&) noexcept;
     52 +        EntityInfo &operator=(EntityInfo &&);
     53 
     54          EntityInfo(const EntityInfo &) = delete;
     55          EntityInfo &operator=(const EntityInfo &) = delete;

There does not seem to exist any code that resembles that cited above (but I have no idea of C++…)

comment:12 in reply to:  11 ; Changed 9 months ago by barracuda156

Replying to ballapete:

The sources have partly changed, the kind of second half in patch-poppler-gcc7-noexcept.diff can be removed:

     34 --- poppler/CertificateInfo.cc.orig
     35 +++ poppler/CertificateInfo.cc
     36 @@ -39,7 +39,7 @@
     37 
     38  X509CertificateInfo::EntityInfo::EntityInfo(X509CertificateInfo::EntityInfo &&other) noexcept = default;
     39 
     40 -X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) noexcept = default;
     41 +X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) = default;
     42 
     43  X509CertificateInfo::X509CertificateInfo() : ku_extensions(KU_NONE), cert_version(-1), is_self_signed(false) { }
     44 
     45 --- poppler/CertificateInfo.h.orig
     46 +++ poppler/CertificateInfo.h
     47 @@ -70,7 +70,7 @@
     48          ~EntityInfo();
     49 
     50          EntityInfo(EntityInfo &&) noexcept;
     51 -        EntityInfo &operator=(EntityInfo &&) noexcept;
     52 +        EntityInfo &operator=(EntityInfo &&);
     53 
     54          EntityInfo(const EntityInfo &) = delete;
     55          EntityInfo &operator=(const EntityInfo &) = delete;

There does not seem to exist any code that resembles that cited above (but I have no idea of C++…)

If you confirm it builds with gcc7 then, please submit a PR with the fix.

comment:13 in reply to:  12 ; Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

Replying to barracuda156:

Replying to ballapete:

If you confirm it builds with gcc7 then, please submit a PR with the fix.

It does not build. In #69296 I reported the error that came up after build has started.

comment:14 in reply to:  13 ; Changed 9 months ago by barracuda156

Replying to ballapete:

Replying to barracuda156:

Replying to ballapete:

If you confirm it builds with gcc7 then, please submit a PR with the fix.

It does not build. In #69296 I reported the error that came up after build has started.

Got it. Could you try with a newer GCC, that will help to understand if it is a compiler fault of SDK fault. gcc10-bootstrap could be used, that will not require any global changes to Macports setup etc. Just add the chunk for gcc10-bootstrap into poppler portfile, according to port notes.

comment:15 Changed 9 months ago by barracuda156

  1. S. I can actually try that on Leopard with gcc10-bootstrap but not at the moment, away from that machine now.

comment:16 in reply to:  14 Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

Replying to barracuda156:

Not now. I booted into Leopard and am trying to tell System Preferences that my new WLAN router uses Personal WPA2 and that the network key contains non-ASCII chars…

In case I'll succeed this week in getting network access I'll upgrade all ports on Leopard. This will take a few days. Building gcc10-bootstrap can take some days, too. I tested its build some years ago…

comment:17 in reply to:  15 ; Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

Replying to barracuda156:

  1. S. I can actually try that on Leopard with gcc10-bootstrap but not at the moment, away from that machine now.

Is the keyword to select this compiler configure.compiler=gcc10-bootstrap? I usually use this construct on the command line because it's easier to handle inside GNU Emacs.

comment:18 in reply to:  17 Changed 9 months ago by barracuda156

Replying to ballapete:

Replying to barracuda156:

  1. S. I can actually try that on Leopard with gcc10-bootstrap but not at the moment, away from that machine now.

Is the keyword to select this compiler configure.compiler=gcc10-bootstrap? I usually use this construct on the command line because it's easier to handle inside GNU Emacs.

This won’t work. Borrow the code from clang-11-bootstrap port or libcxx-powerpc. It has to explicitly set configure.cc and configure.cxx.

comment:19 Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

gcc10-bootstrap does not build (yet) on my PPC Tiger – and I forgot to submit the ticket!

comment:20 in reply to:  19 Changed 9 months ago by ballapete (Peter "Pete" Dyballa)

Replying to ballapete:

gcc10-bootstrap does not build (yet) on my PPC Tiger – and I forgot to submit the ticket!

Actually I did submit the problem, I only did not receive an eMail as receipt. Here is the ticket: #69325.

comment:21 Changed 8 months ago by ballapete (Peter "Pete" Dyballa)

poppler-24.03.0 fails to find gpgme

CMake Warning at CMakeLists.txt:160 (find_package):
  By not providing "FindGpgme.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Gpgme", but
  CMake did not find one.

  Could not find a package configuration file provided by "Gpgme" (requested
  version 1.19) with any of the following names:

    GpgmeConfig.cmake
    gpgme-config.cmake

  Add the installation prefix of "Gpgme" to CMAKE_PREFIX_PATH or set
  "Gpgme_DIR" to a directory containing one of the above files.  If "Gpgme"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:168 (find_soft_mandatory_package)


CMake Error at CMakeLists.txt:162 (MESSAGE):
  Could not find the 1.19 version of Gpgme.  If you're not interested in the
  features it provides set the cmake ENABLE_GPGME option to OFF
Call Stack (most recent call first):
  CMakeLists.txt:168 (find_soft_mandatory_package)


-- Configuring incomplete, errors occurred!

because CMakeLists.txt has on #169?

find_soft_mandatory_package(ENABLE_GPGME Gpgmepp 1.19)

I do have a suitable version of gpgme installed:

  gpgme @1.20.0_0 (active) requested_variants='' platform='darwin 8' archs='ppc' date='2023-05-25T00:50:02+0200'

so line #82 might become?

option(ENABLE_GPGME "Build the GPG backend for cryptographic support" OFF)

Because gpgme might be different from Gpgmepp – is the latter MacPorts' gpgme-objc @1.0.2_6? Most important is line #169 that sets Gpgmepp as mandatory. And since it's not found, compilation ends here. OTOH the ENABLE_GPGME macro is used more than once in CMakeLists.txt – maybe it just tells to try use GnuPG if found?

When line #169 is removed and line #82 is left unchanged the build process ends here:

[  8%] Building CXX object CMakeFiles/poppler.dir/fofi/FoFiType1.cc.o
/opt/local/bin/g++-mp-7 -Dpoppler_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0/fofi -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0/goo -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0/poppler -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/build -I/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/build/poppler -isystem /opt/local/include/openjpeg-2.5 -isystem /opt/local/include -isystem /opt/local/include/freetype2 -isystem /usr/X11/include -isystem /opt/local/include/nss -isystem /opt/local/include/nspr -isystem /opt/local/libexec/boost/1.76/include -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align -Wformat-security -Wframe-larger-than=65536 -Wlogical-op -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow -Wsuggest-override -fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE -O2 -g -pipe -I/opt/local/libexec/boost/1.76/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.76/include -isystem/opt/local/include/LegacySupport -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.4 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++1z -MD -MT CMakeFiles/poppler.dir/fofi/FoFiType1.cc.o -MF CMakeFiles/poppler.dir/fofi/FoFiType1.cc.o.d -o CMakeFiles/poppler.dir/fofi/FoFiType1.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0/fofi/FoFiType1.cc
/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/poppler-24.03.0/fofi/FoFiType1.cc:31:10: fatal error: charconv: No such file or directory
 #include <charconv>
          ^~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/poppler.dir/build.make:331: CMakeFiles/poppler.dir/fofi/FoFiType1.cc.o] Error 1
gmake[2]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/build'
gmake[1]: *** [CMakeFiles/Makefile2:202: CMakeFiles/poppler.dir/all] Error 2
gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/build'
gmake: *** [Makefile:149: all] Error 2
gmake: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_graphics_poppler/poppler/work/build'

This C++ charconv file can be found on newer macOS versions (Sonoma), it seems that also up-to-date versions of GCC (13) or Clang provide it.

Changed 8 months ago by ballapete (Peter "Pete" Dyballa)

Patch to remove mandory "Gpgmepp" from CMakeLists.txt

Note: See TracTickets for help on using tickets.