square / subzero

Block's Bitcoin Cold Storage solution.
Apache License 2.0
681 stars 93 forks source link

build errors at core/ #132

Closed lcheng62 closed 4 years ago

lcheng62 commented 4 years ago

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.

alokmenghrajani commented 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.

lcheng62 commented 4 years ago

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

alokmenghrajani commented 4 years ago

I'll get a fresh laptop next week and see if I can repro / figure out what's going on.

alokmenghrajani commented 4 years ago

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.

alokmenghrajani commented 4 years ago

When you say vagrant mac build, is Mac OS X the host operating system? Are you running linux inside?

lcheng62 commented 4 years ago

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

!/usr/bin/env python3

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

alokmenghrajani commented 4 years ago

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/.

alokmenghrajani commented 4 years ago

I'm going to close this out. The most reliable way to build things is to use Docker.

lcheng62 commented 4 years ago

@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