Skip to contentSkip to conversation

protobuf: static link tools when generating sdk

PATCH Superseded Sinan Kaya 3 participants 6 messages Aug 17, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/3 protobuf: static link tools when generating sdk

Dynamically linked protoc.exe is failing as follows:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:641] File already exists in database: google/protobuf/descriptor.proto [libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):

Switch to static linkage per upstream recommendation.

---
 recipes-devtools/protobuf/protobuf_%.bbappend | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 recipes-devtools/protobuf/protobuf_%.bbappend
recipes-devtools/protobuf/protobuf_%.bbappend new file +1 -0
new file mode 100644
index 0000000..7e62ff6
@@ -0,0 +1 @@
+EXTRA_OECONF:append:class-nativesdk = " --disable-shared"
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/3 protobuf-c: static link when generating sdk

[libprotobuf ERROR google/protobuf/descriptor_database.cc:641] File already exists in database: google/protobuf/descriptor.proto [libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):

Switch to static linkage per upstream recommendation.

---
 recipes-devtools/protobuf-c/protobuf-c_%.bbappend | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 recipes-devtools/protobuf-c/protobuf-c_%.bbappend
recipes-devtools/protobuf-c/protobuf-c_%.bbappend new file +1 -0
new file mode 100644
index 0000000..7e62ff6
@@ -0,0 +1 @@
+EXTRA_OECONF:append:class-nativesdk = " --disable-shared"
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 3/3 grpc: static link tools when generating SDK

In reply to Sinan Kaya

[libprotobuf ERROR google/protobuf/descriptor_database.cc:641] File already exists in database: google/protobuf/descriptor.proto [libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):

Switch to static linkage per upstream recommendation.

---
 recipes-devtools/grpc/grpc_%.bbappend | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 recipes-devtools/grpc/grpc_%.bbappend
recipes-devtools/grpc/grpc_%.bbappend new file +2 -0
new file mode 100644
index 0000000..cbccf74
@@ -0,0 +1,2 @@
+EXTRA_OECMAKE:remove:class-nativesdk = "-DBUILD_SHARED_LIBS=ON"
+EXTRA_OECMAKE:append:class-nativesdk = " -DBUILD_SHARED_LIBS=OFF"
Signature · 1 line
2.17.1
#3 lore raw
In reply to Sinan Kaya
Quoted 22 lines · Sinan Kaya

Dynamically linked protoc.exe is failing as follows:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:641] File already exists in database: google/protobuf/descriptor.proto [libprotobuf FATAL google/protobuf/descriptor.cc:1371] CHECK failed:
GeneratedDatabase()->Add(encoded_file_descriptor, size):

Switch to static linkage per upstream recommendation.

---
 recipes-devtools/protobuf/protobuf_%.bbappend | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 recipes-devtools/protobuf/protobuf_%.bbappend
recipes-devtools/protobuf/protobuf_%.bbappend new file +0 -0
new file mode 100644
index 0000000..7e62ff6

recipes-devtools/protobuf/protobuf_%.bbappend line 1

Quoted 1 line
recipes-devtools/protobuf/protobuf_%.bbappend new file +1 -0
@@ -0,0 +1 @@
+EXTRA_OECONF:append:class-nativesdk = " --disable-shared"

This is not an inert change can it use some mingw specific override as well

Quoted 8 lines

--
2.17.1

author
#4 lore raw
Quoted 4 lines · Khem Raj
    +EXTRA_OECONF:append:class-nativesdk = " --disable-shared"

This is not an inert change can it use some mingw specific override as well

Change is targeting meta-mingw repository. I looked at other files in the repo to see what the pattern is.

#5 lore raw
Quoted 7 lines · Sinan Kaya
Quoted 4 lines · Khem Raj
     +EXTRA_OECONF:append:class-nativesdk = " --disable-shared"

This is not an inert change can it use some mingw specific override as well

Change is targeting meta-mingw repository. I looked at other files in the repo to see what the pattern is.

All of the bbappends in meta-mingw should be using the :mingw32 override (or sdkmingw32 if it specific to just the SDK). If you found an example in the current code where that is not the case, it needs to be fixed. Either way, you need to use that override in your patches.