Closed lcheng62 closed 4 years ago
Did you git clone recursively? The project has two submodules. It's quite common to forget to clone the submodules and then end up with missing directories.
yes I did followed the steps of https://subzero.readthedocs.io/en/master/running_without_hsm/ and included "recursive" at git clone. Below is my last few commands in history which exactly matched the instruction.
$ make [ 1%] Generating ../nanopb/generator/nanopb_generator.py, ../nanopb/generator/proto/nanopb.proto, ../nanopb/generator/proto/plugin.proto [ 2%] Generating ../nanopb/generator/proto/plugin_pb2.py /Users/vagrant/work/test3/subzero/core/build/nanopb/generator/proto: warning: directory does not exist. Could not make proto path relative: /Users/vagrant/work/test3/subzero/core/build/nanopb/generator/proto/plugin.proto: No such file or directory make[2]: [nanopb/generator/proto/plugin_pb2.py] Error 1 make[1]: [proto/CMakeFiles/SubzeroProtos.dir/all] Error 2 make: *** [all] Error 2 $ history | tail 253 git clone --recursive https://github.com/square/subzero.git 254 cd subzero/ 255 cd java/ 256 mvn package 257 cd ../core/ 258 mkdir build 259 cd build/ 260 TARGET=dev CURRENCY=btc-testnet cmake ../ 261 make 262 history | tail
I'll get a fresh laptop next week and see if I can repro / figure out what's going on.
Can you please try to change #!/usr/bin/env python
to #!/usr/bin/env python3
at the top of core/build/nanopb/generator/nanopb_generator.py? I'm unable to reproduce this exact issue, but I did notice that we are using python in some cases and we are probably better off always using python3.
When you say vagrant mac build, is Mac OS X the host operating system? Are you running linux inside?
I'm using a mac OS as vagrant virtualbox under a mac OS machine. I still got the same error as below. BTW, I managed to build this project with a Linux ubuntu 18. But I'd be interested to see it works for mac.
This-MacBook-Pro:build vagrant$ head -n 5 nanopb/generator/nanopb_generator.py
from future import unicode_literals
'''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.''' This-MacBook-Pro:build vagrant$ make [ 1%] Generating ../nanopb/generator/proto/plugin_pb2.py Could not make proto path relative: /Users/vagrant/work/test4/subzero/core/build/nanopb/generator/proto/plugin.proto: No such file or directory make[2]: [nanopb/generator/proto/plugin_pb2.py] Error 1 make[1]: [proto/CMakeFiles/SubzeroProtos.dir/all] Error 2 make: *** [all] Error 2
Sorry, I don't know what's going on. Feel free to open a PR if you are able to fix the build. https://github.com/nanopb/nanopb/blob/master/README.md might be a good place to start?
You might also have better luck using a pre-built nanopb binary from https://jpa.kapsi.fi/nanopb/download/.
I'm going to close this out. The most reliable way to build things is to use Docker.
@alokmenghrajani Happy 2020! Sorry for the late response. Here is my procedure of building subzero at ubuntu18. Feel free to edit it and copy it to the project README or maybe subzero document at https://subzero.readthedocs.io/en/master/, such that the Linux users can also have a quick reference for installation and get benefit from subzero.
sudo apt-get update
sudo apt-get install openssh-server
sudo apt-get install autoconf automake libtool curl make cmake g++ unzip python
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
tar -xzvf protobuf-all-3.6.1.tar.gz
cd protobuf-3.6.1/
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version
cd ..
git clone --recursive https://github.com/square/subzero.git
cd subzero/
cd core/
mkdir build
cd build/
sudo apt-get install python-protobuf
nano ~/.bashrc
# add this line at the top of ~/.bashrc -> alias python=python3
source ~/.bashrc
sudo apt install python-pip
pip install google.cloud.bigquery
pip install google.cloud.storage
TARGET=dev CURRENCY=btc-testnet cmake ../
make
I followed the steps below based on https://subzero.readthedocs.io/en/master/running_without_hsm/:
The final "make" command failed with some directory missing errors.
build the C code, using testnet transactions.
cd ../core mkdir build cd build TARGET=dev CURRENCY=btc-testnet cmake ../ make
This-MacBook-Pro:build vagrant$ make [ 1%] Generating ../nanopb/generator/proto/plugin_pb2.py /Users/vagrant/work/test2/subzero/core/build/nanopb/generator/proto: warning: directory does not exist. Could not make proto path relative: /Users/vagrant/work/test2/subzero/core/build/nanopb/generator/proto/plugin.proto: No such file or directory make[2]: [nanopb/generator/proto/plugin_pb2.py] Error 1 make[1]: [proto/CMakeFiles/PlutusProtos.dir/all] Error 2 make: *** [all] Error 2
I also tried the solution of https://github.com/square/subzero/issues/35,
git fetch origin pull/37/head:pull_37 git checkout pull_37 git submodule update --init --recursive
However, it doesn't help.
I'm not using docker build. It is just a vagrant mac build.
Hope someone can help.