Skip to content

prost-build fails to find cmake on macOS (M1) #645

@codemaster138

Description

@codemaster138

I'm trying to use a package that in turn uses prost-build (v0.10.3, current latest release), but cargo refuses to build it (see full error message at the end). I'm on a 2020 M1 MacBook Pro 13" running macOS Monterey (12.0.1)

The error message asks me to make sure cmake is installed, which, it is (cmake --version outputs cmake version 3.23.1). The only other reference to this problem I was able to find was this question on SO, which has no answers...

build failed
error: failed to run custom build command for `prost-build v0.10.3`
Caused by:
  process didn't exit successfully: `/Users/test/Desktop/projects/scratchpad/supercap/server/target/rls/debug/build/prost-build-7df80aee7bef1b3a/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/Users/test/.cargo/registry/src/mygithub.libinneed.workers.dev-1ecc6299db9ec823/prost-build-0.10.3/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/test/.cargo/registry/src/mygithub.libinneed.workers.dev-1ecc6299db9ec823/prost-build-0.10.3/third-party/protobuf/cmake" "-DCMAKE_INSTALL_PREFIX=/Users/test/Desktop/projects/scratchpad/supercap/server/target/rls/debug/build/prost-build-c9788f00ab3f6962/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/test/.cargo/registry/src/mygithub.libinneed.workers.dev-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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