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

Cannot find the binary path

Open Kaleb47 opened this issue 2 years ago • 4 comments

So I cd in a file directory called data_structures, run cargo build and I get this error.

 Compiling witnet_data_structures v0.3.2 (/Users/kalebamarante/witnet-rust/data_structures)
error: failed to run custom build command for `witnet_data_structures v0.3.2 (/Users/kalebamarante/witnet-rust/data_structures)`

Caused by:
  process didn't exit successfully: `/Users/kalebamarante/witnet-rust/target/debug/build/witnet_data_structures-767d9cb39346f6d8/build-script-build` (exit status: 101)
  --- stdout
  cargo:protos=/Users/kalebamarante/witnet-rust/data_structures/../schemas/witnet

  --- stderr
  thread 'main' panicked at 'protoc binary not found: cannot find binary path', /Users/kalebamarante/.cargo/registry/src/github.com-1ecc6299db9ec823/protoc-2.27.1/src/lib.rs:209:17
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I opened the lib.rs and took me to this code.

impl Protoc {
    /// New `protoc` command from `$PATH`
    pub fn from_env_path() -> Protoc {
        match which::which("protoc") {
            Ok(path) => Protoc {
                exec: path.into_os_string(),
            },
            Err(e) => {
                panic!("protoc binary not found: {}", e);
            }
        }
    }

I know syntactically the code makes sense. To make sure this was not an ARM64 conflict, I ran the code in gitpod and got the same error. My colleague ran the same code and got the same error.

Kaleb47 avatar Mar 15 '22 22:03 Kaleb47

Did you install all dependencies as per the docs? It looks like you don't have the protobuf compiler installed.

drcpu-github avatar Mar 16 '22 07:03 drcpu-github

Hi @Kaleb47 you are most likely missing the Protobuf compiler as a dynamic dependency.

That is, you need to install it in your system. It is called protobuf-compiler or protoc on most GNU/Linux distros and protobuf on MacOS.

Please let me know if that solves the issue for you!

aesedepece avatar Mar 16 '22 09:03 aesedepece

Hi @Kaleb47 you are most likely missing the Protobuf compiler as a dynamic dependency.

That is, you need to install it in your system. It is called protobuf-compiler or protoc on most GNU/Linux distros and protobuf on MacOS.

Please let me know if that solves the issue for you!

Ok I installed but when trying to run the genesis block I get this error

[2022-03-16T17:31:17Z ERROR witnet_node::actors::chain_manager::actor] Failed to create genesis block: Failed to read file `.witnet/config/genesis_block.json`: No such file or directory (os error 2)
[2022-03-16T17:31:17Z ERROR witnet_node::actors::chain_manager::actor] Genesis block could be downloaded in: https://github.com/witnet/genesis_block
Error: Non-zero exit code: 1

Same thing happens when I try to run the node.

I even ran through the same process in a linux virtual environment I have and still got the same error.

Kaleb47 avatar Mar 16 '22 17:03 Kaleb47

@Kaleb47 you need to download the genesis block file from here: https://raw.githubusercontent.com/witnet/genesis_block/master/latest/genesis_block.json

And then put it in the specified location (.witnet/config/genesis_block.json). You can also change that location by editing the witnet.toml configuration file

aesedepece avatar Mar 17 '22 12:03 aesedepece