Bug 242026

Summary: devel/qt5-core, x11-toolkits/qt5-gui: picks up libzstd if archivers/zstd is installed
Product: Ports & Packages Reporter: Martin Birgmeier <d8zNeCFG>
Component: Individual Port(s)Assignee: freebsd-kde (Team) <kde>
Status: Closed FIXED    
Severity: Affects Only Me CC: arcade, arrowd, kde, rkoberman, tcberner, vbox
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Martin Birgmeier 2019-11-17 11:16:10 UTC
Scenario:
- archivers/zstd is installed
- building emulators/virtualbox-ose using portmaster

Result:
- /usr/local/lib/virtualbox/VirtualBox.so links against /usr/local/lib/libzstd.so.1 but this is not recorded as a dependency in the port

Expected result:
- Either emulators/virtualbox is modified to not pick up zstd spuriously
- or zstd is noted as an explicit dependency

-- Martin
Comment 1 rkoberman 2019-11-17 21:47:46 UTC
OK. Why is this a problem? Many ports install libraries that they can use but don't require when present. In multimedia I have used several ports that would install codecs that the build procedure found on the system. 

The only real problem I have seen is that the codecs are NOT dependencies and, if one is deleted, the application will not start when the loader can't find the shareable.
Comment 2 Martin Birgmeier 2019-11-18 17:38:59 UTC
Since you seemingly have no problem seeing the problem, why do you ask what the problem is? ;-)
Comment 3 rkoberman 2019-11-20 17:58:15 UTC
The point is that this is a decision that is the maintainer's (sunpoet) choice as this behavior is part of VB as supplied by Oracle and the maintainer needs to choose whether to change this behavior. It's simply not a bug as everything works as designed. (And I don't really care for this, myself.) It seems that mail to sunpoet or a discussion on the mailing list would be more appropriate.
Comment 4 Martin Birgmeier 2019-11-23 16:54:54 UTC
It seems that this is actually some qt5 library which is picking up zstd.

I have not yet found out which one - probably devel/qt5-core.

-- Martin
Comment 5 Martin Birgmeier 2019-11-23 17:06:28 UTC
Both devel/qt5-core and x11-toolkits/qt5-gui pick up zstd during configure:

...
Checking for zlib... yes
Checking for Intrinsics without -mXXX argument... yes
Checking for Zstandard... yes
Checking for clock_gettime()... yes
Checking for POSIX monotonic clock... yes
...

Maybe other qt5 ports as well.

One of them then really links against it, it is hard to find out which because the complete QT source code is expanded for each port build.
Comment 6 Volodymyr Kostyrko 2020-03-17 12:20:05 UTC
From qt5-core:

====> Running Q/A tests (stage-qa)
Error: /usr/local/lib/qt5/libQt5Core.so.5.13.2 is linked to /usr/local/lib/libzstd.so.1 from archivers/zstd but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libzstd.so:archivers/zstd
Warning: Possible REINPLACE_CMD issues
sed failed: file content unchanged from backup: mkspecs/common/gcc-base.conf
sed failed: file content unchanged from backup: mkspecs/freebsd-g++/qmake.conf
sed failed: file content unchanged from backup: mkspecs/common/gcc-base.conf
sed failed: file content unchanged from backup: mkspecs/common/g++-base.conf
sed failed: file content unchanged from backup: mkspecs/common/bsd/bsd.conf
sed failed: file content unchanged from backup: mkspecs/freebsd-g++/qmake.conf
Comment 7 Tobias C. Berner freebsd_committer 2020-03-17 18:39:54 UTC
Moin moin 

Sorry, this was not properly assigned to kde@ so I did not see it until now.

mfg Tobias
Comment 8 Gleb Popov freebsd_committer 2020-05-17 14:16:49 UTC
Anyways, to solve this we either need to depend on zstd or persuade configure to not enable it. Your opinions?

From Qt changelog:

> The Qt resource system now supports compressing content using the Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses better for the same CPU time, so this algorithm is the default.
Comment 9 Tobias C. Berner freebsd_committer 2020-05-17 14:43:05 UTC
(In reply to Gleb Popov from comment #8)
Are there any architecture restriction if we were to depend on zstd?
Comment 10 Gleb Popov freebsd_committer 2020-05-17 14:47:25 UTC
(In reply to Tobias C. Berner from comment #9)
Well, archivers/zstd/Makefile doesn't contain any BROKEN_* knobs.
Comment 11 Tobias C. Berner freebsd_committer 2020-05-17 14:50:30 UTC
(In reply to Gleb Popov from comment #10)
Then I'd say, there is no reason not to depend on it :)
Comment 12 Gleb Popov freebsd_committer 2020-05-17 14:58:33 UTC
Here's the patch:

Index: devel/qt5-core/Makefile
===================================================================
--- devel/qt5-core/Makefile     (revision 535523)
+++ devel/qt5-core/Makefile     (working copy)
@@ -2,7 +2,7 @@
 
 PORTNAME=      core
 DISTVERSION=   ${QT5_VERSION}
-PORTREVISION=  2
+PORTREVISION=  3
 CATEGORIES=    devel
 PKGNAMEPREFIX= qt5-
 
@@ -10,7 +10,8 @@
 COMMENT=       Qt core non-graphical module
 
 LIB_DEPENDS=   libicui18n.so:devel/icu \
-               libpcre2-posix.so:devel/pcre2
+               libpcre2-posix.so:devel/pcre2 \
+               libzstd.so:archivers/zstd
 
 USES=          compiler:c++11-lang gnome qmake:no_env qt-dist:5,base
 USE_GNOME=     glib20

How do you want me to test it? poud testport qt5-core would suffice?
Comment 13 Tobias C. Berner freebsd_committer 2020-05-17 15:35:38 UTC
(In reply to Gleb Popov from comment #12)
I would say that should be enough, yes.
Comment 14 commit-hook freebsd_committer 2020-05-17 15:43:40 UTC
A commit references this bug:

Author: arrowd
Date: Sun May 17 15:42:44 UTC 2020
New revision: 535557
URL: https://svnweb.freebsd.org/changeset/ports/535557

Log:
  devek/qt5-core: Add dependency on archivers/zstd.

  PR:		242026
  Approved by:	tcberner

Changes:
  head/devel/qt5-core/Makefile