[Bug 264603] devel/android-tools: build fails if security/openssl is installed

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 10 Jun 2022 21:42:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264603

            Bug ID: 264603
           Summary: devel/android-tools: build fails if security/openssl
                    is installed
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: jcfyecrayz@liamekaens.com
                CC: brnrd@freebsd.org, nc@FreeBSD.org
                CC: brnrd@freebsd.org, nc@FreeBSD.org

'cmake' generates build.ninja such that it looks in /usr/local/include before
locations in the working build tree.  If the openssl port is installed, then
the build finds those files before the bundled ssl (boringssl).

This triggers a build failure:

FAILED:
vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o
/usr/bin/c++  -I/usr/local/include
-I/wrkdirs/usr/ports/devel/android-tools/work/.build/vendor
-I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb
-I/wrkdirs/usr/ports/devel/android-tools/work/freebsd
-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/include
-I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/boringssl/include
-I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-a
ndroid-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/libbase/include
-O2 -pipe -fstack-protector-strong -fno-strict-aliasing -std=gnu++2a
-Wno-attributes -D_FILE_OFFSET_BITS=64 -O2 -pipe -fstack-protector-strong
-fno-strict-aliasing -MD -MT vendor/CMakeFiles/l
ibadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o -MF
vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o.d
-o
vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o
-c /wrkdirs/usr/ports/devel/andr
oid-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp
/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:55:12:
error: use of undeclared identifier 'bssl'
    static bssl::UniquePtr<EVP_PKEY> EvpPkeyFromPEM(std::string_view pem);
           ^
/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:56:12:
error: use of undeclared identifier 'bssl'
    static bssl::UniquePtr<CRYPTO_BUFFER> BufferFromPEM(std::string_view pem);
           ^
/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:56:28:
error: use of undeclared identifier 'CRYPTO_BUFFER'
    static bssl::UniquePtr<CRYPTO_BUFFER> BufferFromPEM(std::string_view pem);
                           ^
/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:62:12:
error: use of undeclared identifier 'bssl'
    static bssl::UniquePtr<X509> X509FromBuffer(bssl::UniquePtr<CRYPTO_BUFFER>
buffer);
           ^
 .
 .


Hacky workaround: delete the openssl package when building android-tools.

Better would be to convince cmake to put -I flags for in-tree directories ahead
of -I /usr/local/include.  But it is not obvious how to tell cmake to put
include paths that it "finds" at the end of the list of include paths.  Or
maybe it is obvious to someone.

-- 
You are receiving this mail because:
You are the assignee for the bug.