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

nativesdk-grpc build failed because protoc binary can't be find #759

Open
lihing1994 opened this issue Nov 14, 2023 · 4 comments
Open

nativesdk-grpc build failed because protoc binary can't be find #759

lihing1994 opened this issue Nov 14, 2023 · 4 comments

Comments

@lihing1994
Copy link

lihing1994 commented Nov 14, 2023

  • I was attempting to build a SDK with nativesdk-grpc added to TOOLCHAIN_HOST_TASK:append. However, the build failed because protoc was not found. I am using grpc_1.50.1 on the Mickledore branch.
| cd /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/protos && /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc --grpc_out=generate_mock_code=true:/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens --cpp_out=/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens --plugin=protoc-gen-grpc=/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot-native/usr/bin/grpc_cpp_plugin -I . -I /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include src/proto/grpc/channelz/channelz.proto
| /bin/sh: 1: /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc: not found
  • I noticed a commit that addresses this issue on the master branch. Is there a possibility to carry this fix in the grpc recipe for the Mickledore branch? I can confirm the building for the SDK is successes after I added D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \ to the EXTRA_OECMAKE in the grpc recipe.
@kraj
Copy link
Contributor

kraj commented Nov 14, 2023

@lihing1994
Copy link
Author

lihing1994 commented Nov 14, 2023

I attempted to apply this commit, which I believe contains the same fix as the one you provided in the link. But I don't think it really works.

Here is the compile error log

| FAILED: gens/src/proto/grpc/channelz/channelz.grpc.pb.cc gens/src/proto/grpc/channelz/channelz.grpc.pb.h gens/src/proto/grpc/channelz/channelz_mock.grpc.pb.h gens/src/proto/grpc/channelz/channelz.pb.cc gens/src/proto/grpc/channelz/channelz.pb.h /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens/src/proto/grpc/channelz/channelz.grpc.pb.cc /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens/src/proto/grpc/channelz/channelz.grpc.pb.h /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens/src/proto/grpc/channelz/channelz_mock.grpc.pb.h /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens/src/proto/grpc/channelz/channelz.pb.cc /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens/src/proto/grpc/channelz/channelz.pb.h
| cd /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/protos && /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc --grpc_out=generate_mock_code=true:/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens --cpp_out=/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/build/gens --plugin=protoc-gen-grpc=/build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot-native/usr/bin/grpc_cpp_plugin -I . -I /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/include src/proto/grpc/channelz/channelz.proto
| /bin/sh: 1: /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-grpc/1.50.1-r0/recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc: not found

@lihing1994
Copy link
Author

lihing1994 commented Nov 15, 2023

  • FYI. I also tried to upgrade the protobuf to latest version 4.23.4, but it seems like it requires latest version of grpc.
| In file included from /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-protobuf/4.23.4-r0/git/src/google/protobuf/extension_set.cc:55:
| /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-protobuf/4.23.4-r0/git/src/google/protobuf/port_def.inc:210:35: error: static assertion failed: Protobuf only supports Abseil version 20230125.3 and newer.
|   210 |   (ABSL_LTS_RELEASE_VERSION > (x) || \
|       |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
|   211 |    (ABSL_LTS_RELEASE_VERSION == (x) && ABSL_LTS_RELEASE_PATCH_LEVEL >= (y)))
|       |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| /build/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-protobuf/4.23.4-r0/git/src/google/protobuf/port_def.inc:219:15: note: in expansion of macro 'PROTOBUF_ABSL_MIN'
|   219 | static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
|       |               ^~~~~~~~~~~~~~~~~
| ninja: build stopped: subcommand failed.
| WARNING: exit code 1 from a shell command.
  • After upgrading both protobuf and grpc, the build still failed, indicating that it requires c++14 or newer. I have no idea what causing this issue. But I guess I need to check out master branch meta-clang instead of mickledore?

@AlexVRud
Copy link

AlexVRud commented Nov 24, 2023

Main branch have patch 54885a5

For Mickledore you can write grpc_1.50.1.bbappend:

# https://github.com/openembedded/meta-openembedded/commit/54885a5af2da26d7c84f8aff6fc845c2681b2890

EXTRA_OECMAKE = " \
    -DgRPC_CARES_PROVIDER=package \
    -DgRPC_ZLIB_PROVIDER=package \
    -DgRPC_SSL_PROVIDER=package \
    -DgRPC_PROTOBUF_PROVIDER=package \
    -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
    -DgRPC_ABSL_PROVIDER=package \
    -DgRPC_RE2_PROVIDER=package \
    -DgRPC_INSTALL=ON \
    -DCMAKE_CROSSCOMPILING=ON \
    -DgRPC_INSTALL_LIBDIR=${baselib} \
    -DgRPC_INSTALL_CMAKEDIR=${baselib}/cmake/${BPN} \
    "

dylan-matthew-turner pushed a commit to dylan-matthew-turner/meta-openembedded that referenced this issue Dec 6, 2023
This release contains bug fixes only.
The following CVEs have been addressed:

CVE-2023-27783
CVE-2023-27784
CVE-2023-27785
CVE-2023-27786
CVE-2023-27787
CVE-2023-27788
CVE-2023-27789

Changelog:
=========
dlt_jnpr_ether_cleanup: check subctx before cleanup by @Marsman1996 in openembedded#781
Bug openembedded#780 assert tcpedit dlt cleanup by @fklassen in openembedded#800
Fix bugs caused by strtok_r by @Marsman1996 in openembedded#783
Bug openembedded#782 openembedded#784 openembedded#785 openembedded#786 openembedded#787 openembedded#788 strtok r isuses by @fklassen in openembedded#801
Update en10mb.c by @david-guti in openembedded#793
PR openembedded#793 ip6 unicast flood by @fklassen in openembedded#802
Bug openembedded#719 fix overflow check for parse_mpls() by @fklassen in openembedded#804
PR openembedded#793 - update tests for corrected IPv6 MAC by @fklassen in openembedded#805
PR openembedded#793 - update tests for vlandel by @fklassen in openembedded#806
Feature openembedded#773 gh actions ci by @fklassen in openembedded#807
Feature openembedded#759: Upgrade autogen/libopts to 5.18.16 by @fklassen in openembedded#760
Bug openembedded#751 don't exit after send error by @fklassen in openembedded#761
Bug openembedded#750: configure: libpcap version robustness by @fklassen in openembedded#764
Bug openembedded#749 flow stats: avoid overstating flow packet count by @fklassen in openembedded#765
Bug openembedded#750 more libpcap version updates by @fklassen in openembedded#766
Bug openembedded#767 tests: support for out-of-tree tests by @fklassen in openembedded#768
Bug openembedded#750 - fix macOS test failure by @fklassen in openembedded#770
4.4.3 by @fklassen in openembedded#769 and openembedded#771

Signed-off-by: Archana Polampalli <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
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

No branches or pull requests

3 participants