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 wrong version in gRPCConfigVersion.cmake and grpc++*.pc #22529

Closed
wants to merge 1 commit into from

Conversation

kou
Copy link
Contributor

@kou kou commented Apr 1, 2020

They use PACKAGE_VERSION to generate version information but
PACKAGE_VERSION may be overridden by find_package(). For example,
-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides
PACKAGE_VERSION to 1.16.0. Because c-ares-config-version.cmake has the
following line:

set(PACKAGE_VERSION "1.16.0")

Setting PACKAGE_VERSION in version.cmake is a common CMake convention:

https://cmake.org/cmake/help/latest/command/find_package.html#version-selection

PACKAGE_VERSION

full provided version string

So we should use gRPC_CPP_VERSION not PACKAGE_VERSION to generate
gRPCConfigVersion.cmake and grpc++*.pc.

@nicolasnoble

They use PACKAGE_VERSION to generate version information but
PACKAGE_VERSION may be overridden by find_package(). For example,
-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides
PACKAGE_VERSION to 1.16.0. Because c-ares-config-version.cmake has the
following line:

    set(PACKAGE_VERSION "1.16.0")

Setting PACKAGE_VERSION in version.cmake is a common CMake convention:

https://cmake.org/cmake/help/latest/command/find_package.html#version-selection

> PACKAGE_VERSION
>
>    full provided version string

So we should use gRPC_CPP_VERSION not PACKAGE_VERSION to generate
gRPCConfigVersion.cmake and grpc++*.pc.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 1, 2020

CLA Check
The committers are authorized under a signed CLA.

kou added a commit to kou/arrow that referenced this pull request Apr 1, 2020
gRPC may provide wrong version information by config.cmake and
.pc. See grpc/grpc#22529 for details.

gRPC >= 1.17.0 detection is failed by config.cmake. Then we fallback
to our FindgRPCAlt. FindgRPCAlt uses gRPC_ROOT if it's set. gRPC_ROOT
is set to ARROW_PACKAGE_PREFIX automatically when we don't specify
gRPC_SOURCE. But we always set gRPC_SOURCE in our CI (see
ci/scripts/cpp_build.sh for details). So gRPC_ROOT isn't set.

If gRPC_ROOT isn't set, pkg-config is used to detect gRPC but
version information in grpc++.pc is also broken. gRPC >= 1.17.0
requirement isn't satisfied.

We can't build gRPC with
MinGW. grpc/grpc#21720 is needed.
nealrichardson pushed a commit to apache/arrow that referenced this pull request Apr 1, 2020
gRPC may provide wrong version information by config.cmake and
.pc. See grpc/grpc#22529 for details.

gRPC >= 1.17.0 detection is failed by config.cmake. Then we fallback
to our FindgRPCAlt. FindgRPCAlt uses gRPC_ROOT if it's set. gRPC_ROOT
is set to ARROW_PACKAGE_PREFIX automatically when we don't specify
gRPC_SOURCE. But we always set gRPC_SOURCE in our CI (see
ci/scripts/cpp_build.sh for details). So gRPC_ROOT isn't set.

If gRPC_ROOT isn't set, pkg-config is used to detect gRPC but
version information in grpc++.pc is also broken. gRPC >= 1.17.0
requirement isn't satisfied.

We can't build gRPC with
MinGW. grpc/grpc#21720 is needed.

Closes #6795 from kou/mingw-grpc

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>
@stale
Copy link

stale bot commented May 6, 2020

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@stale stale bot closed this May 13, 2020
@kou
Copy link
Contributor Author

kou commented May 13, 2020

Could someone review this?

@kou
Copy link
Contributor Author

kou commented May 14, 2020

Could someone reopen this?

@kou
Copy link
Contributor Author

kou commented May 15, 2020

Can I create a new pull request with the same change instead of waiting reopen?

@kou
Copy link
Contributor Author

kou commented May 18, 2020

I've created: #22982

@kou kou deleted the fix-cpp-version branch June 22, 2020 21:52
alamb pushed a commit to apache/arrow-rs that referenced this pull request Apr 20, 2021
gRPC may provide wrong version information by config.cmake and
.pc. See grpc/grpc#22529 for details.

gRPC >= 1.17.0 detection is failed by config.cmake. Then we fallback
to our FindgRPCAlt. FindgRPCAlt uses gRPC_ROOT if it's set. gRPC_ROOT
is set to ARROW_PACKAGE_PREFIX automatically when we don't specify
gRPC_SOURCE. But we always set gRPC_SOURCE in our CI (see
ci/scripts/cpp_build.sh for details). So gRPC_ROOT isn't set.

If gRPC_ROOT isn't set, pkg-config is used to detect gRPC but
version information in grpc++.pc is also broken. gRPC >= 1.17.0
requirement isn't satisfied.

We can't build gRPC with
MinGW. grpc/grpc#21720 is needed.

Closes #6795 from kou/mingw-grpc

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Neal Richardson <neal.p.richardson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant