0

I'm trying to compile a local Substrate node and receive the following :

caladay@LAPTOP-GTIDPPCA:~/substrate-node-template$ cargo build --release
   Compiling librocksdb-sys v0.8.0+7.4.4
   Compiling sc-network-bitswap v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.32#5ea6d953)
error: failed to run custom build command for `sc-network-bitswap v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.32#5ea6d953)`

Caused by:
  process didn't exit successfully: `/home/caladay/substrate-node-template/target/release/build/sc-network-bitswap-358d1cd360199f79/build-script-build` (exit status: 101)
  --- stdout
  Running: "/usr/bin/protoc" "--include_imports" "--include_source_info" "-o" "/tmp/prost-build2QKUaS/prost-descriptor-set" "-I" "src/schema" "bitswap.v1.2.0.proto"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: bitswap.v1.2.0.proto: No such file or directory\n" }', /home/caladay/.cargo/git/checkouts/substrate-7e08433d4c370a21/5ea6d95/client/network/bitswap/build.rs:4:58
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: snappy/snappy.cc:1033:36: error: invalid output constraint '=@ccz' in asm
warning:       : [tag_type] "+r"(tag_type), "=@ccz"(is_literal));
warning:                                    ^
warning: 1 error generated.

error: failed to run custom build command for `librocksdb-sys v0.8.0+7.4.4`

I tried to install clang (as metioned here). Do you have any suggestions ?

As suggested by @AurevoirXavier I installed g++. It seems that it was already installed but the error message evolved:

caladay@LAPTOP-GTIDPPCA:~/substrate-node-template$ cargo build --release
   Compiling sc-network-bitswap v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.32#5ea6d953)
   Compiling kvdb-rocksdb v0.16.0
error: failed to run custom build command for `sc-network-bitswap v0.10.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.32#5ea6d953)`

Caused by:
  process didn't exit successfully: `/home/caladay/substrate-node-template/target/release/build/sc-network-bitswap-358d1cd360199f79/build-script-build` (exit status: 101)
  --- stdout
  Running: "/usr/bin/protoc" "--include_imports" "--include_source_info" "-o" "/tmp/prost-build3AYt6r/prost-descriptor-set" "-I" "src/schema" "bitswap.v1.2.0.proto"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: bitswap.v1.2.0.proto: No such file or directory\n" }', /home/caladay/.cargo/git/checkouts/substrate-7e08433d4c370a21/5ea6d95/client/network/bitswap/build.rs:4:58
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Rust toolchain:

caladay@LAPTOP-GTIDPPCA:~/substrate-node-template$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/caladay/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.65.0 (897e37553 2022-11-02)

3 Answers 3

0

Did you install the g++? I think librocksdb-sys requires g++.

5
  • It seems to me that it was already installed. I still launched sudo apt install g++ (0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded). But somehow the error message evolved (see the update above)
    – Caladay
    Nov 19, 2022 at 10:12
  • How about apt install protobuf-compiler? Nov 19, 2022 at 13:45
  • it is already installed.
    – Caladay
    Nov 19, 2022 at 14:08
  • Maybe it wasn't in your $PATH? Nov 19, 2022 at 15:52
  • if I'm not mistaken the protoc file is stored under /usr/bin which is included in my PATH variable.
    – Caladay
    Nov 20, 2022 at 8:50
0

As mentioned in the logs there you need protoc. see the deps needed here https://docs.substrate.io/install/linux/

If a Debian based distribution, you likely need

sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler

protoc is part of protobuf-compiler

5
  • As I'm on windows, I followed this setup: docs.substrate.io/install/windows (i.e. it seems similar to the linux one except I had to install wls). It is installed: protoc --version --> libprotoc 3.0.0
    – Caladay
    Nov 19, 2022 at 14:13
  • And its working? Perhaps a PR is needed upstream on the windows install instruction?
    – Nuke
    Nov 19, 2022 at 21:32
  • Not sure I understand you. I installed protoc on windows, with the same result.
    – Caladay
    Nov 21, 2022 at 5:43
  • If there was something that resolved this that you could identify as missing in the installation instructions, those should be updated.
    – Nuke
    Nov 22, 2022 at 5:30
  • Seems though that its unclear what the issue was from your answer. So we will see if others hit the same snag and help us find the issue
    – Nuke
    Nov 22, 2022 at 5:31
0

I uninstalled Ubuntu and wls and reinstalled it from the Microsoft store and somehow it now works. So if anyone is experiencing a similar problem I would suggest doing the same. Thank you @AurevoirXavier and @DanShields for your help.

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.