Bug 245946 - [PATCH] www/qt5-webengine: devel/double-conversion missing in LIB_DEPENDS
Summary: [PATCH] www/qt5-webengine: devel/double-conversion missing in LIB_DEPENDS
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: kde
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-26 19:30 UTC by Andy Mender
Modified: 2020-05-03 21:52 UTC (History)
3 users (show)

See Also:


Attachments
Makefile diff (602 bytes, patch)
2020-04-26 19:30 UTC, Andy Mender
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Mender 2020-04-26 19:30:09 UTC
Created attachment 213824 [details]
Makefile diff

QtWebEngine uses definitions found in libdouble-conversion.so, however does not declare the devel/double-conversion port in the LIB_DEPENDS array. As a result, the build fails. The attached Makefile diff fixes the issue.

This is a re-submission of bug #245922 to target the correct port. Since the behavior is similar to the one reported in bug #245495, they might show the same overall problem with www/qt5-webengine builds.
Comment 1 Tobias C. Berner freebsd_committer 2020-04-27 16:24:40 UTC
Moin moin 

Thanks for the report!

Kai, could you take a look at this?


mfg Tobias
Comment 2 Kai Knoblich freebsd_committer 2020-05-01 11:30:24 UTC
(In reply to Andy Mender from comment #0)
(In reply to Tobias C. Berner from comment #1)

At the outset two questions:

- Do you get the build errors with a non-poudriere build environment?

- If so, have you already tried to remove the previous version of qt5-webengine with "pkg delete -f" before building the new version?

Some more technical details:

In fact, www/qt5-webengine uses some header files that can also be found in devel/double-conversion. 

But it should rather use its own header files of the bundled copy of ICU, that are supplied via the tarball and can be found at the following locations: 

- "src/3rdparty/chromium/third_party/icu/source/i18n/"
- "src/3rdparty/chromium/base/third_party/double_conversion/double-conversion" 


Also I don't see "libdouble-conversion.so" listed as a (missing) dependency when examining the shared libraries of www/qt5-webengine (= 5.14.2):

> for i in `pkg info -l qt5-webengine | grep -e '\.so$'`; do readelf -d $i | grep conversion; done
Comment 3 Andy Mender 2020-05-02 18:23:20 UTC
> - Do you get the build errors with a non-poudriere build environment?

Yes, indeed. I build and install new ports via "make install clean" in the port dir and run regular updates via portmaster to have full control over the build process.

> - If so, have you already tried to remove the previous version of qt5-webengine with "pkg delete -f" before building the new version?

This I have not tried, but the first time I built it, it was a completely fresh install of both qt5-webegine and otter-browser.

> In fact, www/qt5-webengine uses some header files that can also be found in devel/double-conversion.
> But it should rather use its own header files of the bundled copy of ICU, that are supplied via the tarball and can be found at the following locations: 
> - "src/3rdparty/chromium/third_party/icu/source/i18n/"
> - "src/3rdparty/chromium/base/third_party/double_conversion/double-conversion" 

Yes, this is what I suspected as well, since the devel/double-conversion port was extracted from the Chromium source code.

> Also I don't see "libdouble-conversion.so" listed as a (missing) dependency when examining the shared libraries of www/qt5-webengine (= 5.14.2):
> for i in `pkg info -l qt5-webengine | grep -e '\.so$'`; do readelf -d $i | grep conversion; done

This I can't explain. I should've posted this earlier, but here is the end of the build log:
> c++ -B/usr/local/bin -Wl,--as-needed -fstack-protector-strong -pthread -Wl,-rpath,/usr/local/lib/qt5 -Wl,-rpath-link,/usr/local/lib/qt5 -o ../../libexec/QtWebEngineProcess .obj/main.o   -L/tmp/usr/ports/www/qt5-webengine/work/.build/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL /usr/local/lib/qt5/libQt5WebEngineCore.so /usr/local/lib/qt5/libQt5Quick.so /usr/local/lib/qt5/libQt5QmlModels.so /usr/local/lib/qt5/libQt5WebChannel.so /usr/local/lib/qt5/libQt5Qml.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Positioning.so /usr/local/lib/qt5/libQt5Core.so
> /usr/local/bin/ld: warning: libdouble-conversion.so.3, needed by /usr/local/lib/qt5/libQt5Core.so, not found (try using -rpath or -rpath-link)
> /usr/local/bin/ld: .obj/main.o: in function `main':
> main.cpp:(.text+0xb4): undefined reference to `QtWebEngineCore::processMain(int, char const**)'
> /usr/local/bin/ld: /usr/local/lib/qt5/libQt5Core.so: undefined reference to `double_conversion::DoubleToStringConverter::DoubleToAscii(double, double_conversion::DoubleToStringConverter::DtoaMode, int, char*, int, bool*, int*, int*)'
> /usr/local/bin/ld: /usr/local/lib/qt5/libQt5Core.so: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
> c++: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [../../libexec/QtWebEngineProcess] Error code 1

The same error occurs even with qt5-webengine 5.14.2.
Comment 4 Andy Mender 2020-05-03 11:42:20 UTC
I realized that my qt5-core installation was somehow linked against libdouble-conversion and this affected more than just qt5-webengine. I rebuilt qt5-core and now the issue I reported has disappeared. I should probably use poudriere for my builds to avoid problems like this in the future.

Unfortunately, qt5-webengine still fails to build. This is the end of the build log:
> --- sub-process-make_first ---
> --- ../../libexec/QtWebEngineProcess ---
> c++ -B/usr/local/bin -Wl,--as-needed -fstack-protector-strong -pthread -Wl,-rpath,/usr/local/lib/qt5 -Wl,-rpath-link,/usr/local/lib/qt5 -o ../../libexec/QtWebEngineProcess .obj/main.o   -L/tmp/usr/ports/www/qt5-webengine/work/.build/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL /usr/local/lib/qt5/libQt5WebEngineCore.so /usr/local/lib/qt5/libQt5Quick.so /usr/local/lib/qt5/libQt5QmlModels.so /usr/local/lib/qt5/libQt5WebChannel.so /usr/local/lib/qt5/libQt5Qml.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Positioning.so /usr/local/lib/qt5/libQt5Core.so
> /usr/local/bin/ld: .obj/main.o: in function `main':
> main.cpp:(.text+0xb4): undefined reference to `QtWebEngineCore::processMain(int, char const**)'
> c++: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [../../libexec/QtWebEngineProcess] Error code 1
Comment 5 Andy Mender 2020-05-03 19:09:45 UTC
I tried building qt5-webengine in a 12.1-STABLE jail and it builds successfully. I think there might've been something polluting my system environment.

Since as you said, an external installation of libdouble-conversion is not necessary, I think this bug report can be closed.
Comment 6 Kai Knoblich freebsd_committer 2020-05-03 21:52:38 UTC
(In reply to Andy Mender from comment #5)

Thank you for the updates and no worries about the delayed info regarding the build logs. Meanwhile I also was able to reproduce the issue as reported above by upgrading www/qt5-webengine from 5.14.0 to 5.14.2 via portmaster.

My solution was then to remove the previous version of qt5-webengine via "pkg delete -f" and do a "make clean && make install" of the www/qt5-webengine port.

Some more technical details for the sake of completeness:

If we look at a recent poudriere build log (11.3-RELEASE amd64) [1] there's a small difference with the "-Wl,-rpath-link," parameter in comparison with the outputs from comment #3 and comment #4:

> --- ../../libexec/QtWebEngineProcess ---
> c++ -B/usr/local/bin -Wl,--as-needed -fstack-protector-strong -pthread -Wl,-rpath,/usr/local/lib/qt5 -Wl,-rpath-link,/wrkdirs/usr/ports/www/qt5-webengine/work/.build/lib -o ../../libexec/QtWebEngineProcess .obj/main.o   -L/wrkdirs/usr/ports/www/qt5-webengine/work/.build/lib -L/usr/local/lib /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Core.so -lGL /wrkdirs/usr/ports/www/qt5-webengine/work/.build/lib/libQt5WebEngineCore.so /usr/local/lib/qt5/libQt5Quick.so /usr/local/lib/qt5/libQt5QmlModels.so /usr/local/lib/qt5/libQt5WebChannel.so /usr/local/lib/qt5/libQt5Qml.so /usr/local/lib/qt5/libQt5Network.so /usr/local/lib/qt5/libQt5Gui.so /usr/local/lib/qt5/libQt5Positioning.so /usr/local/lib/qt5/libQt5Core.so

Within a poudriere build there's no prior version of www/qt5-webengine installed and hence no ldconfig(8) hints file in ${LOCALBASE}/libdata/ldconfig/qt5-webengine exists. The build process then uses its .build/lib/ directory as -rpath-link parameter instead of pointing to ${LOCALBASE}/lib/qt5 .

--
[1] http://beefy9.nyi.freebsd.org/data/113amd64-default/533597/logs/qt5-webengine-5.14.2.log