Bug 262814 - converters/wkhtmltopdf: fix build with clang 14, by future-proofing compiler version check
Summary: converters/wkhtmltopdf: fix build with clang 14, by future-proofing compiler ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 261742
  Show dependency treegraph
 
Reported: 2022-03-25 22:12 UTC by Dimitry Andric
Modified: 2022-03-26 12:23 UTC (History)
0 users

See Also:
pi: maintainer-feedback+


Attachments
Future-proof compiler version check (706 bytes, patch)
2022-03-25 22:14 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-03-25 22:12:40 UTC
During an exp-run for llvm 14 (see bug 261742), it turned out that converters/wkhtmltopdf fails to build with clang 14:

c++ -Wl,-rpath=/usr/local/lib/gcc8 -Wl,-O1 -pthread -shared -Wl,-soname,libwkhtmltox.so.0 -o libwkhtmltox.so.0.12.6 loadsettings.o logging.o multipageloader.o tempfile.o converter.o websettings.o reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o image_c_bindings.o moc_multipageloader_p.o moc_converter_p.o moc_pdfconverter_p.o moc_imageconverter_p.o moc_pdf_c_bindings_p.o moc_image_c_bindings_p.o moc_converter.o moc_multipageloader.o moc_utilities.o moc_pdfconverter.o moc_imageconverter.o qrc_wkhtmltopdf.o   -L/usr/local/lib -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/lib -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/plugins/codecs -lqcncodecs -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/lib -L/usr/local/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender -lfontconfig -lfreetype -lXext -lX11 -lQtNetwork -lssl -lcrypto -lQtCore -lz -lm
ld: error: unable to find library -lQtWebKit
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:164: ../../bin/libwkhtmltox.so.0.12.6] Error 1

Ultimately this is caused by incorrect compiler version detection in wkhtmltopdf's configure script. Something similar was fixed for clang 12 in ports commit 1049d80399ac327964eca41e4188f988430c5f7c, and later for clang 13 in ports commit ad5fedf36832fd7e2447d8c4cb6b54128a2fcb20.

I would to propose fixing this for a long time, and for most possible version numbers, so this exercise won't have to be repeated again and again if we upgrade compilers. :)
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-03-25 22:14:16 UTC
Created attachment 232724 [details]
Future-proof compiler version check

This future-proofs the compiler version check, at least until it goes higher than 99.x. I think we can then look at it again...
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2022-03-26 07:48:51 UTC
Approved, please commit.
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-03-26 12:22:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=14bd6052d9987e3205672fc3f2874afd16279c30

commit 14bd6052d9987e3205672fc3f2874afd16279c30
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-05-27 21:02:06 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-03-26 12:21:08 +0000

    converters/wkhtmltopdf: future-proof compiler version check

    During an exp-run for llvm 14 (see bug 261742), it turned out that
    converters/wkhtmltopdf fails to build with clang 14:

    c++ -Wl,-rpath=/usr/local/lib/gcc8 -Wl,-O1 -pthread -shared -Wl,-soname,libwkhtmltox.so.0 -o libwkhtmltox.so.0.12.6 loadsettings.o logging.o multipageloader.o tempfile.o converter.o websettings.o reflect.o utilities.o pdfsettings.o pdfconverter.o outline.o tocstylesheet.o imagesettings.o imageconverter.o pdf_c_bindings.o image_c_bindings.o moc_multipageloader_p.o moc_converter_p.o moc_pdfconverter_p.o moc_imageconverter_p.o moc_pdf_c_bindings_p.o moc_image_c_bindings_p.o moc_converter.o moc_multipageloader.o moc_utilities.o moc_pdfconverter.o moc_imageconverter.o qrc_wkhtmltopdf.o   -L/usr/local/lib -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/lib -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/plugins/codecs -lqcncodecs -L/wrkdirs/usr/ports/converters/wkhtmltopdf/work/wkhtmltopdf-0.12.6/build/qt/lib -L/usr/local/lib -lqjpcodecs -lqkrcodecs -lqtwcodecs -lQtWebKit -lQtSvg -lQtXmlPatterns -lQtGui -ljpeg -lpng -lXrender -l
 fontconfig -lfreetype -lXext -lX11 -lQtNetwork -lssl -lcrypto -lQtCore -lz -lm
    ld: error: unable to find library -lQtWebKit
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[2]: *** [Makefile:164: ../../bin/libwkhtmltox.so.0.12.6] Error 1

    Ultimately this is caused by incorrect compiler version detection in
    wkhtmltopdf's configure script. Something similar was fixed for clang 12
    in ports commit 1049d80399ac327964eca41e4188f988430c5f7c, and later for
    clang 13 in ports commit ad5fedf36832fd7e2447d8c4cb6b54128a2fcb20.

    To fix this, future-proof the compiler version check, at least until it
    goes higher than 99.x.

    PR:             262814
    Approved by:    pi (maintainer)
    MFH:            2022Q1

 converters/wkhtmltopdf/files/patch-configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)