conda-forge / opencv-feedstock

A conda-smithy repository for opencv.
BSD 3-Clause "New" or "Revised" License
65 stars 60 forks source link

Rebuild for protobuf423 #362

Closed regro-cf-autotick-bot closed 1 year ago

regro-cf-autotick-bot commented 1 year ago

This PR has been triggered in an effort to update protobuf423.

Notes and instructions for merging this PR:

  1. Please merge the PR only after the tests have passed.
  2. Feel free to push to the bot's branch to update this PR if needed.

Please note that if you close this PR we presume that the feedstock has been rebuilt, so if you are going to perform the rebuild yourself don't close this PR until the your rebuild has been merged.

If this PR was opened in error or needs to be updated please add the bot-rerun label to this PR. The bot will close this PR and schedule another one. If you do not have permissions to add this label, you can use the phrase code>@<space/conda-forge-admin, please rerun bot in a PR comment to have the conda-forge-admin add it for you.

This PR was created by the regro-cf-autotick-bot. The regro-cf-autotick-bot is a service to automatically track the dependency graph, migrate packages, and propose package version updates for conda-forge. Feel free to drop us a line if there are any issues! This PR was generated by https://github.com/regro/cf-scripts/actions/runs/5098316562, please use this URL for debugging.

conda-forge-webservices[bot] commented 1 year ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

hmaarrfk commented 1 year ago

@h-vetinari i'm not sure if you can help here. I've tried to force CXX 17. Am I missing something? Have we moved forward in the CXX standard?

h-vetinari commented 1 year ago

Am I missing something? Have we moved forward in the CXX standard?

You need to link to abseil, since protobuf now depends on it (and not just internally 😑)

$BUILD_PREFIX/ld: tf_importer.cpp:(...):undefined reference to `absl::lts_20230125::hash_internal::MixingHashState::kSeed'

On windows you need to link to the abseil_dll omnibus, whereas on unix you need to figure out in which library that symbol sits (or just try to throw all abseil links at it and see what sticks). Based on the name it's very likely absl_hash. The abseil-feedstock has a list of libraries (not guaranteed to be 100% perfect, but shouldn't be off too far)

traversaro commented 1 year ago

Probably to link abseil it is helpful to use find_package(Protobuf CONFIG) instead of find_package(Protobuf) ?

hmaarrfk commented 1 year ago

Is the current thinking that OpenCV isn't using the CMake files from Protobuf with enough precision to trigger the additional flags to get added?

h-vetinari commented 1 year ago

Is the current thinking that OpenCV isn't using the CMake files from Protobuf with enough precision to trigger the additional flags to get added?

I don't think most consumers of protobuf are ready for v4, and their new responsibility to (for example) link to abseil. Not even abseil's own python bindings link to abseil correctly yet. Disclaimer: I don't know where these symbols exactly are used and whose responsibility it would be to link them (protobuf or its consumers), just general observations from the migration.

traversaro commented 1 year ago

If you use find_package(Protobuf CONFIG), then linking with the required abseil library happens just by linking protobuf::libprotobuf or simple imported target, as those targets are imported via the protobuf-config.cmake file generated and installed by Protobuf itself. If find_package(Protobuf) is used instead, FindProtobuf.cmake is used to define protobuf::libprotobuf, ignoring the new abseil dependency. Unfortunalty find_package(Protobuf CONFIG) and find_package(Protobuf) to not offer exactly the same interface. See https://gitlab.kitware.com/cmake/cmake/-/issues/24321 for more details.

Note that FindProtobuf.cmake has other problems with new Protobuf, see https://gitlab.kitware.com/cmake/cmake/-/issues/24847 .

To give an example, this is an excerpt from protobuf-targets.cmake for libprotobuf 4.23.2 on Linux:

set_target_properties(protobuf::libprotobuf PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "absl::absl_check;absl::absl_log;absl::algorithm;absl::base;absl::bind_front;absl::bits;absl::btree;absl::cleanup;absl::cord;absl::core_headers;absl::debugging;absl::die_if_null;absl::dynamic_annotations;absl::flags;absl::flat_hash_map;absl::flat_hash_set;absl::function_ref;absl::hash;absl::layout;absl::log_initialize;absl::log_severity;absl::memory;absl::node_hash_map;absl::node_hash_set;absl::optional;absl::span;absl::status;absl::statusor;absl::strings;absl::synchronization;absl::time;absl::type_traits;absl::utility;absl::variant"
)
hmaarrfk commented 1 year ago

Done in https://github.com/conda-forge/opencv-feedstock/pull/363

traversaro commented 1 year ago

Done in #363

I guess the migrator is not aware of it? Perhaps:

@conda-forge-admin, please rerun bot could

help.

hmaarrfk commented 1 year ago

You have to close the PR (or merge)

Sometimes it takes time