build p2pd and run some client tests

(with `make V=0 test-libp2p-daemon`)
This commit is contained in:
Ștefan Talpalaru 2019-02-26 23:13:31 +01:00 committed by zah
parent a99b3f2096
commit 12d18a1fd6
6 changed files with 34 additions and 6 deletions

4
.gitignore vendored
View File

@ -6,6 +6,10 @@
# Nimble packages
/vendor/.nimble
# Go packages
/vendor/go
!/vendor/go/src/github.com/libp2p/go-libp2p-daemon
# ntags/ctags output
/tags

10
.gitmodules vendored
View File

@ -123,3 +123,13 @@
url = https://github.com/OpenSystemsLab/tempfile.nim.git
ignore = dirty
branch = master
[submodule "vendor/go/src/github.com/libp2p/go-libp2p-daemon"]
path = vendor/go/src/github.com/libp2p/go-libp2p-daemon
url = https://github.com/libp2p/go-libp2p-daemon.git
ignore = dirty
branch = master
[submodule "vendor/nim-libp2p"]
path = vendor/nim-libp2p
url = https://github.com/status-im/nim-libp2p.git
ignore = dirty
branch = master

View File

@ -137,7 +137,7 @@ test-reproducibility:
# usual cleaning
clean:
rm -rf build/{nimbus,premix,persist,debug,dumper,hunter,all_tests,beacon_node,validator_keygen,*.exe} \
rm -rf build/{nimbus,premix,persist,debug,dumper,hunter,all_tests,beacon_node,validator_keygen,*.exe} vendor/go/bin \
$(NIMBLE_DIR) $(NIM_BINARY) $(NIM_DIR)/nimcache nimcache
# dangerous cleaning, because you may have not-yet-pushed branches and commits in those vendor repos you're about to delete
@ -172,10 +172,6 @@ status: | $(REPOS)
$(eval CMD := $(GIT_STATUS))
$(RUN_CMD_IN_ALL_REPOS)
# https://bitbucket.org/nimcontrib/ntags/ - currently fails with "out of memory"
ntags:
ntags -R .
#- actually binaries, but have them as phony targets to force rebuilds
beacon_node validator_keygen: | build deps
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -o:build/$@ $(REPOS_DIR)/nim-beacon-chain/beacon_chain/$@.nim
@ -186,6 +182,19 @@ clean_eth2_network_simulation_files:
eth2_network_simulation: | beacon_node validator_keygen clean_eth2_network_simulation_files
SKIP_BUILDS=1 $(ENV_SCRIPT) $(REPOS_DIR)/nim-beacon-chain/tests/simulation/start.sh
vendor/go/bin/p2pd:
cd vendor/go/src/github.com/libp2p/go-libp2p-daemon && \
$(ENV_SCRIPT) $(MAKE)
test-libp2p-daemon: | vendor/go/bin/p2pd deps
cd vendor/nim-libp2p && \
$(ENV_SCRIPT) nim c -r $(NIM_PARAMS) tests/testdaemon.nim && \
rm -f tests/testdaemon
# https://bitbucket.org/nimcontrib/ntags/ - currently fails with "out of memory"
ntags:
ntags -R .
#- a few files need to be excluded because they trigger an infinite loop in https://github.com/universal-ctags/ctags
#- limiting it to Nim files, because there are a lot of C files we don't care about
ctags:

5
env.sh
View File

@ -7,8 +7,11 @@ uname | grep -qi mingw && PWD_CMD="pwd -W"
rel_path="$(dirname $0)"
abs_path="$(cd $rel_path; ${PWD_CMD})"
# used by libp2p/go-libp2p-daemon
export GOPATH="${abs_path}/vendor/go"
# make it an absolute path, so we can call this script from other dirs
export PATH="${abs_path}/vendor/Nim/bin:$PATH"
export PATH="${abs_path}/vendor/Nim/bin:${GOPATH}/bin:${PATH}"
# Nimble needs this to be an absolute path
export NIMBLE_DIR="${abs_path}/vendor/.nimble"

@ -0,0 +1 @@
Subproject commit de7ca070e6f487655d787d82d819e70ca96ada2d

1
vendor/nim-libp2p vendored Submodule

@ -0,0 +1 @@
Subproject commit cb334cc8ab186496d8b73d5a2fe1b6298598b7f6