1

I'm trying to build Polkadot as a relay chain for a tutorial but compiling one of its dependencies fails! I may be missing some tools. Could you help? Platform: MacOS (Intel)

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

Caused by:
  process didn't exit successfully: `<redacted_path>/polkadot/target/release/build/prost-build-c6015cab4894bbe1/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=<redacted_path>/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake
  CMAKE_TOOLCHAIN_FILE_x86_64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_x86_64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-apple-darwin = None
  CMAKE_GENERATOR_x86_64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-apple-darwin = None
  CMAKE_PREFIX_PATH_x86_64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-apple-darwin = None
  CMAKE_x86_64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "<redacted_path>/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake" "-Dprotobuf_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=<redacted_path>/polkadot/target/release/build/prost-build-330684d335a6d019/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-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', <redacted_path>/.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
warning: build failed, waiting for other jobs to finish...
error: build failed

I have previously built the substrate-node-template project successfully. From the error it looks like I have no cmake installed but I have installed the Apple's developers tools and in general I've used this machine for development, including compiling generic Rust code.

Any clues? Thanks!

6
  • 1
    Note I've also covered some of the Substrate tutorials prior to the one about starting my own relay chain (and connecting parachains to it) docs.substrate.io/tutorials/connect-other-chains/local-relay
    – stano
    Commented Jul 2, 2022 at 13:46
  • I also updated my rust toolchain to the latest version at time of writing and still no luck - 1.62.0 for stable and 1.64.0-nightly for nightly.
    – stano
    Commented Jul 2, 2022 at 13:55
  • 2
    Hi, can you try install cmake (e.g brew install cmake) and then should works.
    – pepoviola
    Commented Jul 2, 2022 at 14:43
  • Hi @pepoviola thank you for the suggestion! Do you have an idea why that changed in prost-build v0.10.4? I'm currently building the substrate-node-template without any issue and it successfully compiles prost-build v0.9.0. So I try to understand before installing additional tools
    – stano
    Commented Jul 2, 2022 at 14:53
  • To answer my own question - probably this commit in prost-build started requiring cmake - "build: Remove bundled protoc and build from source" github.com/tokio-rs/prost/commit/…
    – stano
    Commented Jul 2, 2022 at 15:00

2 Answers 2

4

Probably the most frictionless way to fix this is by installing cmake.


Alternatively, provide a pre-built protoc to the build process.

More context about prost:

PROST! a Protocol Buffers implementation for the Rust Language

Specifically,

prost-build makes it easy to generate Rust code from .proto files as part of a Cargo build

To compile prost-build you can either provide cmake or precompiled protoc. Luckily, the prost-build Readme links to the installation instructions of protoc where you can find a pre-build binary for your system.

Using this binary with an environment variable lets cargo build the dependency (prost-build) without having to also build protoc.

PROTOC=/path/to/protoc cargo build --release

1
0

This will fix by just installing c-make.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.