rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Cannot compile the tutorial

Open MerryPoppins92 opened this issue 3 years ago • 1 comments

I have this message when I try to run the tutorial

RUST_LOG=debug cargo build --example relay_v2 -p libp2p-relay
error: failed to run custom build command for `libp2p-core v0.36.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\core)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-core-2ff3ce83088b38c2\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `libp2p-relay v0.12.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\protocols\relay)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-relay-06d8a401ea972102\build-script-build` (exit code: 101)  
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `libp2p-identify v0.39.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\protocols\identify)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-identify-76c281fb8efbcf72\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `libp2p-plaintext v0.36.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\transports\plaintext)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-plaintext-d15b0e5e4c3eb5df\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `libp2p-noise v0.39.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\transports\noise)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-noise-349170bbfd1639a7\build-script-build` (exit code: 101)  
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `libp2p-kad v0.40.0 (C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\protocols\kad)`

Caused by:
  process didn't exit successfully: `C:\Users\Merry de Lassus\Documents\rust\rust-libp2p\target\debug\build\libp2p-kad-363ebb567240d52b\build-script-build` (exit code: 101)    
  --- stderr
  thread 'main' panicked at '
  Could not find `protoc` installation and this build crate cannot proceed without
  this knowledge. If `protoc` is installed and this crate had trouble finding
  it, you can set the `PROTOC` environment variable with the specific path to your
  installed `protoc` binary.

  For more information: https://docs.rs/prost-build/#sourcing-protoc
  ', C:\Users\Merry de Lassus\.cargo\registry\src\github.com-1ecc6299db9ec823\prost-build-0.11.1\src\lib.rs:1227:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

MerryPoppins92 avatar Sep 12 '22 10:09 MerryPoppins92

Have you read the error message? :) It tells you what the problem is:

Could not find protoc installation and this build crate cannot proceed without this knowledge. If protoc is installed and this crate had trouble finding it, you can set the PROTOC environment variable with the specific path to your installed protoc binary.

There is a relevant discussion here: https://github.com/libp2p/rust-libp2p/issues/2645

thomaseizinger avatar Sep 14 '22 03:09 thomaseizinger

Closing here. @MerryPoppins92 please comment in case you need more help.

mxinden avatar Oct 05 '22 20:10 mxinden