Bug 258119 - deskutils/nextcloudclient: upgrade fails with "ld: error: unable to find library -lnextcloudsync_vfs_xattr"
Summary: deskutils/nextcloudclient: upgrade fails with "ld: error: unable to find libr...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Reifenberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-28 13:08 UTC by Martin Birgmeier
Modified: 2021-10-29 09:17 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments
patch (1.00 KB, patch)
2021-10-09 09:16 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2021-08-28 13:08:24 UTC
Scenario:
- FreeBSD v908.xyzzy 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 9100a4e286a(MBi/releng/12.2) XYZZY_SMP_NOSPIN_HYPERV  amd64
- latest ports
- upgrading ports using "portmaster -a"

Result:
- upgrading nextcloudclient to 3.3.2 fails with "ld: error: unable to find library -lnextcloudsync_vfs_xattr" (multiple times)

-- Martin
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2021-10-08 11:37:41 UTC
Check this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257945#c2

Same here:
[ 71%] Linking CXX executable ../bin/NotificationCacheTest
cd /tmp/work/usr/ports/deskutils/nextcloudclient/work/.build/test && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/NotificationCacheTest.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -pipe -march=core2 -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DLIBICONV_PLUG -isystem /usr/local/include -Wall -Wextra -pedantic -Wno-long-long -Wno-gnu-zero-variadic-macro-arguments -pedantic -O2 -pipe -march=core2 -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DLIBICONV_PLUG -isystem /usr/local/include   -fstack-protector-strong -L/usr/local/lib CMakeFiles/NotificationCacheTest.dir/NotificationCacheTest_autogen/mocs_compilation.cpp.o CMakeFiles/NotificationCacheTest.dir/testnotificationcache.cpp.o -o ../bin/NotificationCacheTest  -Wl,-rpath,/usr/local/lib/qt5:/tmp/work/usr/ports/deskutils/nextcloudclient/work/.build/src/libsync:/tmp/work/usr/ports/deskutils/nextcloudclient/work/.build/src/csync libtestutils.a ../src/gui/libnextcloudCore.a ../src/cmd/libcmdCore.a /usr/local/lib/qt5/libQt5Test.so.5.15.2 /usr/local/lib/qt5/libQt5Quick.so.5.15.2 -lnextcloudsync_vfs_xattr /usr/local/lib/qt5/libQt5Svg.so.5.15.2 /usr/local/lib/qt5/libQt5Widgets.so.5.15.2 /usr/local/lib/qt5/libQt5Xml.so.5.15.2 /usr/local/lib/qt5/libQt5QuickControls2.so.5.15.2 /usr/local/lib/qt5/libQt5Quick.so.5.15.2 /usr/local/lib/qt5/libQt5QmlModels.so.5.15.2 /usr/local/lib/qt5/libQt5Qml.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 ../src/libsync/libnextcloudsync.so.3.3.5 /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/local/lib/qt5/libQt5WebSockets.so.5.15.2 /usr/local/lib/qt5/libQt5Svg.so.5.15.2 /usr/local/lib/qt5/libQt5Widgets.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 /usr/local/lib/libqt5keychain.so.0.12.0 /usr/local/lib/qt5/libQt5DBus.so.5.15.2 /usr/local/lib/libinotify.so ../src/csync/libnextcloud_csync.so.3.3.5 /usr/local/lib/libsqlite3.so /usr/local/lib/qt5/libQt5Concurrent.so.5.15.2 /usr/lib/libz.so /usr/local/lib/qt5/libQt5Network.so.5.15.2 /usr/local/lib/qt5/libQt5Core.so.5.15.2 /usr/local/lib/qt5/libQt5QmlModels.so.5.15.2 /usr/local/lib/qt5/libQt5Qml.so.5.15.2 /usr/local/lib/qt5/libQt5Network.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 /usr/local/lib/qt5/libQt5Core.so.5.15.2 
ld: error: unable to find library -lnextcloudsync_vfs_xattr
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [test/CMakeFiles/NotificationCacheTest.dir/build.make:150: bin/NotificationCacheTest] Error 1
gmake[4]: Leaving directory '/tmp/work/usr/ports/deskutils/nextcloudclient/work/.build'
gmake[3]: *** [CMakeFiles/Makefile2:2212: test/CMakeFiles/NotificationCacheTest.dir/all] Error 2
gmake[3]: *** Waiting for unfinished jobs....
Comment 2 Martin Birgmeier 2021-10-08 15:35:02 UTC
Seems to already be handled by bug #257945.

Closing this one.
Comment 3 Guido Falsi freebsd_committer freebsd_triage 2021-10-08 22:33:42 UTC
Looks like the issue is still present and caused by a bug in upstream build system, I'm testing a simple patch, I'll add it here as soon as I'm done testing it on my side.
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2021-10-09 09:16:07 UTC
Created attachment 228538 [details]
patch

