Scenario: - FreeBSD 12.3 latest patchlevel - ports latest - using portmaster to upgrade ports - comms/scrcpy is installed and pulls in devel/android-tools - converters/osm2pgsql is installed and needs devel/libfmt for building - running portmaster -a after the latest ports update Result: - The build of devel/android-tools fails with ld: error: undefined symbol: fmt::v8::vformat(fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >) Expected result: - The build should succeed. Scenario (continued): - Removing the installed devel/libfmt (pkg delete ...) Result (continued): - The build of devel/android-tools succeeds -- Martin
I was able to replicate the issue. Not your ld issue exactly, but something similar (I run 14-CURRENT versus 12.3 like you). However, the thing is, devel/android-tools has a custom libfmt that's included with android-tools as a static library, mainly due to differences versus the Ports libfmt. I was unable to make android-tools depend on the Ports libfmt. It's likely cmake is depending on the ports libfmt instead of the included one as clang/cmake gives precedence to external libraries over build-in ones. I will still work to figure out what is going wrong. In the meanwhile, you could also build with poudriere on your local system. That way, while not a "fix", a Ports libfmt is unlikely to conflict with android-tools.
Thank you Neel for looking into this. I have tried poudriere previously but found that it was too heavy for my environment. As a workaround I simply deinstall libfmt before running portmaster, and then reinstall again. -- Martin
Similar issue if the openssl package is installed: bug 264603 In this case, it triggers a compile error due to searching for headers in /usr/local/include before the headers in the working build area.
I have some good news: I found out how to fix it. Apparently in CMake I need to do `BEFORE SYSTEM`. Will push a patch shortly.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=52709fc2c45fe7662dc1278077d763b246c63c0e commit 52709fc2c45fe7662dc1278077d763b246c63c0e Author: Neel Chauhan <nc@FreeBSD.org> AuthorDate: 2022-06-10 23:18:56 +0000 Commit: Neel Chauhan <nc@FreeBSD.org> CommitDate: 2022-06-10 23:18:56 +0000 devel/android-tools: Updaste to 31.0.3p1r1 Changes: * Fix build when security/openssl and devel/libfmt is installed * Don't rely on /proc to resolve pathname PR: 264597, 264603 Reported by: John Hein and Martin Birgmeier (depencency), Baptiste Daroussin (Linuxism) devel/android-tools/Makefile | 4 ++-- devel/android-tools/distinfo | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
Works nicely, thank you! -- Martin