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

[libgxps] Add new port #20062

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

c72578
Copy link
Contributor

@c72578 c72578 commented Sep 8, 2021

Describe the pull request

If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

@c72578
Copy link
Contributor Author

c72578 commented Sep 8, 2021

package-x64-linux-dbg-out.log

[36/43] /usr/bin/cc  -o libgxps/libgxps.so.2.2.4 libgxps/libgxps.so.2.2.4.p/gxps-archive.c.o libgxps/libgxps.so.2.2.4.p/gxps-fonts.c.o libgxps/libgxps.so.2.2.4.p/gxps-images.c.o libgxps/libgxps.so.2.2.4.p/gxps-parse-utils.c.o libgxps/libgxps.so.2.2.4.p/gxps-resources.c.o libgxps/libgxps.so.2.2.4.p/gxps-brush.c.o libgxps/libgxps.so.2.2.4.p/gxps-color.c.o libgxps/libgxps.so.2.2.4.p/gxps-core-properties.c.o libgxps/libgxps.so.2.2.4.p/gxps-debug.c.o libgxps/libgxps.so.2.2.4.p/gxps-document.c.o libgxps/libgxps.so.2.2.4.p/gxps-document-structure.c.o libgxps/libgxps.so.2.2.4.p/gxps-error.c.o libgxps/libgxps.so.2.2.4.p/gxps-file.c.o libgxps/libgxps.so.2.2.4.p/gxps-glyphs.c.o libgxps/libgxps.so.2.2.4.p/gxps-links.c.o libgxps/libgxps.so.2.2.4.p/gxps-matrix.c.o libgxps/libgxps.so.2.2.4.p/gxps-page.c.o libgxps/libgxps.so.2.2.4.p/gxps-path.c.o -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgxps.so.2 -Wl,-Bsymbolic /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libglib-2.0.a -pthread /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgobject-2.0.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgio-2.0.a -ldl /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libresolv.so /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgmodule-2.0.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libcairo.a -lm /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblzo2.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libfontconfig.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libuuid.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libexpat.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libfreetyped.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbz2d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpng16d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbrotlidec-static.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbrotlicommon-static.a /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXrender.so /usr/lib/x86_64-linux-gnu/libX11.so /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpixman-1.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libarchive.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libxml2.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblzmad.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libssl.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libcrypto.a -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib -loptimized -ldebug -lbz2 -lLibLZMA::LibLZMA -llz4::lz4 -lzstd::libzstd_static -lOpenSSL::Crypto -llzma -l-pthread /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblcms2d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libjpeg.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libtiffd.a -Wl,--end-group
FAILED: libgxps/libgxps.so.2.2.4 
/usr/bin/cc  -o libgxps/libgxps.so.2.2.4 libgxps/libgxps.so.2.2.4.p/gxps-archive.c.o libgxps/libgxps.so.2.2.4.p/gxps-fonts.c.o libgxps/libgxps.so.2.2.4.p/gxps-images.c.o libgxps/libgxps.so.2.2.4.p/gxps-parse-utils.c.o libgxps/libgxps.so.2.2.4.p/gxps-resources.c.o libgxps/libgxps.so.2.2.4.p/gxps-brush.c.o libgxps/libgxps.so.2.2.4.p/gxps-color.c.o libgxps/libgxps.so.2.2.4.p/gxps-core-properties.c.o libgxps/libgxps.so.2.2.4.p/gxps-debug.c.o libgxps/libgxps.so.2.2.4.p/gxps-document.c.o libgxps/libgxps.so.2.2.4.p/gxps-document-structure.c.o libgxps/libgxps.so.2.2.4.p/gxps-error.c.o libgxps/libgxps.so.2.2.4.p/gxps-file.c.o libgxps/libgxps.so.2.2.4.p/gxps-glyphs.c.o libgxps/libgxps.so.2.2.4.p/gxps-links.c.o libgxps/libgxps.so.2.2.4.p/gxps-matrix.c.o libgxps/libgxps.so.2.2.4.p/gxps-page.c.o libgxps/libgxps.so.2.2.4.p/gxps-path.c.o -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgxps.so.2 -Wl,-Bsymbolic /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libglib-2.0.a -pthread /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgobject-2.0.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgio-2.0.a -ldl /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libresolv.so /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libgmodule-2.0.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libcairo.a -lm /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblzo2.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libfontconfig.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libuuid.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libexpat.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libfreetyped.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbz2d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpng16d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbrotlidec-static.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libbrotlicommon-static.a /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXrender.so /usr/lib/x86_64-linux-gnu/libX11.so /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpixman-1.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libarchive.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libxml2.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblzmad.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libssl.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libcrypto.a -L/mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib -loptimized -ldebug -lbz2 -lLibLZMA::LibLZMA -llz4::lz4 -lzstd::libzstd_static -lOpenSSL::Crypto -llzma -l-pthread /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/liblcms2d.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libjpeg.a /mnt/vcpkg-ci/installed/x64-linux/debug/lib/pkgconfig/../../lib/libtiffd.a -Wl,--end-group
/usr/bin/ld: cannot find -loptimized
/usr/bin/ld: cannot find -ldebug
/usr/bin/ld: cannot find -lbz2
/usr/bin/ld: cannot find -lLibLZMA::LibLZMA
/usr/bin/ld: cannot find -llz4::lz4
/usr/bin/ld: cannot find -lzstd::libzstd_static
/usr/bin/ld: cannot find -lOpenSSL::Crypto
/usr/bin/ld: cannot find -llzma
/usr/bin/ld: cannot find -l-pthread
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

