rmrk-team/rmrk-substrate

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

bmacer opened this issue · 1 comments

Seems to have occurred after PR #182.

Happens on cargo build --release or cargo test or cargo test --workspace --all-features, though specific pallet testing like cargo test -p pallet-rmrk-core works fine.

Guessing it's some local problem maybe, because it seems the automated tests passed, which ran cargo test --workspace --all-features

Output:

   Compiling rmrk-substrate v4.0.0-dev (/Users/bmacer/rmrk/rmrk-substrate/node)
   Compiling prost-build v0.10.4
   Compiling tracing-subscriber v0.2.25
   Compiling tokio v1.19.2
   Compiling async-io v1.7.0
   Compiling trust-dns-resolver v0.21.2
   Compiling librocksdb-sys v0.6.1+6.28.2
   Compiling ed25519-dalek v1.0.1
   Compiling schnorrkel v0.9.1
   Compiling rw-stream-sink v0.3.0
   Compiling sc-utils v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.24#257cdb55)
error: failed to run custom build command for `prost-build v0.10.4`

Caused by:
  process didn't exit successfully: `/Users/bmacer/rmrk/rmrk-substrate/target/debug/build/prost-build-06b5dd7c58a2cff8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/Users/bmacer/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/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/bmacer/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake" "-Dprotobuf_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/bmacer/rmrk/rmrk-substrate/target/debug/build/prost-build-7ecae58ecdf16f31/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/bmacer/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Guess Google would've helped. Looks like an issue on Mac M1 processors: https://stackoverflow.com/questions/72061535/getting-this-error-message-while-installing-solana-error-failed-to-run-custom

This resolved it:

git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf

brew install autoconf
brew install automake
brew install Libtool

autoreconf -i
./autogen.sh
./configure
make
make check
sudo make install

export PATH=/opt/usr/local/bin:$PATH