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

Added ProtocolBuffers #10436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stemann
Copy link
Contributor

@stemann stemann commented Feb 5, 2025

Currently, there is protoc_jll, which provides the protobuf compiler, protoc, and the libprotobuf, and libprotobuf-lite run-time libraries (in shared library form), but not the static run-time libraries - and the versioning got a bit off course, cf. #9796.

Since

Protobuf C++ disclaims all cross-runtime support and requires an exact match between its generated code version and its runtime version at all times.

it is very much preferable to link with libprotobuf statically, and not dynamically. Cf. https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp

In Yggdrasil, there are packages that have protoc_jll as a HostBuildDependency, but there are also packages that need the run-time libraries and have protoc_jll as a Dependency.

The present PR accomplishes the following goals:

  • Separate (and correct) versioning of
    • the protobuf project, and protoc compiler, e.g., v28.2, (in JLL: ProtocolBuffersCompiler),
    • and the C++ runtime library, e.g., v5.28.2 (in JLLs ProtocolBuffers, and ProtocolBuffersSDK)
  • Static libraries (in JLL: ProtocolBuffersSDK), cf. recommendation from https://github.com/onnx/onnx/blob/v1.17.0/README.md#linux
  • Shared libraries (without protoc) in JLL ProtocolBuffers.

Over time, these packages could replace protoc_jll.

@stemann
Copy link
Contributor Author

stemann commented Feb 5, 2025

Temporarily also added ProtocolBuffersCompiler - this should likely depend on ProtocolBuffers (protoc depends on the C++ runtime library libprotobuf), and be built in a separate step.

…c recipe

ProtocolBuffers only includes libprotobuf and libprotobuf-lite shared libraries.

ProtocolBuffersSDK only includes static libraries.

Static libraries are compiled as position independent code, cf. https://github.com/onnx/onnx/blob/v1.17.0/README.md#linux

Removes need for custom versioning, cf. notes about protobuf version numbers.
@stemann stemann force-pushed the feature/ProtocolBuffers branch from 8ba969c to 2b9fce7 Compare February 7, 2025 08:02
@stemann stemann marked this pull request as ready for review February 7, 2025 08:02
@stemann
Copy link
Contributor Author

stemann commented Feb 7, 2025

One could also consider adding ProtocolBuffersLite with just libprotobuf-lite, but the protobuf CMake system does not support building just libprotobuf-lite out-of-the-box (and so it is likely entangled in the generated Cmake/Pkg-config)

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.

1 participant