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

Fix build failure with the Protobuf 23.3 #290

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Jun 21, 2023

Motivation

The current CMakeLists.txt does not work with the latest Protobuf (23.3.0). It's because currently the Module mode is used to find Protobuf, while the FindProtobuf.cmake is not updated to find the Abseil dependency.

See protocolbuffers/protobuf#12292 (comment)

Modifications

For macOS, use the Config mode to find Protobuf. It's because in other systems, the Module mode works well. Besides, enable PROTOBUF_USE_DLLS as a workaround for
protocolbuffers/protobuf#12983 is not released.

Pin the default C++ standard to 17 for macOS so that users don't need to set the C++ standard manually.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@BewareMyPower BewareMyPower added this to the 3.3.0 milestone Jun 21, 2023
@BewareMyPower BewareMyPower self-assigned this Jun 21, 2023
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-latest-protobuf branch from 1b4adae to 53ca69d Compare June 21, 2023 15:57
@shibd
Copy link
Member

shibd commented Jun 22, 2023

In this way, the macOS developer needs to use C++ 17 to compile this project.

We need to update README.

@BewareMyPower
Copy link
Contributor Author

In this way, the macOS developer needs to use C++ 17 to compile this project.

Yes. BTW, I think we can make C++17 as the default standard for macOS users because it's now required by the library dependency, not the test dependency. I marked this PR as drafted first.

@BewareMyPower BewareMyPower marked this pull request as draft June 24, 2023 16:18
### Motivation

The current CMakeLists.txt does not work with the latest Protobuf
(23.3.0). It's because currently the Module mode is used to find
Protobuf, while the `FindProtobuf.cmake` is not updated to find the
Abseil dependency.

See protocolbuffers/protobuf#12292 (comment)

### Modifications

For macOS, use the Config mode to find Protobuf. It's because in other
systems, the Module mode works well. Besides, enable `PROTOBUF_USE_DLLS`
as a workaround for
protocolbuffers/protobuf#12983 is not released.

Pin the default C++ standard to 17 for macOS so that users don't need to
set the C++ standard manually.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-latest-protobuf branch from 53ca69d to e09cb53 Compare June 25, 2023 12:56
@BewareMyPower BewareMyPower marked this pull request as ready for review June 25, 2023 12:57
@BewareMyPower
Copy link
Contributor Author

@shibd I've updated the README and pinned the C++ standard to 17 for macOS so that we don't need to set CMAKE_CXX_STANDARD explicitly with the default dependencies installed on macOS anymore.

@shibd shibd merged commit 633f4bb into apache:main Jun 26, 2023
10 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-latest-protobuf branch July 25, 2023 07:12
BewareMyPower added a commit to BewareMyPower/pulsar-client-python that referenced this pull request Aug 11, 2023
### Modifications

Upgrade the C++ client to 3.3.0 and deprecate the `log_conf_file_path`
config due to apache/pulsar-client-cpp#283.

There is another issue that after
apache/pulsar-client-cpp#290, the CMakeLists.txt
from the C++ client finds the protobuf package with config mode. To fix
it, install the OpenSSL via CMake instead of the autotools.
BewareMyPower added a commit to BewareMyPower/pulsar-client-python that referenced this pull request Aug 11, 2023
### Modifications

Upgrade the C++ client to 3.3.0 and deprecate the `log_conf_file_path`
config due to apache/pulsar-client-cpp#283.

There is another issue that after
apache/pulsar-client-cpp#290, the CMakeLists.txt
from the C++ client finds the protobuf package with config mode. To fix
it, install the OpenSSL via CMake instead of the autotools.
BewareMyPower added a commit to apache/pulsar-client-python that referenced this pull request Aug 11, 2023
### Modifications

Upgrade the C++ client to 3.3.0 and deprecate the `log_conf_file_path`
config due to apache/pulsar-client-cpp#283.

There is another issue that after
apache/pulsar-client-cpp#290, the CMakeLists.txt
from the C++ client finds the protobuf package with config mode. To fix
it, install the OpenSSL via CMake instead of the autotools.
BewareMyPower added a commit to BewareMyPower/pulsar-client-cpp that referenced this pull request Nov 21, 2023
…n macOS

### Motivation

apache#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit to BewareMyPower/pulsar-client-cpp that referenced this pull request Nov 21, 2023
…n macOS

### Motivation

apache#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit to BewareMyPower/pulsar-client-cpp that referenced this pull request Nov 21, 2023
…n macOS

### Motivation

apache#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit to BewareMyPower/pulsar-client-cpp that referenced this pull request Nov 21, 2023
…n macOS

### Motivation

apache#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit to BewareMyPower/pulsar-client-cpp that referenced this pull request Nov 21, 2023
…n macOS

### Motivation

apache#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit that referenced this pull request Nov 21, 2023
…n macOS (#354)

### Motivation

#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.
BewareMyPower added a commit that referenced this pull request Nov 21, 2023
…n macOS (#354)

### Motivation

#290 brings a regression
that on macOS, Protobuf is always found with CMake Config mode, which
does not set the `Protobuf_LIBRARIES` variable so that the
libpulsarwithdeps.a misses the symbols of Protobuf.

### Modifications

When `LINK_STATIC` is ON, use CMake Module mode to find the Protobuf.

Add `build-static-library.sh` to build libraries with static
dependencies and verify these libraries in PR workflow. Upload the
pre-built binaries in the build workflow.

(cherry picked from commit f75b39b)
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.

None yet

2 participants