failure logs for x64-linux.zip

@c72578 c72578 marked this pull request as ready for review September 8, 2021 20:40
@JonLiu1993 JonLiu1993 self-assigned this Sep 9, 2021
@dg0yt
Copy link
Contributor

dg0yt commented Sep 9, 2021

The build seems to get cmake-style linking information from a dependency, probably via a .pc file. This would be a bug in that .pc file. Check the list of dependencies, in particular cairo, lcms.

@JonLiu1993 JonLiu1993 added category:new-port The issue is requesting a new library to be added; consider making a PR! requires:author-response labels Sep 9, 2021
@c72578
Copy link
Contributor Author

c72578 commented Sep 9, 2021

The broken linking information is coming from libarchive.pc under x64-linux.

libarchive.pc x64-linux:

prefix=${pcfiledir}/../..

exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libarchive
Description: library that can create and read several streaming archive formats
Version: 3.4.3
Cflags: -I"${includedir}"
Cflags.private: -DLIBARCHIVE_STATIC
Libs: -L"${libdir}" -larchive  -loptimized -lz -ldebug -lz -loptimized -lbz2 -ldebug -lbz2d -lLibLZMA::LibLZMA -llz4::lz4 -lzstd::libzstd_static -lOpenSSL::Crypto -loptimized -lxml2 -ldebug -lxml2 -loptimized -llzma -ldebug -llzmad -loptimized -lz -ldebug -lz -lm -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lssl -lcrypto -l-pthread -ldl -ldl -l-pthread -lxml2 -lz -llzma -lm

For comparison:
libarchive.pc x64-windows

prefix=${pcfiledir}/../..

exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libarchive
Description: library that can create and read several streaming archive formats
Version: 3.4.3
Cflags: -I"${includedir}"
Cflags.private: -DLIBARCHIVE_STATIC
Libs: -L"${libdir}" -larchive
Libs.private:  -loptimized -lzlib -ldebug -lzlibd -loptimized -lbz2 -ldebug -lbz2d -lLibLZMA::LibLZMA -llz4::lz4 -lzstd::libzstd_shared -lOpenSSL::Crypto -lxml2 -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto -lssl -lcrypto

libarchive.pc.in

prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: libarchive
Description: library that can create and read several streaming archive formats
Version: @VERSION@
Cflags: -I${includedir}
Cflags.private: -DLIBARCHIVE_STATIC
Libs: -L${libdir} -larchive
Libs.private: @LIBS@

This means, that under x64-linux, Libs.private: is deleted from libarchive.pc, and all the linking information shows up under Libs:

The original buildtrees/libarchive/x64-linux-rel/build/pkgconfig/libarchive.pc contains Libs.private:, which is removed during vcpkg_fixup_pkgconfig()

@c72578
Copy link
Contributor Author

c72578 commented Sep 9, 2021

Link to current REGEX REPLACE code by vcpkg_fixup_pkgconfig.cmake:

# Libs comes before Libs.private

@dg0yt
Copy link
Contributor

dg0yt commented Sep 9, 2021

Thanks for the research.

The original buildtrees/libarchive/x64-linux-rel/build/pkgconfig/libarchive.pc is OK

I don't think so. I guess the wrong data is already there, in Libs.private.