Please test this simple patch, which I will send upstream, and report if it fixes the issue for you.

The patch also removes a "DEBUG=yes" definition in the port Makefile I just noticed. AFAIK it's a noop, since that variable is not used by the framework, but it's better to remove it to avoid confusion in the future.
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2021-10-09 15:48:10 UTC
(In reply to Guido Falsi from comment #4)
Build fine with this patch, thanks!
Comment 6 Guido Falsi freebsd_committer freebsd_triage 2021-10-09 21:26:38 UTC
Sent the patch upstream as a pull request, added to See Also field.
Comment 7 peo 2021-10-17 20:37:22 UTC
This fixed the build in ports:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=228538&action=diff
3.3.5 does not build in ports without the ablove:

[ 87%] Linking CXX executable ../bin/ChunkingNgTest
cd /usr/ports/deskutils/nextcloudclient/work/.build/test && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/ChunkingNgTest.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DLIBICONV_PLUG -isystem /usr/local/include -Wall -Wextra -pedantic -Wno-long-long -Wno-gnu-zero-variadic-macro-arguments -pedantic -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -DLIBICONV_PLUG -isystem /usr/local/include   -fstack-protector-strong -L/usr/local/lib CMakeFiles/ChunkingNgTest.dir/ChunkingNgTest_autogen/mocs_compilation.cpp.o CMakeFiles/ChunkingNgTest.dir/testchunkingng.cpp.o -o ../bin/ChunkingNgTest  -Wl,-rpath,/usr/local/lib/qt5:/usr/ports/deskutils/nextcloudclient/work/.build/src/libsync:/usr/ports/deskutils/nextcloudclient/work/.build/src/csync libtestutils.a ../src/gui/libnextcloudCore.a ../src/cmd/libcmdCore.a /usr/local/lib/qt5/libQt5Test.so.5.15.2 /usr/local/lib/qt5/libQt5Quick.so.5.15.2 -lnextcloudsync_vfs_xattr /usr/local/lib/qt5/libQt5Svg.so.5.15.2 /usr/local/lib/qt5/libQt5Widgets.so.5.15.2 /usr/local/lib/qt5/libQt5Xml.so.5.15.2 /usr/local/lib/qt5/libQt5QuickControls2.so.5.15.2 /usr/local/lib/qt5/libQt5Quick.so.5.15.2 /usr/local/lib/qt5/libQt5QmlModels.so.5.15.2 /usr/local/lib/qt5/libQt5Qml.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 ../src/libsync/libnextcloudsync.so.3.3.5 /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/local/lib/qt5/libQt5WebSockets.so.5.15.2 /usr/local/lib/qt5/libQt5Svg.so.5.15.2 /usr/local/lib/qt5/libQt5Widgets.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 /usr/local/lib/libqt5keychain.so.0.12.0 /usr/local/lib/qt5/libQt5DBus.so.5.15.2 /usr/local/lib/libinotify.so ../src/csync/libnextcloud_csync.so.3.3.5 /usr/local/lib/libsqlite3.so /usr/local/lib/qt5/libQt5Concurrent.so.5.15.2 /usr/lib/libz.so /usr/local/lib/qt5/libQt5Network.so.5.15.2 /usr/local/lib/qt5/libQt5Core.so.5.15.2 /usr/local/lib/qt5/libQt5QmlModels.so.5.15.2 /usr/local/lib/qt5/libQt5Qml.so.5.15.2 /usr/local/lib/qt5/libQt5Network.so.5.15.2 /usr/local/lib/qt5/libQt5Gui.so.5.15.2 /usr/local/lib/qt5/libQt5Core.so.5.15.2 
ld: error: unable to find library -lnextcloudsync_vfs_xattr
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [test/CMakeFiles/ChunkingNgTest.dir/build.make:150: bin/ChunkingNgTest] Error 1
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-10-29 09:16:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=027ed04832c4160ac66139b8769a33d828ee7573

commit 027ed04832c4160ac66139b8769a33d828ee7573
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2021-10-29 09:13:03 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2021-10-29 09:13:03 +0000

    deskutils/nextcloudclient: Fix build failure when tests are enabled

    Upstream build system tries to include a Linux only library in the
    build when tests are enabled.

    This patch has already been accepted upstream.

    PR:                     258119
    Approved by:            Maintiner timeout
    Obtained from:          https://github.com/nextcloud/desktop/pull/3880

 deskutils/nextcloudclient/Makefile                            |  1 -
 .../files/patch-test_nextcloud__add__test.cmake (new)         | 11 +++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
Comment 9 Guido Falsi freebsd_committer freebsd_triage 2021-10-29 09:17:43 UTC
Patch committed.

Closing as fixed.

Thanks!