exonum / exonum

An extensible open-source framework for creating private/permissioned blockchain applications

Home Page:https://exonum.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failed: blockchain.proto:15:10: Unrecognized syntax identifier "proto3". This parser only recognizes "proto2".

maxcado opened this issue · comments

Running Ubuntu 16.04 and have libprotoc 2.6.1 installed. Trying to install version 0.12.1 and get the following build error:

paused by: process didn't ext successfully: in exonum/target/debug/build/exonum-8a157b1751c8ddfe/build-script-build (exit code: 101)
--- stdout
cargo::protos=/exonum/src/proto/schema/exonum
-- stderr
Blockchain.proto:15:10: Unrecognized syntax identifier "proto3". This parser only recognizes "proto2".
Thread 'main' panicked at 'protoc: Custom [ kind: Other, error: StringError("protoc ("protoc" ........

How to reconcile this build error?

libprotoc 2.6.1 is too old.
The least supported version is 3.6.1.

You should add external apt repository and re-install libprotobuf-dev:

sudo add-apt-repository ppa:maarten-fonville/protobuf
sudo apt-get update
sudo apt-get install libprotobuf-dev --reinstall

So this is what I've done so far. I removed v. 0.12.1 and downloaded v. 0.13.0-rc.2. I manually installed protobuf from github.com/protocolbuffers/protobuf following the installation instructions there. But upon checking the version of protoc I got libprotoc 2.6.1. Finally rectified this issue by following the suggestion at protocolbuffers/protobuf#3102 in which changing the export in the etc/bash.bashrc file for me worked. So this is what worked in the etc/bash.bashrc file:

export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6

Then, upon checking protoc --version I got the right version of protoc 3.6.1.

Now, however, there is another issue involving exonum_sodiumoxide and the proper version of it. I download the exonum_sodiumoxide file from github.com/exonum/exonum_sodiumoxide. I installed libsodium-dev and libsodium23 from the Ubunutu repository with sudo apt-get install. I go into the exonum_sodiumoxide directory and type cargo build and get:

error: failed to select a version for 'exonum_libsodium-sys'.
....required by package 'exonum_sodiumoxide v0.0.23'
...which is depended on by 'exonum v0.13.0-rc.2 (/mnt/c/wallets/exonum-0.13.0.rc.2/exonum)'
...which is depended on by 'exonum-cli v0.13.0-rc.2 (/mnt/c/wallets/exonum-0.13.0-rc.2/cli)'
...which is depended on by 'exonum-cryptocurrency-advanced v0.13.0-rc.2 (/mnt/c/wallets/exonum-0.13.0-rc.2/examples/cryptocurrency-advance/backend)'
versions that meet the requirements '^0.0.23' are: 0.0.23
the package 'exonum_libsodium-sys' links to the native library 'sodium', but it conflicts with a previous package which links to 'sodium' as well:
package 'exonum_libsodium-sys v 0.0.23 (/mnt/c/wallets/exonum-0.13.0-rc.2/exonum_sodiumoxide/libsodium-sys)'
...which is depended on by 'exonum_sodiumoxide v0.0.23 (/mnt/c/wallets/exonum-0.13.0-rc.2/exonum_sodiumoxide)'
failed to select a version for 'exonum_libsodium-sys' which could resolve this conflict.

How to rectify?

What is your goal ? Why did you download exonum_sodiumoxide ? The error message is weird because exonum_sodiumoxide doesn't depend on exonum v0.13.0-rc.2.

Initially, trying to install the main package of the program but when I do cargo test -p exonum there were errors about exonum_sodiumoxide so I presumed that it must be installed as well. I'm new to the RUST language. I just want to utilize the library and create a wallet.

There is no need in installing Rust dependencies manually, Cargo will compile and install them appropriately. You can consult travis.yml file for package names. Make sure you followed our installation instruction