IMO the prefered fix is to get rid of explicit Libs which have a pkgconfig module, and refer to this module via Requires.private.

@c72578
Copy link
Contributor Author

c72578 commented Sep 10, 2021

@dg0yt thanks for the feedback.
This means, that libarchive needs to be fixed, so that it produces a valid libarchive.pc, without the additional, incorrect entries in Libs.private.

@JonLiu1993
Copy link
Member

@c72578 ,So this pr depends #16845 fix?

@dg0yt
Copy link
Contributor

dg0yt commented Sep 10, 2021

@JonLiu1993 This PR depends on a libarchive fix. #16845 doesn't include such a fix AFAICT but it is the best candidate to fix this as well.

@JonLiu1993 JonLiu1993 added depends:upstream-changes Waiting on a change to the upstream project and removed requires:author-response labels Sep 10, 2021
@c72578 c72578 force-pushed the 2021-08-02_libgxps_Add_new_port branch from 442cba6 to a1d7135 Compare September 11, 2021 06:32
@dg0yt
Copy link
Contributor

dg0yt commented Sep 11, 2021

I do have preliminary work to fix the libarchive pc file (dg0yt@ae67ab7), based on #16845 and #20108. With the usual speed of merges in vcpkg, the timeframe is going to be several weeks...

@c72578
Copy link
Contributor Author

c72578 commented Sep 11, 2021

@dg0yt That's great, thanks for working on it.

@JonLiu1993
Copy link
Member

@dg0yt ,Thanks for your contribution.

@JonLiu1993 JonLiu1993 added depends:different-pr This PR or Issue depends on a PR which has been filed and removed depends:upstream-changes Waiting on a change to the upstream project labels Sep 13, 2021
@JonLiu1993
Copy link
Member

depends on #16845 and #20108

@JonLiu1993
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JonLiu1993 JonLiu1993 removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Sep 14, 2021
@JonLiu1993
Copy link
Member

JonLiu1993 commented Sep 14, 2021

@dg0yt @c72578 ,Pr #16845 and #20108 have merged. I tried rerun the CI but also failed, this pr need other repairs?

@dg0yt
Copy link
Contributor

dg0yt commented Sep 14, 2021

@JonLiu1993 I promised to fix the libarchive pc file in a separate PR. I just finished it: #20146

@JonLiu1993
Copy link
Member

@JonLiu1993 I promised to fix the libarchive pc file in a separate PR. I just finished it: #20146

Thanks again for your efforts

@c72578
Copy link
Contributor Author

c72578 commented Sep 14, 2021

Depends on: #20146

@JonLiu1993 JonLiu1993 added depends:different-pr This PR or Issue depends on a PR which has been filed and removed requires:author-response labels Sep 14, 2021
@c72578
Copy link
Contributor Author

c72578 commented Sep 19, 2021

@JonLiu1993, @dg0yt The PR #20146 has been tested and is OK. However, there is a remaining issue concerning port lz4 and debug\lib\pkgconfig\liblz4.pc.
For details see: #20146 (comment)

@c72578
Copy link
Contributor Author

c72578 commented Sep 19, 2021

@JonLiu1993 libgxps:x64-linux builds fine now, with the updated PR [libarchive,lz4] Fix pc file, modernize portfile #20146
@dg0yt Thanks for fixing the pkg-config files of libarchive and lz4.

@JonLiu1993
Copy link
Member

@JonLiu1993 libgxps:x64-linux builds fine now, with the updated PR [libarchive,lz4] Fix pc file, modernize portfile #20146
@dg0yt Thanks for fixing the pkg-config files of libarchive and lz4.

@c72578 ,Thank for your report, wait for lz4 to be repaired, I will review this pr

Add libgxps version 0.3.2
@c72578 c72578 force-pushed the 2021-08-02_libgxps_Add_new_port branch from a1d7135 to 37c80b6 Compare September 25, 2021 05:59
@c72578
Copy link
Contributor Author

c72578 commented Sep 25, 2021

@JonLiu1993 The PR #20146, which fixed the pkg-config files of libarchive and lz4 has been merged in the meantime.
CI has passed now.

@JonLiu1993 JonLiu1993 removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Sep 26, 2021
@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Sep 26, 2021
@JonLiu1993
Copy link
Member

@c72578 @dg0yt ,Thanks for your hard working!

@BillyONeal BillyONeal merged commit d49854f into microsoft:master Sep 28, 2021
@BillyONeal
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants