Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libreoffice: fix build with poppler-0.83 #74955

Merged
merged 1 commit into from Dec 4, 2019
Merged

Conversation

@mmilata
Copy link
Member

@mmilata mmilata commented Dec 4, 2019

Motivation for this change

Fixes: #74948

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@mmilata mmilata force-pushed the mmilata:lo-poppler-0.82 branch from 613c0a6 to 83cadfa Dec 4, 2019
@ofborg ofborg bot requested a review from 7c6f434c Dec 4, 2019
@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Dec 4, 2019

Looking at the source code, it will not be sufficient:

https://github.com/LibreOffice/core/blob/60e8941fd581bb06cbf6be62edb8c387e7c07812/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx#L71

GlobalParams need to be std::unique_ptr, see this Inkscape patch:

https://gitlab.com/inkscape/inkscape/merge_requests/1088/diffs

I will create patch tomorrow if nobody beats me to it.

@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Dec 4, 2019

It built surprisingly fast so here are the const qualifiers needed:

/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx: In function 'int main(int, char**)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:71:37: error: no match for 'operator=' (operand types are 'std::unique_ptr<GlobalParams>' and 'GlobalParams*')
     globalParams = new GlobalParams();
                                     ^
In file included from /nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/memory:80,
                 from /nix/store/p30m4hiihrh0dxly42ivg7w4h5dlmnxc-poppler-glib-0.83.0-dev/include/poppler/Link.h:34,
                 from /build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:39,
                 from /build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:20:
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:287:7: note: candidate: 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>]'
       operator=(unique_ptr&& __u) noexcept
       ^~~~~~~~
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:287:7: note:   no known conversion for argument 1 from 'GlobalParams*' to 'std::unique_ptr<GlobalParams>&&'
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:307:2: note: candidate: 'template<class _Up, class _Ep> typename std::enable_if<std::__and_<std::__and_<std::is_convertible<typename std::unique_ptr<_Up, _Ep>::pointer, typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer>, std::__not_<std::is_array<_Up> >, std::__or_<std::__and_<std::is_reference<_Dp>, std::is_same<_T2, _U2> >, std::__and_<std::__not_<std::is_reference<_Dp> >, std::is_convertible<_Ep, _Dp> > > >, std::is_assignable<_T2&, _U2&&> >::value, std::unique_ptr<_Tp, _Dp>&>::type std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = _Up; _Ep = _Ep; _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>]'
  operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
  ^~~~~~~~
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:307:2: note:   template argument deduction/substitution failed:
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:71:37: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'GlobalParams*'
     globalParams = new GlobalParams();
                                     ^
In file included from /nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/memory:80,
                 from /nix/store/p30m4hiihrh0dxly42ivg7w4h5dlmnxc-poppler-glib-0.83.0-dev/include/poppler/Link.h:34,
                 from /build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:39,
                 from /build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx:20:
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:316:7: note: candidate: 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::nullptr_t) [with _Tp = GlobalParams; _Dp = std::default_delete<GlobalParams>; std::nullptr_t = std::nullptr_t]'
       operator=(nullptr_t) noexcept
       ^~~~~~~~
/nix/store/vgn1sxcj5ma9m5bhjps1q9jx3q2ab27c-gcc-8.3.0/include/c++/8.3.0/bits/unique_ptr.h:316:7: note:   no known conversion for argument 1 from 'GlobalParams*' to 'std::nullptr_t'
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'virtual void pdfi::PDFOutDev::stroke(GfxState*)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:799:30: error: invalid conversion from 'const GfxPath*' to 'GfxPath*' [-fpermissive]
     printPath( state->getPath() );
                ~~~~~~~~~~~~~~^~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:494:37: note:   initializing argument 1 of 'static void pdfi::PDFOutDev::printPath(GfxPath*)'
 void PDFOutDev::printPath( GfxPath* pPath )
                            ~~~~~~~~~^~~~~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'virtual void pdfi::PDFOutDev::fill(GfxState*)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:810:30: error: invalid conversion from 'const GfxPath*' to 'GfxPath*' [-fpermissive]
     printPath( state->getPath() );
                ~~~~~~~~~~~~~~^~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:494:37: note:   initializing argument 1 of 'static void pdfi::PDFOutDev::printPath(GfxPath*)'
 void PDFOutDev::printPath( GfxPath* pPath )
                            ~~~~~~~~~^~~~~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'virtual void pdfi::PDFOutDev::eoFill(GfxState*)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:821:30: error: invalid conversion from 'const GfxPath*' to 'GfxPath*' [-fpermissive]
     printPath( state->getPath() );
                ~~~~~~~~~~~~~~^~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:494:37: note:   initializing argument 1 of 'static void pdfi::PDFOutDev::printPath(GfxPath*)'
 void PDFOutDev::printPath( GfxPath* pPath )
                            ~~~~~~~~~^~~~~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'virtual void pdfi::PDFOutDev::clip(GfxState*)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:832:30: error: invalid conversion from 'const GfxPath*' to 'GfxPath*' [-fpermissive]
     printPath( state->getPath() );
                ~~~~~~~~~~~~~~^~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:494:37: note:   initializing argument 1 of 'static void pdfi::PDFOutDev::printPath(GfxPath*)'
 void PDFOutDev::printPath( GfxPath* pPath )
                            ~~~~~~~~~^~~~~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'virtual void pdfi::PDFOutDev::eoClip(GfxState*)':
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:843:30: error: invalid conversion from 'const GfxPath*' to 'GfxPath*' [-fpermissive]
     printPath( state->getPath() );
                ~~~~~~~~~~~~~~^~
/build/libreoffice-6.3.0.4/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:494:37: note:   initializing argument 1 of 'static void pdfi::PDFOutDev::printPath(GfxPath*)'
 void PDFOutDev::printPath( GfxPath* pPath )
                            ~~~~~~~~~^~~~~
make[1]: *** [/build/libreoffice-6.3.0.4/solenv/gbuild/LinkTarget.mk:293: /build/libreoffice-6.3.0.4/workdir/CxxObject/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [/build/libreoffice-6.3.0.4/solenv/gbuild/LinkTarget.mk:293: /build/libreoffice-6.3.0.4/workdir/CxxObject/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.o] Error 1

@mmilata mmilata force-pushed the mmilata:lo-poppler-0.82 branch from 83cadfa to fc6dc0f Dec 4, 2019
@mmilata mmilata changed the title libreoffice: fix build with poppler-0.82 libreoffice: fix build with poppler-0.83 Dec 4, 2019
@mmilata mmilata force-pushed the mmilata:lo-poppler-0.82 branch from fc6dc0f to a6c8221 Dec 4, 2019
@mmilata
Copy link
Member Author

@mmilata mmilata commented Dec 4, 2019

Added patch that fixes the consts

@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Dec 4, 2019

Great. Could you also submit it upstream and add a link to gerrit in a comment?

@mmilata mmilata force-pushed the mmilata:lo-poppler-0.82 branch from a6c8221 to 7f1bf28 Dec 4, 2019
@mmilata
Copy link
Member Author

@mmilata mmilata commented Dec 4, 2019

Copy link
Member

@7c6f434c 7c6f434c left a comment

Did not build, but read all the patches (with GitHub you can never trust URLs).

@7c6f434c
Copy link
Member

@7c6f434c 7c6f434c commented Dec 4, 2019

@jtojnar you built and ran it, right?

@jtojnar
jtojnar approved these changes Dec 4, 2019
Copy link
Contributor

@jtojnar jtojnar left a comment

Confirmed that both stale and fresh packages build and run on NixOS.

Nice work.

@jtojnar jtojnar merged commit 80913b5 into NixOS:master Dec 4, 2019
15 checks passed
15 checks passed
libreoffice on aarch64-linux Timed out, unknown build status
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
libreoffice on x86_64-linux Success
Details
@mmilata mmilata deleted the mmilata:lo-poppler-0.82 branch Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.