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

tonic-build appears to fail if cmake isn't installed now #965

Closed
mattoni opened this issue Apr 5, 2022 · 1 comment
Closed

tonic-build appears to fail if cmake isn't installed now #965

mattoni opened this issue Apr 5, 2022 · 1 comment

Comments

@mattoni
Copy link

mattoni commented Apr 5, 2022

Bug Report

Version

0.7.0

Platform

Darwin lxm-26q7w9k 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

Crates

tonic-build

Description

When upgrading to tonic-build 0.7.0 from 0.6.2, I noticed my rust-analyzer triangle turn green. I couldn't get the error to appear so I ran cargo build and got this:

error: failed to run custom build command for `prost-build v0.10.0`

Caused by:
  process didn't exit successfully: `/Users/mattoni/Development/atp-api-gateway/target/debug/build/prost-build-629f54d1e80fb3a6/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/Users/mattoni/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/prost-build-0.10.0/third-party/protobuf/cmake
  CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-apple-darwin = None
  CMAKE_GENERATOR_aarch64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
  CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-apple-darwin = None
  CMAKE_aarch64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/Users/mattoni/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/prost-build-0.10.0/third-party/protobuf/cmake" "-DCMAKE_INSTALL_PREFIX=/Users/mattoni/Development/atp-api-gateway/target/debug/build/prost-build-f52ad246ec66a14d/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -arch arm64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /Users/mattoni/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Obviously, it's referring to cmake but that was never a requirement before.

As expected, after installing cmake, everything works fine. However I didn't see this requirement noted anywhere and wanted to flag it.

@LucioFranco
Copy link
Member

Correct, since tonic 0.7 upgraded prost to 0.10 https://github.com/tokio-rs/prost/releases/tag/v0.10.0 you either need to install protoc on your system or it will attempt to build it from source. I recommend installing protoc on your system via your package manager. (brew install protobuf works).

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

2 participants