Created attachment 213255 [details] Build log net/librsync-2.3.0 fails to build with the following error: [69/69] : && /usr/bin/cc -O2 -pipe -fno-strict-aliasing -fstack-protector-strong -Wall -std=c99 -pedantic -O2 -pipe -fno-strict-aliasing -fstack-protector-strong -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && : FAILED: rdiff : && /usr/bin/cc -O2 -pipe -fno-strict-aliasing -fstack-protector-strong -Wall -std=c99 -pedantic -O2 -pipe -fno-strict-aliasing -fstack-protector-strong -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && : ld: error: unable to find library -lpopt cc: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped in /usr/ports/net/librsync Attaching full log and pkg info. [root@SagaBOX /usr/ports/net/librsync]# uname -a FreeBSD SagaBOX 12.1-STABLE FreeBSD 12.1-STABLE r359151 SagaBOX amd64
Created attachment 213256 [details] pkg info
I've noticed the same issue today: [54/69] : && /usr/local/libexec/ccache/world/cc -O3 -pipe -funroll-loops -march=native -fstack-protector-strong -fno-strict-aliasing -Wall -std=c99 -pedantic -O3 -pipe -funroll-loops -march=native -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && : FAILED: rdiff : && /usr/local/libexec/ccache/world/cc -O3 -pipe -funroll-loops -march=native -fstack-protector-strong -fno-strict-aliasing -Wall -std=c99 -pedantic -O3 -pipe -funroll-loops -march=native -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && : ld: error: unable to find library -lpopt cc: error: linker command failed with exit code 1 (use -v to see invocation)
Somehow, the linker is not searching /usr/local/lib. Adding the following snippet to /etc/make.conf allowed for successful compilation: .if ${.CURDIR:M*/ports/net/librsync} LDFLAGS += -L/usr/local/lib .endif Normally, configure should pick up the LD paths, but somehow this is not happening here.
Thank you for the fint, Peter. Worked for me.
*the hint
The build failure does not happen on a clean box. https://people.FreeBSD.org/~sunpoet/temp/11.3-librsync-2.3.0.log https://people.FreeBSD.org/~sunpoet/temp/12.1-librsync-2.3.0.log (In reply to Simeon Simeonov from comment #0) I guess the problem would go away if you uninstall librsync-2.2.1 first. (In reply to Peter Putzer from comment #2) Do you have old version installed?
(In reply to Sunpoet Po-Chuan Hsieh from comment #6) Of course.
Uninstalling the old librsync did not resolve the problem for me.
I'm also seeing this consistently even in clean chroot environments.
Oddly, this doesn't work: USES+= localbase But this works for me: LDFLAGS= -L/usr/local/lib Cheers, Franco
Created attachment 213914 [details] localbase:ldflag patch The attached patch should meet the quality standard for inclusion. ;) Cheers, Franco
claiming, maintainer timeout and also fixing breakage
Something appears to be hosed inside librsync-2.3.0/cmake/FindPOPT.cmake, but not being too experienced with cmake, I don't see exactly what breaks and where the rsync upstream got it from. I was debugging the same thing after reports on FreeBSD-ports@, and figured that if pkg-config was available during "make configure", then the build broke. The popt.pc file seems harmless, but is apparently not processed properly. Bug report filed upstream.
(In reply to Matthias Andree from comment #12) I just don't think the patch is correct. But thanks for your investigation that the existance of pkgconfig seems to be the cause. That's why it does not happen in a clean jail.
A commit references this bug: Author: mandree Date: Sat May 16 15:54:06 UTC 2020 New revision: 535474 URL: https://svnweb.freebsd.org/changeset/ports/535474 Log: net/librsync 2.3.0: fix build with pkg-config available [1] While here, enable "make test" (requires upstream file missing from tarball and adaptations as to bash's install path, which add). This bug shows building the ports directly because pkg-config is often available, but does not show in poudriere because pkgconf/pkg-config is not a listed requisite und therefore missing from the build jail. PR: 245514 [2] Submitted by: Franco Fichtner <franco@opnsense.org> [1][2] Reported by: Simeon Simeonov <sgs@pichove.org> [2] Reported by: Xavier Humbert <xavier@groumpf.org> (through freebsd-ports@) Reported by: Jakob Breivik Grimstveit <jakob@grimstveit.no> (through freebsd-ports@) Approved by: sunpoet@ (maintainer timeout, 17 days; also blanket fix broken port approval) Changes: head/net/librsync/Makefile head/net/librsync/files/rdiff_bad_option.sh
A commit references this bug: Author: mandree Date: Sat May 16 15:57:52 UTC 2020 New revision: 535475 URL: https://svnweb.freebsd.org/changeset/ports/535475 Log: net/librsync 2.3.0: fixup make test psvn did not add the svn:executable property when I'd committed r535474. Add that, and a chmod +x in-depth ("paranoia") fix. PR: 245514 Approved by: portmgr@ (blanket approval to fix broken port (feature)) Changes: head/net/librsync/Makefile _U head/net/librsync/files/rdiff_bad_option.sh
Comment on attachment 213914 [details] localbase:ldflag patch approved through maintainer timeout and found working in my tests (hat: committer)
(In reply to Sunpoet Po-Chuan Hsieh from comment #14) Well, feel free to commit a better solution, or if you want, I can revert it and add LDFLAGS+=-L${LOCALBASE}/lib instead, which also fixes the issue.
It would be of use if we do not claim "clean jail" is actually the Poudriere jail as actually any clean jail in the FreeBSD sense has the bug because we simply use the ports tree to build it which doesn't always track dependencies in case of auxiliary build dependencies. "Poudriere" is perfectly sufficient to address the special jail situation. Furthermore, having the ports tree by itself in a working state is more effective than having a third party tool that outsmarts the ports build progress. As far as I can see the ports tree was built to enable building third party software and provide workarounds so that upstream does not necessarily need to be fixed so that localbase:ldflags seems like a sensible thing to do until the upstream situation changes. In any case, thanks for committing the workaround. :) Cheers, Franco
It's actually one possible fix to the root cause, not just a workaround. cmake's pkg-config support is, at best, incomplete, and severly underdocumented, after all those years. librsync's cmake stuff (main CMakeLists.txt, cmake/FindPOPT.cmake) disregards LDFLAGS. Only the -l options (pkg-config --libs-only-l) end up in the POPT_LIBRARY variable the that the linker command gets passed in the top-level CMakeLists.txt file, however the LDFLAGS and LDFLAGS_OTHER are not added and lost. The "hunt without pkg-config" code path obtains the absolute path to libpopt and therefore does not need the -L option. You can see for yourself adding CMAKE_ARGS+=--trace to Makefile and then reading the log from the "make configure" phase and comparing from a build with, and a build without pkg-config.