Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable pkg-config tests on windows #242

Closed
wants to merge 8 commits into from

Conversation

h-vetinari
Copy link
Member

@h-vetinari h-vetinari commented Sep 8, 2022

Now that conda-forge/openssl-feedstock#106 is in, re-enable pkg-config tests.

I tried adding CMake metadata in conda-forge/libprotobuf-feedstock#128 (to re-enable the CMake tests on unix), but this caused some fall-out. However, CMake has its own custom FindProtobuf function that takes precedence over the packaged CMake metadata; perhaps it's still possible to nudge it to find our protobuf-config-less protobuf)

@conda-forge-linter
Copy link

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.

@h-vetinari
Copy link
Member Author

Seems this will need some more work on abseil upstream: abseil/abseil-cpp#1276

@h-vetinari
Copy link
Member Author

@traversaro
Any idea how to make CMake's custom FindProtobuf work also on unix? I've tried setting a bunch of variables I see being used in the function, but so far to no avail...

@traversaro
Copy link

traversaro commented Sep 9, 2022

@traversaro Any idea how to make CMake's custom FindProtobuf work also on unix? I've tried setting a bunch of variables I see being used in the function, but so far to no avail...

The Protobuf CMake package is searched for in https://github.com/grpc/grpc/blob/v1.46.4/cmake/protobuf.cmake#L58 :

find_package(Protobuf REQUIRED ${gRPC_PROTOBUF_PACKAGE_TYPE})

if gRPC_PROTOBUF_PACKAGE_TYPE is CONFIG, then the use of FindProtobuf.cmake is skipped, and the CMake only searches for ProtobufConfig.cmake or protobuf-config.cmake (so-called find_package config mode, see https://cmake.org/cmake/help/v3.24/command/find_package.html#full-signature). So we should avoid that gRPC_PROTOBUF_PACKAGE_TYPE is set to CONFIG. Based on https://github.com/grpc/grpc/blob/v1.46.4/CMakeLists.txt#L89, I guess the other possible value for gRPC_PROTOBUF_PACKAGE_TYPE is MODULE, that even if it is not an option for find_package, at least it is ignored so find_package will go back to the default behaviour of using FindProtobuf.cmake.

TL;DR: pass -DgRPC_PROTOBUF_PACKAGE_TYPE:STRING="MODULE" to CMake config.

@h-vetinari
Copy link
Member Author

Thanks a lot, I'll try this shortly!

@h-vetinari
Copy link
Member Author

Thanks a lot, I'll try this shortly!

No success, unfortunately... 😑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants