Skip to content

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

Closed
@mattoni

Description

@mattoni

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/github.jpy.wang-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/github.jpy.wang-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/github.jpy.wang-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions