tikv / grpc-rs

The gRPC library for Rust built on C Core library and futures
Apache License 2.0
1.81k stars 253 forks source link

Cmake error when trying to use grpcio with 0.13.0 #633

Closed NathanielPrescott closed 1 year ago

NathanielPrescott commented 1 year ago

Hey I was trying to switch over my grpc from using tonic to this and have been getting build errors. My cargo.toml looks like this with the new changes:

image

The below is the error:

error: failed to run custom build command for `grpcio-sys v0.13.0+1.56.2-patched`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
  process didn't exit successfully: `/home/nprescott/Documents/Projects/Performance/gRPCvREST/service/target/debug/build/grpcio-sys-4225ba95444ad0a8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=grpc_wrap.cc
  cargo:rerun-if-changed=grpc
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=GRPCIO_SYS_USE_PKG_CONFIG
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=CARGO_CFG_TARGET_OS
  cargo:rerun-if-env-changed=CXX
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: cd "/home/nprescott/Documents/Projects/Performance/gRPCvREST/service/target/debug/build/grpcio-sys-cbcc45eb86378ff2/out/boringssl-build/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/nprescott/.cargo/registry/src/index.crates.io-6f17d22bba15001f/boringssl-src-0.6.0+e46383f/boringssl" "-DCMAKE_INSTALL_PREFIX=/home/nprescott/Documents/Projects/Performance/gRPCvREST/service/target/debug/build/grpcio-sys-cbcc45eb86378ff2/out/boringssl-build" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"
  -- Configuring incomplete, errors occurred!
  --- stderr
  CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1
  build script failed, must exit now', /home/nprescott/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
     1: core::panicking::panic_fmt
               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
     2: cmake::fail
     3: cmake::run
     4: cmake::Config::build
     5: boringssl_src::Build::build
     6: build_script_build::build_boringssl
     7: build_script_build::build_grpc
     8: build_script_build::main
     9: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
Process finished with exit code 101

I've tried with the grpcio-sys version installed and it still gives the same error. Not sure if I am missing something since the example listed is using grpcio version 0.6.0 and having found any newer examples. Also the cmake version I have installed is 3.27.6, though it looks like its pointing to a dependency crate. Let me know if there are any other examples I should check out or if this is an actual issue with grpcio.

BusyJay commented 1 year ago

Make sure you have installed make and g++. You can also check the pre-requisites here. https://github.com/grpc/grpc/blob/master/BUILDING.md#pre-requisites

NathanielPrescott commented 1 year ago

I'll probably come back to try this later, thanks for the info and help!