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

[3.20] Build with CMake on unix #127

Merged
merged 19 commits into from
Sep 6, 2022
Merged

Conversation

h-vetinari
Copy link
Member

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

Testing things like grpc through the examples provided upstream needs find_package(protobuf) to run, which fails on unix with

CMake Error at /home/conda/feedstock_root/build_artifacts/grpc-split_1662220567868/test_tmp/examples/cpp/cmake/common.cmake:101 (find_package):
  Could not find a package configuration file provided by "Protobuf" with any
  of the following names:

    ProtobufConfig.cmake
    protobuf-config.cmake

  Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
  "Protobuf_DIR" to a directory containing one of the above files.  If
  "Protobuf" provides a separate development package or SDK, be sure it has
  been installed.

because the builds here are done with autotools.

Build with cmake to be able to run better testing in grpc-cpp feedstock. Also:

  • normalize cmake module location on windows
  • unify build scripts
  • improve testing

@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 h-vetinari force-pushed the cmake branch 3 times, most recently from cb518e2 to 41bb7b7 Compare September 4, 2022 10:40
@h-vetinari h-vetinari changed the title Build with CMake on unix [3.20] Build with CMake on unix Sep 4, 2022
@h-vetinari
Copy link
Member Author

@conda-forge/libprotobuf PTAL

We've had a bunch of issues with abseil/grpc and recent migrations, some of which only show up when actually trying to build against the artefacts in other feedstocks (e.g. things around the link interface and what libs are necessary at runtime because of that), so I'd like to run the compilation example from upstream grpc in our CI, see the setup added in conda-forge/grpc-cpp-feedstock#239.

However, that example is based on cmake and currently fails because our libprotobuf builds have no cmake metadata. Since upstream protobuf seems to have put much more effort behind CMake (as of 3.21, cmake/CMakeLists.txt is deprecated, as there's now a CMakeLists.txt in root), I think this is a good thing to do. It harmonizes the build scripts and should make them easier to understand.

As I went, I fixed some other issues like improved testing, normalized the location of the cmake metadata on windows, and harmonized the static build setup for windows with the unix ones resp. conda-forge/conda-forge.github.io#1809. I also switched away from travis as it consistently killed the build (not sure if memory demands are too high...?).

This PR has a mirror version in #128 for main, but it should be enough to review this one. I've kept as much as possible intact through the various commits, which should be easier to review than the whole diff at once (which loses the files renames).

Copy link
Contributor

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm new to this feedstock but this looks like a really great improvement @h-vetinari!

@h-vetinari
Copy link
Member Author

@conda-forge/protobuf
I will merge this & #128 tomorrow, Tuesday unless there are objections until then.

Thanks for the review @xylar!

@h-vetinari h-vetinari merged commit d09f01c into conda-forge:3.20.1 Sep 6, 2022
@h-vetinari h-vetinari deleted the cmake branch September 6, 2022 15:25
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