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

gRPC appears to only link against static CRT #10289

Closed
IIFE opened this issue Mar 3, 2020 · 6 comments
Closed

gRPC appears to only link against static CRT #10289

IIFE opened this issue Mar 3, 2020 · 6 comments
Assignees
Labels
category:question This issue is a question

Comments

@IIFE
Copy link

IIFE commented Mar 3, 2020


Is your feature request related to a problem? Please describe.
the gRPC port appears to build gRPC against static CRT using the following option:
-DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME}

This is problematic when consuming the gRPC libraries in a solution that only relies on the dynamic CRT.

In my triplet override I am specifying set(VCPKG_CRT_LINKAGE dynamic), however I believe that is getting ignored by the -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} option.

Proposed solution
Allow gRPC to be built against dynamic CRT.

Describe alternatives you've considered
I am thinking of changing the port to link against dynamic CRT, however I'm not sure how to best do that as I'm not familiar with the side effects of the gRPC options.

Additional context
Visual Studio 2015, Windows.

@IIFE IIFE added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Mar 3, 2020
@IIFE
Copy link
Author

IIFE commented Mar 3, 2020

Strangely, which I run dumpbin /DIRECTIVES grpc.lib it shows /DEFAULTLIB:MSVCRT. What does the -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} option actually do, as I think I'm getting confused by it.

@IIFE
Copy link
Author

IIFE commented Mar 3, 2020

Furthermore, any reason gRPC is only built as static lib. Following option in port file appears to indicate so:
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

@LilyWangL
Copy link
Contributor

Thanks for posting this issue. Due to grpc has problems with exporting symbols, it only support static build. You can get more information from: #539 #535

@IIFE
Copy link
Author

IIFE commented Mar 5, 2020

@LilyWangL Thanks for your reply.

OK that's no problem if it builds as a static lib. However, I just want to confirm my understanding. gRPC is built as a static lib, however it's linked against the dynamic CRT, correct?

Thanks.

@LilyWangL
Copy link
Contributor

If you build grpc:x86-windows, you will get a static lib and it's linked the dynamic CRT.

@IIFE
Copy link
Author

IIFE commented Mar 5, 2020

Thanks for the confirmation.

@IIFE IIFE closed this as completed Mar 5, 2020
@LilyWangL LilyWangL added category:question This issue is a question and removed category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist labels Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants