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

protobuf: add v4.25.3, v5.26.0 #21622

Closed
wants to merge 40 commits into from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Dec 5, 2023

Continues directly from

Copy link
Contributor

github-actions bot commented Dec 5, 2023

🤖 Beep Boop! This pull request is making changes to 'recipes/protobuf//'.

👋 @Hopobcn you might be interested. 😉

@ghost
Copy link

ghost commented Dec 5, 2023

I detected other pull requests that are modifying protobuf/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@valgur valgur force-pushed the update/protobuf-v4.25 branch from e03e962 to b0e6e09 Compare January 17, 2024 12:23
@valgur valgur changed the title protobuf: add v3.25.1 protobuf: add v3.25.2 Jan 17, 2024
@conan-center-bot conan-center-bot added Failed Missing dependencies Build failed due missing dependencies in Conan Center labels Jan 17, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

os.unlink(os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-targets-{}.cmake".format(str(self.settings.build_type).lower())))
rename(self, os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-config.cmake"),
os.path.join(self.package_folder, self._cmake_install_base_path, "protobuf-generate.cmake"))
if Version(self.version) < "3.22.0":
Copy link
Member

Choose a reason for hiding this comment

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

What's the proposal of this change? I see the same protobuf-generate.cmake being installed with 4.25.3:

-- Up-to-date: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf
-- Installing: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf/protobuf-module.cmake
-- Installing: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf/protobuf-generate.cmake
-- Installing: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf/protobuf-options.cmake
-- Installing: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf/protobuf-config.cmake
-- Installing: /Users/uilian/.conan/data/protobuf/4.25.3/_/_/package/799e25793bb4a51e590a0065a670b4676d489bda/lib/cmake/protobuf/protobuf-config-version.cmake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why @toge saw a need for the if/else based on the version, but packaging protobuf-config.cmake is prohibited by the linter.

Copy link
Member

Choose a reason for hiding this comment

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

but packaging protobuf-config.cmake is prohibited by the linter.

We can skip it from the linter or hooks. Please, revert this change.

@conan-center-bot

This comment has been minimized.

@NoneOfUrBusiness12
Copy link

Is there any movement on this issue? Would be really nice to get this through to allow #21593 to move forward :)

@uilianries
Copy link
Member

Is there any movement on this issue? Would be really nice to get this through to allow #21593 to move forward :)

@NoneOfUrBusiness12 Yes, it's under review. Please, take a look past conversation in this PR (few days/hours). Plus, you can customize your Github to notify about any change in this pull request.

@valgur
Copy link
Contributor Author

valgur commented May 16, 2024 via email

@uilianries
Copy link
Member

It's a valid error from the linter, though. We should not be including a protobuf-config.cmake file in the package that could get picked up by find_package(protobuf CONFIG).

@valgur My question is why changing from protobuf-generate to protobuf-protoc now.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 24 (6da91e5ebd05ee88cbc164c3cfe0d329ea12b05f):

  • protobuf/5.26.1:
    All packages built successfully! (All logs)

  • protobuf/4.25.3:
    All packages built successfully! (All logs)

  • protobuf/3.20.3:
    All packages built successfully! (All logs)

  • protobuf/3.21.12:
    All packages built successfully! (All logs)

  • protobuf/3.21.9:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 24 (6da91e5ebd05ee88cbc164c3cfe0d329ea12b05f):

  • protobuf/5.26.1:
    All packages built successfully! (All logs)

  • protobuf/4.25.3:
    All packages built successfully! (All logs)

  • protobuf/3.21.12:
    All packages built successfully! (All logs)

  • protobuf/3.21.9:
    All packages built successfully! (All logs)

  • protobuf/3.20.3:
    All packages built successfully! (All logs)

@uilianries
Copy link
Member

@valgur Please, revert the test package and keep simplified as before. We applied a specific PR just to simplify that part of this recipe.

@valgur
Copy link
Contributor Author

valgur commented May 20, 2024 via email

@saschasc
Copy link

saschasc commented May 28, 2024

@valgur @RubenRBS @uilianries Any further progress in this PR?

It would be great to have progress in this issue to be able to upgrade GRPC. The latest available GRPC version currently has two high severity CVEs.

@ghost ghost mentioned this pull request May 29, 2024
@jcar87
Copy link
Contributor

jcar87 commented May 30, 2024

Close as superseded by #24154

Conan basically breaks all of the exported CMake functionality of the
project by default, so it is the responsibility of Conan to also ensure
that it is still working as intended. It’s not a functional test for the
project itself but more of a ”linkage” test for CMake functions.

The upstream project does mostly 3 things in their provided CMake configuration:

  1. set up the library targets
  2. set up the executable target (protobuf::protoc)
  3. set up the cmake macro protobuf_generate and the legacy protobuf_generate_cpp for compatibility

(1) is taken care of CMakeDeps, and (3) is expressed in the package info - the logic to generate those functions is bundled inside the package completely unchanged by the recipe. The trickier bit is (2) as CMakeDeps does not currently support defining imported executable targets.

I can see why the logic in the recipe was confusing - for earlier versions of protobuf, the macro logic was in protobuf-config.cmake, so the recipe was doing 3 things: prevent that file from attempting to load the -targets.cmake and related files, retain the macro/function logic, and inject (2) for the executable targets. This certainly did not stand the test of time. I have refactored this to split (2) to a separate file that is included as a cmake build module instead. Newer versions of protobuf are easier, because protobuf-generate.cmake is a separate standalone file - this is still packaged unchanged.

In order to test the post-conditions of (2) and (3), we've added additional logic in the test https://github.com/conan-io/conan-center-index/blob/master/recipes/protobuf/all/test_package/CMakeLists.txt#L24-L30
So we test:

  • the library targets
  • the executable target is well-defined
  • the function is defined
  • we invoke the executable (with self.run())

From these, we are satisfied that we are protected against regressions - especially considering that we do not alter the protobuf_generate logic in any way, shape or form. We are unlikely to consider reverting to what was before. If time proves us wrong, we will be the first to correct course and fix it.

The hacky workaround for macOS is also highly relevant because it will crop
up in all Conan v2 recipes using protobuf. It’s better to find a suitable
fix here than in the downstream recipes. I have already been bitten by this
on CCI.

I'm not sure this is actually happening.
When other recipes use protobuf, this is what happens on CI:

  • for Conan 1.x, all dependencies are static, even when a consumer is shared so DYLD_LIBRARY_PATH is irrelevant. (there may be few exceptions, if a recipe forces the dependency to be shared and we are operating with one profile).
  • for Conan 2, we pass -o "*:shared=True" when building a shared library - but this applies to the host profile, as per the conan documentation. The build profile, which applies when solving tool_requires (for consumers that need protoc), will remain with the default which is shared=False - so again, DYLD_LIBRARY_PATH is unlikely to apply and cause any issues.

Of course, if one forces a cmake project in the test_package to execute an executable from the host context in the test_package, this would be an issue - don't think it's worth it if the executable is already run via self.run().

So given this, I'm not sure whether this is a widespread issue. We are more concerned about the users and whether they experience this, rather than CI. For CI we know how to address this transparently without altering the recipes. If this becomes a widespread issue for users, we can provide advise or prioritise a fix in the Client.

I would advise that if a PR claims to add new versions, that it adds new versions rather than try to add changes that were already discarded in earlier discussions. By all means, ensuring the test package is robust is a good thing, which can be handled separately to the changes in the recipe.

@jcar87 jcar87 closed this May 30, 2024
@conan-io conan-io locked and limited conversation to collaborators May 30, 2024
@jcar87
Copy link
Contributor

jcar87 commented May 30, 2024

@saschasc - new versions of protobuf are already available. We will consider PRs to add new versions of gRPC, but bear in mind that we will try to coordinate also updating consumers of gRPC (like google-cloud-cpp), to avoid version conflicts. I have a feeling finding a version of abseil that works with all will be tricky - but I could be wrong.

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

Successfully merging this pull request may close these issues.