Skip to contentSkip to conversation

grpc: use the new PACKAGECONFIG to disable shared

PATCH In review Sinan Kaya 2 participants 3 messages Aug 24, 2021 – Aug 27, 2021

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 grpc: use the new PACKAGECONFIG to disable shared

There is a new PACKAGECONFIG for grpc to allows us to selectively enable/disable shared builds.

---
 .../openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
dynamic-layers/openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend +1 -2
index dc0ea42..4cbd1a4 100644
@@ -1,5 +1,4 @@
 # doesn't build and not required
 DEPENDS:remove:mingw32 = "libnsl2"
 
-EXTRA_OECMAKE:remove:mingw32 = "-DBUILD_SHARED_LIBS=ON"
-EXTRA_OECMAKE:append:mingw32 = " -DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG:remove:mingw32 = "shared"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 13 lines · Sinan Kaya

There is a new PACKAGECONFIG for grpc to allows us to selectively enable/disable shared builds.

---
  .../openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend  | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
dynamic-layers/openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend +0 -0
index dc0ea42..4cbd1a4 100644

dynamic-layers/openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend line 4

Quoted 6 lines
dynamic-layers/openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend +1 -2
@@ -1,5 +1,4 @@
  # doesn't build and not required
  DEPENDS:remove:mingw32 = "libnsl2"
 
-EXTRA_OECMAKE:remove:mingw32 = "-DBUILD_SHARED_LIBS=ON"
-EXTRA_OECMAKE:append:mingw32 = " -DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG:remove:mingw32 = "shared"

This is good, thanks. Is the libnsl2 also tied to some feature? Perhaps you can explain why it needs to be removed from MinGW

author
#2 lore raw
Quoted 8 lines · Joshua Watt
Quoted 3 lines
dynamic-layers/openembedded-layers/recipes-devtools/grpc/grpc_%.bbappend +0 -0
@@ -1,5 +1,4 @@
   # doesn't build and not required

  DEPENDS:remove:mingw32 = "libnsl2"

This is good, thanks. Is the libnsl2 also tied to some feature? Perhaps you can explain why it needs to be removed from MinGW

My research says libnsl is a soft requirement for c-ares. GRPC assumes libnsl to be present and used by default. However, it will build without it too.

https://www.linuxfromscratch.org/blfs/view/svn/basicnet/libnsl.html

We should be turning libnsl off if you want to enable GRPC's backward compatibility mode. Maybe, because previous versions didn't support libnsl.

c-ares
-------------
CMakeLists.txt:CARES_FUNCTION_IN_LIBRARY (gethostbyname nsl HAVE_LIBNSL) CMakeLists.txt: LIST (APPEND CARES_DEPENDENT_LIBS nsl)

grpc
-------------
if(gRPC_BACKWARDS_COMPATIBILITY_MODE)
# See https://github.com/grpc/grpc/issues/17255
set(HAVE_LIBNSL OFF CACHE BOOL "avoid cares dependency on libnsl")
endif()

CMakeLists.txt:option(gRPC_BACKWARDS_COMPATIBILITY_MODE "Build libraries that are binary compatible across a larger number of OS and libc versions" OFF) CMakeLists.txt:if(gRPC_BACKWARDS_COMPATIBILITY_MODE)