Page MenuHomeFreeBSD

devel/bear: [WIP] Update to 3.0.13
ClosedPublic

Authored by jrm on Jun 22 2021, 5:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 31 2024, 12:47 AM
Unknown Object (File)
Jan 28 2024, 10:27 PM
Unknown Object (File)
Jan 28 2024, 5:41 AM
Unknown Object (File)
Dec 28 2023, 4:50 AM
Unknown Object (File)
Dec 28 2023, 4:50 AM
Unknown Object (File)
Dec 23 2023, 1:19 AM
Unknown Object (File)
Dec 20 2023, 8:08 AM
Unknown Object (File)
Dec 12 2023, 4:52 AM
Subscribers

Details

Summary

Between versions 2 and 3, Bear switched from python to C++. The build is still failing because grpc is unable to find OpenSSL.

/bin/mkdir -p /wrkdirs/usr/ports/devel/bear/work/.build
-- The C compiler identification is Clang 11.0.1
-- The CXX compiler identification is Clang 11.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/libexec/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/libexec/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for nlohman_json dependency
-- Looking for nlohman_json dependency -- found
-- Looking for fmt dependency
-- Looking for fmt dependency -- found
-- Looking for spdlog dependency
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Found Threads: TRUE
-- Looking for spdlog dependency -- found
-- Looking for gRPC::grpc++ dependency
-- Found PkgConfig: pkgconf (found version "1.7.4")
-- Checking for modules 'protobuf>=3.11;grpc++>=1.26'
--   Package 'openssl', required by 'grpc', not found
-- Looking for gRPC::grpc++ dependency -- not found

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrm requested review of this revision.Jun 22 2021, 5:15 PM
jrm edited the summary of this revision. (Show Details)

The current error is grpc++ pkgconfig requiring grpc requiring openssl. Since you're not installing ports openssl and since base doesn't provide an openssl pkgconfig (/usr/libdata/pkgconfig/) openssl can't be found by pkgconfig.

I think I remember hacking around this I believe when 3.0 was released and building in my home dir with the git repo using a mod'ed openssl.pc, libssl.pc, libcrypto.pc with base values and PKG_CONFIG_PATH.

  • Should base provide openssl pkgconfig files?
  • Can there be pkgconfig files in files/ with PKG_CONFIG_PATH set to ${FILESDIR} (assuming this works)?
  • Should the port just have a build and run depends on security/openssl?

Putting a (temporarly) build dependency on devel/openssl to make grpc happy.

I tried to get the build to recognize base OpenSSL, but have been, so far,
unsuccesful. I wonder if an upstream patch to CMake's FindOpenSSL.cmake so that
it doesn't try to find a .pc file would be the best solution?

The next problem is related to staging directories.

http://pkg.ftfl.ca/data/13amd64-default/2021-06-23_11h03m49s/logs/errors/bear-3.0.12.log

I won't have time to work on this for at least a few days.

jrm marked 2 inline comments as done.Jun 23 2021, 2:20 PM
This comment was removed by jrm.

I see the staging from cmake it using ENV's DESTDIR (/wrkdirs/usr/ports/devel/bear/work/stage/) and prepending that to ${CMAKE_INSTALL_PREFIX} (wrkdirs/usr/ports/devel/bear/work/.build/stage)

...
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/bear"
...

Don't know what do with cmake to not do this. It seems that not setting DESTDIR seem like the logical idea however is it just a overlapping of names? ports and cmake are using DESTDIR?

The simple pre-install hacks around it... just move and delete the extra stuff. However, I think there should be a better solution than that.

Also, post install I guess with bear linking to plugins the extra LIB_DEPENDS are needed.

I also have tests working with a non-ports build however it depends on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257123 being fixed.

In a future update maybe we can add TEST_DEPENDS=...

Looking at devel/grpc Makefile if you're using base SSL it removed the check for openssl from grpc's cmake CMakeLists.txt file. Should it also remove the openssl require from the .pc files too?

This is why it uses localbase:ldflags as well?

Oh I see now. https://github.com/Kitware/CMake/blob/master/Modules/FindOpenSSL.cmake#L134

Is it possible for cmake to check for both pkgconfig and if that fails some alt. method to find openssl....

Building with 1.38.1_1,2 and without the openssl build dep, it works.

Add hack to fixing DESTDIR/staging issue

  • Could you elaborate on why the extra LIB_DEPENDS are necessary?
  • @sunpoet, stage-qa reports "Error: /usr/local/bin/citnames is linked to /usr/local/lib/libgrpc.so.16 which does not have a SONAME. devel/grpc needs to be fixed." Should we manually add one or report this upstream?
In D30868#702132, @jrm wrote:
  • @sunpoet, stage-qa reports "Error: /usr/local/bin/citnames is linked to /usr/local/lib/libgrpc.so.16 which does not have a SONAME. devel/grpc needs to be fixed." Should we manually add one or report this upstream?

I'm sure that all *.so from grpc have SONAME. Can you check again with the following command?

% objdump -p libgrpc.so.16 | grep SONAME
  SONAME               libgrpc.so.16

Mk/Scripts/qa.sh uses readelf. Here's the result.

% readelf -d libgrpc.so.16 | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libgrpc.so.16]
In D30868#702132, @jrm wrote:
  • @sunpoet, stage-qa reports "Error: /usr/local/bin/citnames is linked to /usr/local/lib/libgrpc.so.16 which does not have a SONAME. devel/grpc needs to be fixed." Should we manually add one or report this upstream?

I'm sure that all *.so from grpc have SONAME. Can you check again with the following command?

% objdump -p libgrpc.so.16 | grep SONAME
  SONAME               libgrpc.so.16

Mk/Scripts/qa.sh uses readelf. Here's the result.

% readelf -d libgrpc.so.16 | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libgrpc.so.16]

Sorry. I assumed the check was correct, but you're right. It's there.

In D30868#702132, @jrm wrote:
  • @sunpoet, stage-qa reports "Error: /usr/local/bin/citnames is linked to /usr/local/lib/libgrpc.so.16 which does not have a SONAME. devel/grpc needs to be fixed." Should we manually add one or report this upstream?

I'm sure that all *.so from grpc have SONAME. Can you check again with the following command?

% objdump -p libgrpc.so.16 | grep SONAME
  SONAME               libgrpc.so.16

Mk/Scripts/qa.sh uses readelf. Here's the result.

% readelf -d libgrpc.so.16 | grep SONAME
 0x000000000000000e (SONAME)             Library soname: [libgrpc.so.16]

You're right. I assumed that the check in qa.sh was correct, but @ashish discovered that the problem is related to set -o pipefail. grep -q closes the output as soon as it finds a match, which causes readelf to receive a sigpipe and the whole pipeline fails. It's non-deterministic as well, so it won't fail every time. qa.sh will need to be fixed.

Added because of the following warning if they're not there. Might be related to you current issues with qa.sh?

Warning: you need LIB_DEPENDS+=libcares.so:dns/c-ares                                 
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_hash.so.2103.0.1 from devel/abseil but it is not declared as a dependency  
Warning: you need LIB_DEPENDS+=libabsl_hash.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_city.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_city.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_wyhash.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_wyhash.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_raw_hash_set.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_raw_hash_set.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_hashtablez_sampler.so.2103.0.1 from devel/abseil but it is not declared as a dependency
...

Added because of the following warning if they're not there. Might be related to you current issues with qa.sh?

Warning: you need LIB_DEPENDS+=libcares.so:dns/c-ares                                 
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_hash.so.2103.0.1 from devel/abseil but it is not declared as a dependency  
Warning: you need LIB_DEPENDS+=libabsl_hash.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_city.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_city.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_wyhash.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_wyhash.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_raw_hash_set.so.2103.0.1 from devel/abseil but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libabsl_raw_hash_set.so:devel/abseil
Error: /usr/local/bin/citnames is linked to /usr/local/lib/libabsl_hashtablez_sampler.so.2103.0.1 from devel/abseil but it is not declared as a dependency
...

I'm not seeing those. http://pkg.ftfl.ca/data/13amd64-default/2021-07-16_09h32m04s/logs/bear-3.0.13.log

So I think we are ready to commit. Any objections? I did a quick runtime test of bear -- gmake on a project and all seems fine.

jrm retitled this revision from devel/bear: [WIP] Update to 3.0.12 to devel/bear: [WIP] Update to 3.0.13.Jul 16 2021, 12:44 PM
In D30868#702305, @jrm wrote:

I'm not seeing those. http://pkg.ftfl.ca/data/13amd64-default/2021-07-16_09h32m04s/logs/bear-3.0.13.log

So I think we are ready to commit. Any objections? I did a quick runtime test of bear -- gmake on a project and all seems fine.

Ok so having just LIB_DEPENDS= libabsl_hash.so:devel/abseil is enough to squelch all those warnings/errors.

LGTM.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 17 2021, 3:18 PM
This revision was automatically updated to reflect the committed changes.