From 75f99491708a454affc005d42cd69caa81cf5055 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 19:04:21 -0400 Subject: [PATCH 01/96] [make] refs #51 Update some makefile targets --- .travis.yml | 5 ++--- Makefile | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95f36ec25..88ae01822 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,13 +32,12 @@ install: - go get -t ./... - make install-linters - VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" && mkdir ${DEPS_DIR} && cd ${DEPS_DIR} && travis_retry wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH && cd ${TRAVIS_BUILD_DIR}; fi - make install-deps-libc - - make install-lib-curl + - make install-deps-skyapi script: - make check notifications: email: false - webhooks: https://fathomless-fjord-24024.herokuapp.com/notify \ No newline at end of file + webhooks: https://fathomless-fjord-24024.herokuapp.com/notify diff --git a/Makefile b/Makefile index e8722faad..4ef8b6cde 100644 --- a/Makefile +++ b/Makefile @@ -166,16 +166,25 @@ install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/golangci/golangci-lint/cmd/golangci-lint VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh -install-deps-libc: install-deps-libc-$(OSNAME) install-libraries-deps +install-deps-skyapi-Linux: + sudo add-apt-repository ppa:george-edison55/cmake-3.x + sudo apt-get update + sudo apt-get install cmake + +install-deps-skyapi-Darwin: + brew install curl + brew install cmake + ls + +install-deps-libc: install-deps-libc-$(OSNAME) + +install-deps-skyapi: install-deps-skyapi-$(OSNAME) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz tar -xzf check-0.12.0.tar.gz cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install -install-lib-curl: ## Install Sky Api curl based rest wrapper - bash .travis/install_lib_curl.sh - install-deps-libc-osx: configure-build ## Install locally dependencies for testing libskycoin brew install check From 3ccf67411d003af65b52e9ada1138f571ef422c3 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 19:37:27 -0400 Subject: [PATCH 02/96] [make] refs #151 Added build target to makefile --- Makefile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 4ef8b6cde..35ce90325 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,11 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C client libraries build-libc: configure-build build-libc-static build-libc-shared +build-skyapi: ## Build skyapi(libcurl based) library + bash .travis/install_lib_curl.sh + +build: build-libc build-skyapi ## Build libraries + ## Build libskycoin C client library and executable C test suites ## with debug symbols. Use this target to debug the source code ## with the help of an IDE @@ -115,6 +120,8 @@ test-libc: build-libc ## Run tests for libskycoin C client library $(LDPATHVAR)="$(LDPATH):$(BUILD_DIR)/usr/lib:$(BUILDLIB_DIR)" $(BIN_DIR)/test_libskycoin_shared $(LDPATHVAR)="$(LDPATH):$(BUILD_DIR)/usr/lib" $(BIN_DIR)/test_libskycoin_static +test-skyapi: build-skyapi ## Run test for skyapi(libcurl based) library + docs-libc: doxygen ./.Doxyfile moxygen -o $(LIBDOC_DIR)/API.md $(LIBDOC_DIR)/xml/ @@ -133,7 +140,7 @@ lint-libc: format-libc clang-tidy lib/cgo/tests/*.c -- $(LIBC_FLAGS) -Wincompatible-pointer-types -check: lint test-libc lint-libc ## Run tests and linters +check: lint test-libc lint-libc test-skyapi ## Run tests and linters install-linters-Linux: ## Install linters on GNU/Linux sudo apt-get install $(PKG_CLANG_FORMAT) @@ -151,14 +158,6 @@ install-deps-Linux: ## Install deps on GNU/Linux install-deps-Darwin: ## Install deps on Mac OSX brew install $(PKG_LIB_TEST) -install-libraries-deps: ## Install deps on GNU/Linux - if [[ "$(UNAME_S)" == "Linux" ]]; then (cd build && wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=$(pwd)/build/cmake-install:$(pwd)/build/cmake-install/bin:$PATH ) ; fi - (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) - if [[ "$(UNAME_S)" == "Darwin" ]]; then brew install curl ; fi - # install uncrustify - (cd build && git clone https://github.com/uncrustify/uncrustify.git) - (cd build/uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) - install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/FiloSottile/vendorcheck # For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install @@ -167,18 +166,20 @@ install-linters: install-linters-$(UNAME_S) ## Install linters VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh install-deps-skyapi-Linux: - sudo add-apt-repository ppa:george-edison55/cmake-3.x + sudo add-apt-repository ppa:george-edison55/cmake-3.x -y sudo apt-get update sudo apt-get install cmake + sudo apt-get install libcurl3-gnutls install-deps-skyapi-Darwin: - brew install curl brew install cmake - ls + brew install curl install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(OSNAME) +# (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) + (cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz From 9179d0dbe6311b2890ce545f5d11b5dd4f2e4dfd Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 20:13:06 -0400 Subject: [PATCH 03/96] [ci] refs #51 Rename installation deps in makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 35ce90325..d90c11511 100644 --- a/Makefile +++ b/Makefile @@ -165,13 +165,13 @@ install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/golangci/golangci-lint/cmd/golangci-lint VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh -install-deps-skyapi-Linux: +install-deps-skyapi-linux: sudo add-apt-repository ppa:george-edison55/cmake-3.x -y sudo apt-get update sudo apt-get install cmake sudo apt-get install libcurl3-gnutls -install-deps-skyapi-Darwin: +install-deps-skyapi-osx: brew install cmake brew install curl From 48391fccf8ee4233773bc1dc8fef4e9b34f161ae Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 20:37:15 -0400 Subject: [PATCH 04/96] [ci] refs #51 Updated brew install of cmake --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d90c11511..a6c31eec4 100644 --- a/Makefile +++ b/Makefile @@ -172,8 +172,8 @@ install-deps-skyapi-linux: sudo apt-get install libcurl3-gnutls install-deps-skyapi-osx: - brew install cmake - brew install curl + brew list cmake || brew install cmake + brew list curl || brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From 883ee749eed3e125fd3d7f590f0678c82714841b Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 21:09:12 -0400 Subject: [PATCH 05/96] [make] refs #51 Change UNAME_S for OSNAME in makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a6c31eec4..b2eebf7dc 100644 --- a/Makefile +++ b/Makefile @@ -165,19 +165,19 @@ install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/golangci/golangci-lint/cmd/golangci-lint VERSION=1.10.2 ./ci-scripts/install-golangci-lint.sh -install-deps-skyapi-linux: +install-deps-skyapi-Linux: sudo add-apt-repository ppa:george-edison55/cmake-3.x -y sudo apt-get update sudo apt-get install cmake sudo apt-get install libcurl3-gnutls -install-deps-skyapi-osx: +install-deps-skyapi-Darwin: brew list cmake || brew install cmake brew list curl || brew install curl install-deps-libc: install-deps-libc-$(OSNAME) -install-deps-skyapi: install-deps-skyapi-$(OSNAME) +install-deps-skyapi: install-deps-skyapi-$(UNAME_S) # (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) (cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) From f09948024083729559127c9eafbf28cf61db56bc Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 21:19:37 -0400 Subject: [PATCH 06/96] [make] refs #51 Added targets to .PHONY and test --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b2eebf7dc..78cc69dcd 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .DEFAULT_GOAL := help -.PHONY: test-libc test-lint build-libc check +.PHONY: test-libc test-lint build-libc check build build-skyapi test-skyapi .PHONY: install-linters format clean-libc format-libc lint-libc COIN ?= skycoin @@ -122,6 +122,8 @@ test-libc: build-libc ## Run tests for libskycoin C client library test-skyapi: build-skyapi ## Run test for skyapi(libcurl based) library +test: test-libc test-skyapi ## Run all test for libskycoin + docs-libc: doxygen ./.Doxyfile moxygen -o $(LIBDOC_DIR)/API.md $(LIBDOC_DIR)/xml/ From cfe4f578a36150dae94059380f0dd08780060fff Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 21:22:19 -0400 Subject: [PATCH 07/96] [ci] refs #51 Pull apart check command in travis --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 88ae01822..e5f479079 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,10 @@ install: - make install-deps-skyapi script: - - make check + - make lint + - make test-libc + - make lint-libc + - make test-skyapi notifications: email: false From c4b78d0ba87ce24fcc55f161f24e57737bb17069 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 21:35:20 -0400 Subject: [PATCH 08/96] [ci] refs #51 Refactor install_lib_curl.sh --- Makefile | 2 +- {.travis => lib/curl}/install_lib_curl.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {.travis => lib/curl}/install_lib_curl.sh (100%) diff --git a/Makefile b/Makefile index 78cc69dcd..7ae845f9d 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so build-libc: configure-build build-libc-static build-libc-shared build-skyapi: ## Build skyapi(libcurl based) library - bash .travis/install_lib_curl.sh + bash lib/curl/install_lib_curl.sh build: build-libc build-skyapi ## Build libraries diff --git a/.travis/install_lib_curl.sh b/lib/curl/install_lib_curl.sh similarity index 100% rename from .travis/install_lib_curl.sh rename to lib/curl/install_lib_curl.sh From d2ae295abc643d1d482da0c7d4dabc1a0ebe7d95 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 21:59:22 -0400 Subject: [PATCH 09/96] [git] refs #51 Solve merge issues --- Makefile | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Makefile b/Makefile index 7c4604b9d..8b6a325ae 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,6 @@ .DEFAULT_GOAL := help -<<<<<<< HEAD .PHONY: test-libc test-lint build-libc check build build-skyapi test-skyapi -.PHONY: install-linters format clean-libc format-libc lint-libc -======= -.PHONY: test-libc test-lint build-libc check .PHONY: install-linters format clean-libc format-libc lint-libc docs ->>>>>>> origin/v0.25dev COIN ?= skycoin @@ -169,17 +164,6 @@ install-deps-Linux: ## Install deps on GNU/Linux install-deps-Darwin: ## Install deps on Mac OSX brew install $(PKG_LIB_TEST) -<<<<<<< HEAD -======= -install-libraries-deps: ## Install deps for lib\curl wrapper of Skycoin REST API - if [[ "$(UNAME_S)" == "Linux" ]]; then (cd build && wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=$(pwd)/build/cmake-install:$(pwd)/build/cmake-install/bin:$PATH ) ; fi - (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) - if [[ "$(UNAME_S)" == "Darwin" ]]; then brew install curl ; fi - # install uncrustify - (cd build && git clone https://github.com/uncrustify/uncrustify.git) - (cd build/uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) - ->>>>>>> origin/v0.25dev install-linters: install-linters-$(UNAME_S) ## Install linters go get -u github.com/FiloSottile/vendorcheck # For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install From 88482dc9653456de8d9299b6414b3154b14d6f14 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sat, 18 May 2019 22:12:18 -0400 Subject: [PATCH 10/96] [make] refs #51 Change library isntallation --- Makefile | 2 +- lib/curl/install_lib_curl.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 lib/curl/install_lib_curl.sh diff --git a/Makefile b/Makefile index 8b6a325ae..a826c0320 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so build-libc: configure-build build-libc-static build-libc-shared build-skyapi: ## Build skyapi(libcurl based) library - bash lib/curl/install_lib_curl.sh + ./lib/curl/install_lib_curl.sh build: build-libc build-skyapi ## Build libraries diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh old mode 100644 new mode 100755 From 88c5352b34e6240ed75000e08dfcbe6d36cdfa31 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sun, 19 May 2019 20:10:05 -0400 Subject: [PATCH 11/96] [docs] refs #51 Adding some make targets to README --- Makefile | 3 +-- README.md | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a826c0320..6097c3b33 100644 --- a/Makefile +++ b/Makefile @@ -183,8 +183,7 @@ install-deps-skyapi-Darwin: install-deps-libc: install-deps-libc-$(OSNAME) -install-deps-skyapi: install-deps-skyapi-$(UNAME_S) -# (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) +install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. (cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin diff --git a/README.md b/README.md index 922574e74..64843b296 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,8 @@ After that, run `make docs` for a new docs generation. You can found the api doc |install-linters-Darwin |Install linters on Mac OSX| |install-deps-Linux |Install deps on GNU/Linux| |install-deps-Darwin |Install deps on Mac OSX| -|install-libraries-deps |Install deps for `lib\curl` wrapper of Skycoin REST API| |install-linters |Install linters| |install-deps-libc-linux |Install locally dependencies for testing libskycoin| -|install-lib-curl |Install Sky Api curl based rest wrapper| |install-deps-libc-osx |Install locally dependencies for testing libskycoin| |format |Formats the code. Must have goimports installed (use make install-linters).| |clean-libc |Clean files generate by library| From f706e7f5bdd024d90e2667c03478eb7647b89986 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sun, 19 May 2019 20:22:16 -0400 Subject: [PATCH 12/96] [docs] refs #51 Added final targets to README --- Makefile | 2 -- README.md | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 63da88fa5..3badb7641 100644 --- a/Makefile +++ b/Makefile @@ -99,8 +99,6 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries -build: build-libc ## Build all C libraries - build-skyapi: ## Build skyapi(libcurl based) library ./lib/curl/install_lib_curl.sh diff --git a/README.md b/README.md index 78787789b..ea4ea4a94 100644 --- a/README.md +++ b/README.md @@ -149,8 +149,11 @@ After that, run `make docs` for a new docs generation. You can found the api doc |build-libc-static |Build libskycoin C static library| |build-libc-shared |Build libskycoin C shared library| |build-libc |Build libskycoin C client libraries| -|build |Build all C libraries +|build-skyapi |Build skyapi(libcurl based) library| +|build |Build libraries| |test-libc |Run tests for libskycoin C client library| +|test-skyapi |Run test for skyapi(libcurl based) library| +|test |Run all test for libskycoin| |docs |Generate documentation for all libraries| |docs-libc |Generate libskycoin documentation| |docs-skyapi |Generate SkyApi (libcurl) documentation| @@ -163,6 +166,7 @@ After that, run `make docs` for a new docs generation. You can found the api doc |install-linters |Install linters| |install-deps-libc-linux |Install locally dependencies for testing libskycoin| |install-deps-libc-osx |Install locally dependencies for testing libskycoin| +|install-deps-skyapi |Install skyapi(libcurl based) library.| |format |Formats the code. Must have goimports installed (use make install-linters).| |clean-libc |Clean files generate by library| From 5f404d39c7b4c95da89a850a627f86e37d10e9aa Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Sun, 19 May 2019 20:29:12 -0400 Subject: [PATCH 13/96] [release] refs #51 Updated libskyapi build directory --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 3badb7641..a824aad8c 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ SKYVENDOR_REL_PATH = $(SKYSRC_REL_PATH)/vendor # Compilation output for libskycoin BUILD_DIR = build BUILDLIB_DIR = $(BUILD_DIR)/libskycoin +BUILDLIBSKYAPI_DIR = $(BUILD_DIR)/libskyapi LIB_DIR = lib BIN_DIR = bin DOC_DIR = docs @@ -101,6 +102,8 @@ build-libc: configure-build build-libc-static build-libc-shared ## Build libskyc build-skyapi: ## Build skyapi(libcurl based) library ./lib/curl/install_lib_curl.sh + mkdir -p ./build/libskyapi + cp lib/curl/build/libskyapi.so ./build/libskyapi build: build-libc build-skyapi ## Build libraries @@ -194,6 +197,7 @@ format: ## Formats the code. Must have goimports installed (use make install-lin clean-libc: ## Clean files generate by library rm -rfv $(BUILDLIB_DIR) + rm -rfv $(BUILDLIBSKYAPI_DIR) rm -rfv bin rm -rfv qemu_test_libskycoin* rm -rfv include/libskycoin.h From 34f5dcaba37d68a621fff4c0637fd425735c6279 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Mon, 20 May 2019 13:07:28 -0400 Subject: [PATCH 14/96] [circle] refs #47 Added deploy --- .circleci/config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b98356af3..b51f41c6a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,3 +68,16 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus + +deploy: + - provider: releases + api_key: + secure: ZqagrrwPFXs4bgHV9lJkZaex6dxAEUJprSdhsqJLYTkF4uBN5VYNM4KCy+azBabV8pVLxiCCZ8G/ocRw+omQgzJ/1lymNtYez8C/SLAuKzOFxdTxkvyQ9pW5Xr+fjptTEpe/E/lRYvS6LFtQEEpbrtjW/km9HWc7EdMNxUaGhBCRun0YhK3a7JSpQE7JbsyR691Zco8hLb2b5PO8qYx5NoVWHKPMLMYUZhbSZbWs0Viu8s8t9VLVhrSIudAKnQiNs5viWp0YZy6U6mRMuBeZ7wazebx0d/BAj78f+atGOZIiJbHgOxupnhhgR10X7b5B89JggxVe3IFr5t96qz3VV4aTl1yuLZ3i8eYanMIvdirnpPU36bbfAVMJuG7L4hFmZ+pD22ZmiOI4COqHDxSd0gF8DUri+Cf9S+5RF5Kk3YBArQzdue6DjNPBtKyQja1xINfj3Go2LQnaKH+/ffzBJIlw9TICcqf241FS3bNtx0QvUDV/+ezqy0dcD7xKOoUQmLDhyWt5NltNKu/JjoCwj99B9P45GQHJCrSvMu71hwNYlTJxtTJuLIVRXqI5BUEGpnBK99MV+6nycl0ePla4zXTBbJ/uOFzwfj1njAdw2DT4ceTsvtkTAc9qEi3S1hrRL2z3mHQ4loZCTJ9Nn9Cx0WOgfs/bCDvExa7b+AJ3ScE= + file: + - libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz + skip_cleanup: true + draft: true + overwrite: true + on: + repo: skycoin/hardware-wallet + tags: true From 9e24254aeb5cb25a1ce25c5ed7ca07bea1d9fac8 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Mon, 20 May 2019 13:47:47 -0400 Subject: [PATCH 15/96] [circle] refs #47 Remove bad declare deply --- .circleci/config.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b51f41c6a..b98356af3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,16 +68,3 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus - -deploy: - - provider: releases - api_key: - secure: ZqagrrwPFXs4bgHV9lJkZaex6dxAEUJprSdhsqJLYTkF4uBN5VYNM4KCy+azBabV8pVLxiCCZ8G/ocRw+omQgzJ/1lymNtYez8C/SLAuKzOFxdTxkvyQ9pW5Xr+fjptTEpe/E/lRYvS6LFtQEEpbrtjW/km9HWc7EdMNxUaGhBCRun0YhK3a7JSpQE7JbsyR691Zco8hLb2b5PO8qYx5NoVWHKPMLMYUZhbSZbWs0Viu8s8t9VLVhrSIudAKnQiNs5viWp0YZy6U6mRMuBeZ7wazebx0d/BAj78f+atGOZIiJbHgOxupnhhgR10X7b5B89JggxVe3IFr5t96qz3VV4aTl1yuLZ3i8eYanMIvdirnpPU36bbfAVMJuG7L4hFmZ+pD22ZmiOI4COqHDxSd0gF8DUri+Cf9S+5RF5Kk3YBArQzdue6DjNPBtKyQja1xINfj3Go2LQnaKH+/ffzBJIlw9TICcqf241FS3bNtx0QvUDV/+ezqy0dcD7xKOoUQmLDhyWt5NltNKu/JjoCwj99B9P45GQHJCrSvMu71hwNYlTJxtTJuLIVRXqI5BUEGpnBK99MV+6nycl0ePla4zXTBbJ/uOFzwfj1njAdw2DT4ceTsvtkTAc9qEi3S1hrRL2z3mHQ4loZCTJ9Nn9Cx0WOgfs/bCDvExa7b+AJ3ScE= - file: - - libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz - skip_cleanup: true - draft: true - overwrite: true - on: - repo: skycoin/hardware-wallet - tags: true From e5726263581c05d6f92b886879edadc0706d8339 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 19:07:18 -0400 Subject: [PATCH 16/96] [ci] refs #51 Update travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1eaebdb2..0618af4b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,6 @@ deploy: on: repo: skycoin/hardware-wallet tags: true ->>>>>>> origin/v0.25dev notifications: email: false webhooks: https://fathomless-fjord-24024.herokuapp.com/notify From 1c11f1930087acd587f2593fecd1e070e7eaafba Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 19:21:22 -0400 Subject: [PATCH 17/96] [ci] refs #51 Solve mkdir issue in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a824aad8c..eb76aaf9a 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ install-deps-skyapi-Darwin: install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. - (cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) + (mkdir -p build && cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz From 6750922c9cabecfc327d4addcb8ba0ad7dbd3a54 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 19:53:28 -0400 Subject: [PATCH 18/96] [ci] refs #2031 Install curl from source --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index eb76aaf9a..10ed14ab1 100644 --- a/Makefile +++ b/Makefile @@ -182,6 +182,7 @@ install-deps-skyapi-Darwin: install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. + (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) (mkdir -p build && cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin From 066ea615a3b7deec0b4b3cabafada87ea7345cea Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 20:18:04 -0400 Subject: [PATCH 19/96] [ci] refs #2031 Updated curl and cmake in macos --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 10ed14ab1..95c9994e0 100644 --- a/Makefile +++ b/Makefile @@ -178,6 +178,8 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: brew list cmake || brew install cmake brew list curl || brew install curl + brew upgrade curl + brew upgrade cmake install-deps-libc: install-deps-libc-$(OSNAME) From ec8ca8adf4262e691164ebd2842fa264be4c56c0 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 20:35:35 -0400 Subject: [PATCH 20/96] [ci] refs #2031 Install curl only in linux --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 95c9994e0..040f4187b 100644 --- a/Makefile +++ b/Makefile @@ -174,6 +174,8 @@ install-deps-skyapi-Linux: sudo apt-get update sudo apt-get install cmake sudo apt-get install libcurl3-gnutls + sudo apt remove curl + (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) install-deps-skyapi-Darwin: brew list cmake || brew install cmake @@ -184,7 +186,6 @@ install-deps-skyapi-Darwin: install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. - (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) (mkdir -p build && cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin From bdafe6deb5be12a9eacebd22b1504911e34349e3 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 20:49:27 -0400 Subject: [PATCH 21/96] [ci] refs #2031 Updated in macos update --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 040f4187b..6c3f9e4a6 100644 --- a/Makefile +++ b/Makefile @@ -180,8 +180,7 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: brew list cmake || brew install cmake brew list curl || brew install curl - brew upgrade curl - brew upgrade cmake + brew upgrade install-deps-libc: install-deps-libc-$(OSNAME) From d819dea175e74f2e0dba0d4a16e969f8d1919644 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 21:03:04 -0400 Subject: [PATCH 22/96] [ci] refs #2031 removed brew update --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 6c3f9e4a6..05934db47 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,6 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: brew list cmake || brew install cmake brew list curl || brew install curl - brew upgrade install-deps-libc: install-deps-libc-$(OSNAME) From de5566483e60e2fb5d717e8fb09a4626c2017f8d Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 21:28:38 -0400 Subject: [PATCH 23/96] [ci] refs #51 Install curl from source --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 05934db47..3b4d6d0cc 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,9 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: brew list cmake || brew install cmake - brew list curl || brew install curl + brew remove curl + (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) +# brew list curl || brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From bc706fc506d27da2fa4108e25130e5b136658f2b Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 21:41:51 -0400 Subject: [PATCH 24/96] [ci] refs #51 Removed brew remove curl --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 3b4d6d0cc..35e6cd243 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,6 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: brew list cmake || brew install cmake - brew remove curl (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) # brew list curl || brew install curl From 56a02c82ca18ec4e8012e5b4343321339d80afb0 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Mon, 20 May 2019 22:15:10 -0400 Subject: [PATCH 25/96] [ci] refs #51 set like branch origin/v0.25dev --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 35e6cd243..e9ad77cf8 100644 --- a/Makefile +++ b/Makefile @@ -178,9 +178,8 @@ install-deps-skyapi-Linux: (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) install-deps-skyapi-Darwin: - brew list cmake || brew install cmake (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) -# brew list curl || brew install curl + brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From 3058c8e72f908507da795fb606533b938ec19f51 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 00:03:11 -0400 Subject: [PATCH 26/96] [ci] refs #51 Set installation script to run with bash --- .travis.yml | 3 --- Makefile | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0618af4b4..9d7a13040 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ services: - docker language: go go: - - "1.11.x" - matrix: include: - os: linux @@ -25,7 +23,6 @@ env: - CGO_ENABLED: 1 - VERSION_UPGRADE_TEST_WAIT_TIMEOUT: 60s - PATH_DIR: "$GOPATH/src/github.com/skycoin/libskycoin/" - install: # Install gox - go get github.com/gz-c/gox diff --git a/Makefile b/Makefile index e9ad77cf8..0d39b1f71 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,7 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library - ./lib/curl/install_lib_curl.sh + bash ./lib/curl/install_lib_curl.sh mkdir -p ./build/libskyapi cp lib/curl/build/libskyapi.so ./build/libskyapi From 4dc9f57c61383119d1b6be1a5094d69896d73cc2 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 00:11:31 -0400 Subject: [PATCH 27/96] [circle] refs #47 Showing architecture working and deployment statement --- .circleci/config.yml | 24 +++++++++++++++++++++--- docker/images/test-arm/Dockerfile | 1 + 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b98356af3..5610d13d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test raspberrypi2: docker: @@ -43,7 +43,7 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test bananapi_m1_plus: docker: @@ -58,8 +58,24 @@ jobs: - setup_remote_docker: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + publish-github-release_64: + requires: + - bananapi_m1_plus + - raspberrypi3 + - orangepi-plus2 + docker: + - image: circleci/golang:1.10 + steps: + - attach_workspace: + at: ./build + - run: + name: "Publish Release on GitHub" + command: | + VERSION=0.25.1 + run: docker build --build-arg QEMU_PLATFORM=orangepi-plus2 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy + workflows: version: 2 arm_test: @@ -68,3 +84,5 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus + + diff --git a/docker/images/test-arm/Dockerfile b/docker/images/test-arm/Dockerfile index d9bfa0690..625f11f37 100644 --- a/docker/images/test-arm/Dockerfile +++ b/docker/images/test-arm/Dockerfile @@ -9,6 +9,7 @@ ADD . $GOPATH/src/github.com/skycoin/libskycoin/ RUN [ "cross-build-start" ] +RUN uname -m RUN ls -oa $GOPATH/src/github.com/skycoin/libskycoin/ RUN sh $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts/docker_install_${QEMU_OS}.sh RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep From 6453b3b0502aac43967aa3067f78627828f325c8 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 00:31:36 -0400 Subject: [PATCH 28/96] [ci] refs #51 Setting makefile as equal as possible --- .travis.yml | 2 +- Makefile | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d7a13040..5f8413bf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,8 @@ install: - go get github.com/gz-c/gox - go get -t ./... - make install-linters - - make install-deps-skyapi - make install-deps-libc + - make install-deps-skyapi script: - make lint - make test-libc diff --git a/Makefile b/Makefile index 0d39b1f71..484eca52c 100644 --- a/Makefile +++ b/Makefile @@ -170,21 +170,23 @@ install-linters: install-linters-$(UNAME_S) ## Install linters cat ./ci-scripts/install-golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.10.2 install-deps-skyapi-Linux: + mkdir -p deps sudo add-apt-repository ppa:george-edison55/cmake-3.x -y sudo apt-get update sudo apt-get install cmake sudo apt-get install libcurl3-gnutls sudo apt remove curl - (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) install-deps-skyapi-Darwin: - (mkdir -p build && cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + mkdir -p deps + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) brew install curl install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. - (mkdir -p build && cd build && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) + (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz From 6ba63aa21684068ac62d84eb438cbd7cbeec71ac Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 00:58:08 -0400 Subject: [PATCH 29/96] [circle] refs #47 Create dockerfile to release. --- .circleci/config.yml | 80 ++++++++++++++++++++------------- docker/images/circle/Dockerfile | 21 +++++++++ 2 files changed, 69 insertions(+), 32 deletions(-) create mode 100644 docker/images/circle/Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 5610d13d6..174f205eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test raspberrypi3: docker: @@ -27,9 +26,8 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + raspberrypi2: docker: - image: docker:18.06.0-ce-git @@ -42,39 +40,49 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + bananapi_m1_plus: - docker: - - image: docker:18.06.0-ce-git - working_directory: $GOPATH/src/github.com/skycoin/libskycoin - environment: - QEMU_PLATFORM: bananapi-m1-plus - - steps: - - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin - - checkout - - setup_remote_docker: - version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - # - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=fedora --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - + docker: + - image: docker:18.06.0-ce-git + working_directory: $GOPATH/src/github.com/skycoin/libskycoin + environment: + QEMU_PLATFORM: bananapi-m1-plus + + steps: + - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin + - checkout + - setup_remote_docker: + version: 18.06.0-ce + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + publish-github-release_64: requires: - - bananapi_m1_plus - - raspberrypi3 - - orangepi-plus2 + - raspberrypi3 + - orangepi-plus2 + docker: + - image: circleci/golang:1.10 + steps: + - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin + - checkout + - run: + name: "Publish Release on GitHub ARMv8" + command: | + docker build --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy + + publish-github-release_32: + requires: + - bananapi_m1_plus + - raspberrypi2 docker: - image: circleci/golang:1.10 steps: - - attach_workspace: - at: ./build + - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin + - checkout - run: - name: "Publish Release on GitHub" + name: "Publish Release on GitHub ARMv7" command: | - VERSION=0.25.1 - run: docker build --build-arg QEMU_PLATFORM=orangepi-plus2 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy + docker build --build-arg QEMU_PLATFORM=raspberrypi2 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy workflows: version: 2 @@ -84,5 +92,13 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus - - + - publish-github-release_32: + filters: + branches: + only: + - master + - publish-github-release_64: + filters: + branches: + only: + - master diff --git a/docker/images/circle/Dockerfile b/docker/images/circle/Dockerfile new file mode 100644 index 000000000..e27ec466a --- /dev/null +++ b/docker/images/circle/Dockerfile @@ -0,0 +1,21 @@ +ARG QEMU_PLATFORM +FROM balenalib/${QEMU_PLATFORM}-debian-golang +# FIXME: If not repeated here build fails. +# See https://travis-ci.org/simelo/libskycoin/jobs/529481211#L649-L653 + +ADD . $GOPATH/src/github.com/skycoin/libskycoin/ + +RUN [ "cross-build-start" ] + +RUN ls -oa $GOPATH/src/github.com/skycoin/libskycoin/ +RUN sh $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts/docker_install_debian.sh +RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep +RUN go get github.com/gz-c/gox +RUN go get -t ./... +ENV CGO_ENABLED=1 +ENV VERSION=0.25.1 +RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build +RUN go get github.com/tcnksm/ghr +RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/ + +RUN [ "cross-build-end" ] From baf988311712ca62bc4a682a6cec908f5e653a43 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 01:22:14 -0400 Subject: [PATCH 30/96] [ci] refs #51 set prefix to config in curl --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 484eca52c..acdebdced 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,8 @@ SKYVENDOR_REL_PATH = $(SKYSRC_REL_PATH)/vendor BUILD_DIR = build BUILDLIB_DIR = $(BUILD_DIR)/libskycoin BUILDLIBSKYAPI_DIR = $(BUILD_DIR)/libskyapi +LIBNAME_Linux = libskyapi.so +LIBNAME_Darwin = libskyapi.dylib LIB_DIR = lib BIN_DIR = bin DOC_DIR = docs @@ -103,7 +105,7 @@ build-libc: configure-build build-libc-static build-libc-shared ## Build libskyc build-skyapi: ## Build skyapi(libcurl based) library bash ./lib/curl/install_lib_curl.sh mkdir -p ./build/libskyapi - cp lib/curl/build/libskyapi.so ./build/libskyapi + cp lib/curl/build/LIBNAME_$(UNAME_S) ./build/libskyapi build: build-libc build-skyapi ## Build libraries @@ -180,8 +182,7 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) - brew install curl + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From a54ca9ac3040b93e61dc0153bfb482511a2614e7 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 01:35:04 -0400 Subject: [PATCH 31/96] [circle] refs #47 Define correct path to deploy and correcting Dockerfile the deploy --- .circleci/config.yml | 31 +++++++------------------------ docker/images/circle/Dockerfile | 9 ++++++++- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 174f205eb..ae9774100 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,24 +56,12 @@ jobs: version: 18.06.0-ce - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test - publish-github-release_64: - requires: - - raspberrypi3 - - orangepi-plus2 - docker: - - image: circleci/golang:1.10 - steps: - - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin - - checkout - - run: - name: "Publish Release on GitHub ARMv8" - command: | - docker build --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy - publish-github-release_32: requires: - bananapi_m1_plus - raspberrypi2 + - raspberrypi3 + - orangepi-plus2 docker: - image: circleci/golang:1.10 steps: @@ -82,7 +70,7 @@ jobs: - run: name: "Publish Release on GitHub ARMv7" command: | - docker build --build-arg QEMU_PLATFORM=raspberrypi2 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile_circle_deploy $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy + docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy workflows: version: 2 @@ -93,12 +81,7 @@ workflows: - raspberrypi2 - bananapi_m1_plus - publish-github-release_32: - filters: - branches: - only: - - master - - publish-github-release_64: - filters: - branches: - only: - - master + filters: + branches: + only: + - master diff --git a/docker/images/circle/Dockerfile b/docker/images/circle/Dockerfile index e27ec466a..83b9e00c1 100644 --- a/docker/images/circle/Dockerfile +++ b/docker/images/circle/Dockerfile @@ -3,6 +3,10 @@ FROM balenalib/${QEMU_PLATFORM}-debian-golang # FIXME: If not repeated here build fails. # See https://travis-ci.org/simelo/libskycoin/jobs/529481211#L649-L653 +ARG GITHUB_OAUTH_TOKEN +ARG CIRCLE_PROJECT_USERNAME +ARG CIRCLE_PROJECT_REPONAME +ARG CIRCLE_SHA1 ADD . $GOPATH/src/github.com/skycoin/libskycoin/ RUN [ "cross-build-start" ] @@ -14,8 +18,11 @@ RUN go get github.com/gz-c/gox RUN go get -t ./... ENV CGO_ENABLED=1 ENV VERSION=0.25.1 +ENV ARCH=arm +ENV OS=Linux RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build +RUN tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/* RUN go get github.com/tcnksm/ghr -RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/ +RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz RUN [ "cross-build-end" ] From f197e1c922c191b38915c2c98faaad228fb1c124 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 01:46:27 -0400 Subject: [PATCH 32/96] [ci] refs #51 Library outputs set ok --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index acdebdced..fd243c39a 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ build-libc: configure-build build-libc-static build-libc-shared ## Build libskyc build-skyapi: ## Build skyapi(libcurl based) library bash ./lib/curl/install_lib_curl.sh mkdir -p ./build/libskyapi - cp lib/curl/build/LIBNAME_$(UNAME_S) ./build/libskyapi + cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi build: build-libc build-skyapi ## Build libraries From 1421479b74971f7e0d0e06d8f18bd84600c7d17a Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 01:53:33 -0400 Subject: [PATCH 33/96] [ci] refs #51 Set like last makefile --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fd243c39a..aa126bdf2 100644 --- a/Makefile +++ b/Makefile @@ -185,9 +185,16 @@ install-deps-skyapi-Darwin: (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) - -install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. - (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) +# install-deps-skyapi-$(UNAME_S) +install-deps-skyapi: ## Install skyapi(libcurl based) library. + if [[ "$(UNAME_S)" == "Linux" ]]; then (cd build && wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=$(pwd)/build/cmake-install:$(pwd)/build/cmake-install/bin:$PATH ) ; fi + (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) + if [[ "$(UNAME_S)" == "Darwin" ]]; then brew install curl ; fi + # install uncrustify + (cd build && git clone https://github.com/uncrustify/uncrustify.git) + (cd build/uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) + +# (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz From 5666037b2effa85b10b5c503d91f5f8dd17f52bf Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 08:25:41 -0400 Subject: [PATCH 34/96] [circle] refs #47 Reformat circle --- .circleci/config.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae9774100..fbcc95bbb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,14 +63,19 @@ jobs: - raspberrypi3 - orangepi-plus2 docker: - - image: circleci/golang:1.10 + - image: docker:18.06.0-ce-git steps: - run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin - checkout + - setup_remote_docker: + version: 18.06.0-ce - run: name: "Publish Release on GitHub ARMv7" - command: | - docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy + command: | + if [[ "$CIRCLE_BRANCH" == "master" ]]; then + docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; + fi + workflows: version: 2 @@ -80,8 +85,4 @@ workflows: - orangepi-plus2 - raspberrypi2 - bananapi_m1_plus - - publish-github-release_32: - filters: - branches: - only: - - master + - publish-github-release_32 From 40824838211439e63b19d58b1c33a513e89273d9 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 08:28:54 -0400 Subject: [PATCH 35/96] [circle] refs #47 Parse file conf --- .circleci/config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fbcc95bbb..efc9dfcf0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,12 +69,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: - name: "Publish Release on GitHub ARMv7" - command: | - if [[ "$CIRCLE_BRANCH" == "master" ]]; then - docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; - fi + - run: if [[ "$CIRCLE_BRANCH" == "master" ]]; then docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi workflows: From 86133dca389bd329693e128f82a39723daff9078 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 10:14:23 -0400 Subject: [PATCH 36/96] [circle] refs #47 Remove all depend in deploy --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index efc9dfcf0..85c2c430d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,11 +57,6 @@ jobs: - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test publish-github-release_32: - requires: - - bananapi_m1_plus - - raspberrypi2 - - raspberrypi3 - - orangepi-plus2 docker: - image: docker:18.06.0-ce-git steps: From 667abe99c7a344b475b89a4e1c2d599b0be366de Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 21 May 2019 10:42:08 -0400 Subject: [PATCH 37/96] [circle] refs #47 Change file dockerfile in test arm --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85c2c430d..aa217531b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test raspberrypi3: docker: @@ -26,7 +26,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test raspberrypi2: docker: @@ -40,7 +40,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test bananapi_m1_plus: docker: @@ -54,7 +54,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test + - run: docker build --build-arg QEMU_PLATFORM --build-arg QEMU_OS=debian --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/test-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-test publish-github-release_32: docker: From b962f59e0e3f4447cb0bd0be7396c1dd61885cf9 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 16:38:54 -0400 Subject: [PATCH 38/96] [makefile] refs #51 refactorized the makefile --- Makefile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index aa126bdf2..fd243c39a 100644 --- a/Makefile +++ b/Makefile @@ -185,16 +185,9 @@ install-deps-skyapi-Darwin: (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) -# install-deps-skyapi-$(UNAME_S) -install-deps-skyapi: ## Install skyapi(libcurl based) library. - if [[ "$(UNAME_S)" == "Linux" ]]; then (cd build && wget --no-check-certificate https://cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz && echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt && md5sum -c cmake_md5.txt && tar -xvf cmake-3.3.2-Linux-x86_64.tar.gz > /dev/null && mv cmake-3.3.2-Linux-x86_64 cmake-install && PATH=$(pwd)/build/cmake-install:$(pwd)/build/cmake-install/bin:$PATH ) ; fi - (cd build && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && bash ./configure && make && sudo make install) - if [[ "$(UNAME_S)" == "Darwin" ]]; then brew install curl ; fi - # install uncrustify - (cd build && git clone https://github.com/uncrustify/uncrustify.git) - (cd build/uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) - -# (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) + +install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. + (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz From 922d5f4a99441a060d152e887037f8415c4cfd22 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 21:37:43 -0400 Subject: [PATCH 39/96] [ci] refs #51 Install curl with brew --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fd243c39a..8e2887cae 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,8 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) + #(cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) + brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From e7e178b684f10c1b1bc730230f8cf70adb1e09b8 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Tue, 21 May 2019 21:41:52 -0400 Subject: [PATCH 40/96] show curl package content from brew ref #51 --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 8e2887cae..148d2128e 100644 --- a/Makefile +++ b/Makefile @@ -184,6 +184,9 @@ install-deps-skyapi-Darwin: mkdir -p deps #(cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) brew install curl + brew --prefix curl + brew ls --verbose curl + exit 1 install-deps-libc: install-deps-libc-$(OSNAME) From e5dc4dc687035ad98a5fbcef2a0986adf8fca5d9 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 22:11:15 -0400 Subject: [PATCH 41/96] [ci] refs #51 Install specific curl with homebrew --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 148d2128e..ffcd7b667 100644 --- a/Makefile +++ b/Makefile @@ -183,10 +183,9 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps #(cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) - brew install curl + brew install curl@7.58 brew --prefix curl brew ls --verbose curl - exit 1 install-deps-libc: install-deps-libc-$(OSNAME) From 84ef052dce5a70736a9ce6b96dd71461d8e963d9 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 22:40:26 -0400 Subject: [PATCH 42/96] [ci] refs #51 Install curl from source --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ffcd7b667..a3f4a15ca 100644 --- a/Makefile +++ b/Makefile @@ -182,10 +182,8 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - #(cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) - brew install curl@7.58 - brew --prefix curl - brew ls --verbose curl + brew rm curl + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 0081956f08b324058bb18d94f4f79c67db8e5902 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 22:46:18 -0400 Subject: [PATCH 43/96] [ci] refs #51 export to ld library path curl installation --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a3f4a15ca..626d38950 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,7 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/curl bash ./lib/curl/install_lib_curl.sh mkdir -p ./build/libskyapi cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi From 62aab294d44167bad06554231a49c931bf333d62 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 23:11:51 -0400 Subject: [PATCH 44/96] [ci] refs #51 quit brew remove curl from makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 626d38950..e9a5c3b30 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,6 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - brew rm curl (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 126f7c881e6f2598cbb37ed24e0fd21d3198326a Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Tue, 21 May 2019 23:40:16 -0400 Subject: [PATCH 45/96] [ci] refs #51 set new location to install libcurl --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e9a5c3b30..97833a1b3 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,8 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) + rm -rf /usr/lib/libcurl.dylib + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/lib && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 5e626c2b801d041233b8b3c5bf42e43ee9e579c3 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 22 May 2019 00:01:04 -0400 Subject: [PATCH 46/96] [ci] refs #51 Quit curl .configure prefix --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 97833a1b3..2a860d58f 100644 --- a/Makefile +++ b/Makefile @@ -183,8 +183,8 @@ install-deps-skyapi-Linux: install-deps-skyapi-Darwin: mkdir -p deps - rm -rf /usr/lib/libcurl.dylib - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/lib && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From 91fb6f899a64db1ad18bf01755e3897ed1c2b276 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 22 May 2019 01:13:24 -0400 Subject: [PATCH 47/96] [ci] refs #51 Removed export from installation --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 2a860d58f..0c4d0effb 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,6 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/curl bash ./lib/curl/install_lib_curl.sh mkdir -p ./build/libskyapi cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi From 0df24b720679d2a5e8ac059382d4f387f9249491 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 22 May 2019 01:21:00 -0400 Subject: [PATCH 48/96] [ci] refs #51 Setup new install dir --- Makefile | 2 +- lib/curl/install_lib_curl.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0c4d0effb..4f0fa147b 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library - bash ./lib/curl/install_lib_curl.sh + (cd lib/curl && bash ./install_lib_curl.sh) mkdir -p ./build/libskyapi cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index b689a24cd..36646a541 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,5 +1,3 @@ -cd lib/curl - mkdir -p build cd build # for normal install use following command From c048fdd45bdc569306705ea05cb8ee5884640180 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 22 May 2019 01:29:14 -0400 Subject: [PATCH 49/96] [curl] refs #51 Added curl as export for compilers --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 4f0fa147b..c3fedd10c 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,8 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library + export LDFLAGS="-L/usr/local/opt/curl/lib" + export CPPFLAGS="-I/usr/local/opt/curl/include" (cd lib/curl && bash ./install_lib_curl.sh) mkdir -p ./build/libskyapi cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi From 2d172dbe076ee812db05c2a096992bbb4e21d22a Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 22 May 2019 01:44:07 -0400 Subject: [PATCH 50/96] [ci] refs #51 Solve identation issue in makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c3fedd10c..586e1843d 100644 --- a/Makefile +++ b/Makefile @@ -103,8 +103,6 @@ build-libc-shared: $(BUILDLIB_DIR)/libskycoin.so ## Build libskycoin C shared li build-libc: configure-build build-libc-static build-libc-shared ## Build libskycoin C client libraries build-skyapi: ## Build skyapi(libcurl based) library - export LDFLAGS="-L/usr/local/opt/curl/lib" - export CPPFLAGS="-I/usr/local/opt/curl/include" (cd lib/curl && bash ./install_lib_curl.sh) mkdir -p ./build/libskyapi cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi @@ -183,6 +181,8 @@ install-deps-skyapi-Linux: (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) install-deps-skyapi-Darwin: + export LDFLAGS="-L/usr/local/opt/curl/lib" + export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) brew install curl From 313c076c8da38140fbc64701598ab082b3deff4b Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 12:39:53 -0400 Subject: [PATCH 51/96] trying to force cmake find a specific libcurl ref #51 --- lib/curl/CMakeLists.txt | 4 +++- lib/curl/install_lib_curl.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 93d2b57a3..b93ca4bb1 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -10,7 +10,9 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED) +find_package(CURL 7.58.0 REQUIRED + PATHS "/usr/local/Cellar/curl/7.64.1/lib" + NO_DEFAULT_PATH) if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 36646a541..be1ef132d 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -2,6 +2,7 @@ mkdir -p build cd build # for normal install use following command cmake .. +exit 1 make sudo make install From d3bdf62583607f8a8a19fcddad061e31ca92c9e3 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 12:39:53 -0400 Subject: [PATCH 52/96] trying to force cmake find a specific libcurl ref #51 --- lib/curl/CMakeLists.txt | 4 +++- lib/curl/install_lib_curl.sh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 93d2b57a3..b93ca4bb1 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -10,7 +10,9 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED) +find_package(CURL 7.58.0 REQUIRED + PATHS "/usr/local/Cellar/curl/7.64.1/lib" + NO_DEFAULT_PATH) if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 36646a541..be1ef132d 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -2,6 +2,7 @@ mkdir -p build cd build # for normal install use following command cmake .. +exit 1 make sudo make install From 9fb60f209141d51ee2dfe34cd87ef9ddf08a4c25 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 15:59:20 -0400 Subject: [PATCH 53/96] exit after curl stage ref #51 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 586e1843d..61fd8718e 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,7 @@ build-libc: configure-build build-libc-static build-libc-shared ## Build libskyc build-skyapi: ## Build skyapi(libcurl based) library (cd lib/curl && bash ./install_lib_curl.sh) mkdir -p ./build/libskyapi + exit 1 cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi build: build-libc build-skyapi ## Build libraries From 343920596e965f9355381c46ab9442ffe66c0f86 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 16:33:47 -0400 Subject: [PATCH 54/96] remove NO_DEFAULT_PATH ref #51 --- lib/curl/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index b93ca4bb1..309193931 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -11,8 +11,7 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") find_package(CURL 7.58.0 REQUIRED - PATHS "/usr/local/Cellar/curl/7.64.1/lib" - NO_DEFAULT_PATH) + PATHS "/usr/local/Cellar/curl/7.64.1/lib") if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) From e8468ccd5a4f75347b7855a7a0356ed4061b3a77 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 17:04:00 -0400 Subject: [PATCH 55/96] match exact version for curl package ref #51 --- .travis.yml | 1 + lib/cgo/tests/check_cipher.hash.common.c | 274 +++++++++++++++++++++++ lib/curl/CMakeLists.txt | 4 +- lib/curl/install_lib_curl.sh | 4 + 4 files changed, 281 insertions(+), 2 deletions(-) create mode 100644 lib/cgo/tests/check_cipher.hash.common.c diff --git a/.travis.yml b/.travis.yml index 5f8413bf2..63ef9c17f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ install: - make install-deps-libc - make install-deps-skyapi script: + - make build-skyapi - make lint - make test-libc - make lint-libc diff --git a/lib/cgo/tests/check_cipher.hash.common.c b/lib/cgo/tests/check_cipher.hash.common.c new file mode 100644 index 000000000..7c0967762 --- /dev/null +++ b/lib/cgo/tests/check_cipher.hash.common.c @@ -0,0 +1,274 @@ +#include +#include + +#include +#include "libskycoin.h" +#include "skyerrors.h" +#include "skyassert.h" +#include "skystring.h" +#include "skytest.h" + +// TestSuite(cipher_hash, .init = setup, .fini = teardown); + +void freshSumRipemd160(GoSlice bytes, cipher__Ripemd160* rp160) +{ + SKY_cipher_HashRipemd160(bytes, rp160); +} + +void freshSumSHA256(GoSlice bytes, cipher__SHA256* sha256) +{ + SKY_cipher_SumSHA256(bytes, sha256); +} + +START_TEST(TestAddSHA256) +{ + + unsigned char bbuff[130]; + GoSlice b = {bbuff, 0, 130}; + randBytes(&b, 128); + cipher__SHA256 h; + SKY_cipher_SumSHA256(b, &h); + + unsigned char cbuff[130]; + GoSlice c = {cbuff, 0, 130}; + randBytes(&c, 64); + cipher__SHA256 i; + SKY_cipher_SumSHA256(c, &i); + + cipher__SHA256 add; + cipher__SHA256 tmp; + + SKY_cipher_AddSHA256(&h, &i, &add); + ck_assert(!isU8Eq(add, tmp, 32)); + ck_assert(!isU8Eq(add, h, 32)); + ck_assert(!isU8Eq(add, i, 32)); +} +END_TEST + +START_TEST(TestHashRipemd160) +{ + cipher__Ripemd160 tmp; + cipher__Ripemd160 r; + cipher__Ripemd160 r2; + unsigned char buff[257]; + GoSlice slice = {buff, 0, 257}; + + randBytes(&slice, 128); + SKY_cipher_HashRipemd160(slice, &tmp); + randBytes(&slice, 160); + SKY_cipher_HashRipemd160(slice, &r); + ck_assert(!isU8Eq(tmp, r, sizeof(cipher__Ripemd160))); + + unsigned char buff1[257]; + GoSlice b = {buff1, 0, 257}; + randBytes(&b, 256); + SKY_cipher_HashRipemd160(b, &r2); + ck_assert(!isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); + freshSumRipemd160(b, &tmp); + ck_assert(isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); +} +END_TEST + +START_TEST(TestSHA256KnownValue) +{ + typedef struct + { + char* input; + char* output; + } tmpstruct; + + tmpstruct vals[3]; + + vals[0].input = "skycoin"; + vals[0].output = + "5a42c0643bdb465d90bf673b99c14f5fa02db71513249d904573d2b8b63d353d"; + + vals[1].input = "hello world"; + vals[1].output = + "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; + + vals[2].input = "hello world asd awd awd awdapodawpokawpod "; + vals[2].output = + "99d71f95cafe05ea2dddebc35b6083bd5af0e44850c9dc5139b4476c99950be4"; + int i; + for (i = 0; i < 3; ++i) { + GoSlice slice_input; + GoSlice slice_output; + + slice_input.data = vals[i].input; + slice_input.len = strlen(vals[i].input); + slice_input.cap = strlen(vals[i].input) + 1; + + cipher__SHA256 sha; + + SKY_cipher_SumSHA256(slice_input, &sha); + + char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ tmp_output = { + .p = raw_buf, + .n = sizeof(raw_buf) + }; + + SKY_cipher_SHA256_Hex(&sha, &tmp_output); + registerMemCleanup((void*)tmp_output.p); + + ck_assert_str_eq(tmp_output.p, vals[i].output); + } +} +END_TEST + +START_TEST(TestSumSHA256) +{ + unsigned char bbuff[257], cbuff[257]; + GoSlice b = {bbuff, 0, 257}; + cipher__SHA256 h1; + randBytes(&b, 256); + SKY_cipher_SumSHA256(b, &h1); + cipher__SHA256 tmp; + ck_assert(!isU8Eq(h1, tmp, 32)); + GoSlice c = {cbuff, 0, 257}; + randBytes(&c, 256); + cipher__SHA256 h2; + SKY_cipher_SumSHA256(c, &h2); + ck_assert(!isU8Eq(h1, tmp, 32)); + cipher__SHA256 tmp_h2; + freshSumSHA256(c, &tmp_h2); + ck_assert(isU8Eq(h2, tmp_h2, 32)); +} +END_TEST + +START_TEST(TestSHA256Hex) +{ + cipher__SHA256 h; + unsigned char buff[101]; + GoSlice slice = {buff, 0, 101}; + int error; + + memset(&h, 0, sizeof(h)); + randBytes(&slice, 32); + SKY_cipher_SHA256_Set(&h, slice); + char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ s = { + .p = raw_buf, + .n = sizeof(raw_buf) + }; + + SKY_cipher_SHA256_Hex(&h, &s); + registerMemCleanup((void*)s.p); + + cipher__SHA256 h2; + GoString tmpS = {.p = s.p, .n = s.n}; + error = SKY_cipher_SHA256FromHex(tmpS, &h2); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, h2, 32)); + + char raw_buf2[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ s2 = { + .p = raw_buf2, + .n = sizeof(raw_buf2) + }; + SKY_cipher_SHA256_Hex(&h2, &s2); + registerMemCleanup((void*)s2.p); + ck_assert_str_eq(s.p, s2.p); +} +END_TEST + +START_TEST(TestSHA256Set) +{ + cipher__SHA256 h; + unsigned char buff[101]; + GoSlice slice = {buff, 0, 101}; + int error; + + randBytes(&slice, 33); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 100); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 31); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 0); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 32); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, slice.data, 32)); +} +END_TEST + +START_TEST(TestSHA256FromHex) +{ + unsigned int error; + cipher__SHA256 tmp; + // Invalid hex hash + GoString tmp_string = {"cawcd", 5}; + error = SKY_cipher_SHA256FromHex(tmp_string, &tmp); + ck_assert(error == SKY_ERROR); + // Truncated hex hash + cipher__SHA256 h; + unsigned char buff[130]; + char sbuff[300]; + GoSlice slice = {buff, 0, 130}; + randBytes(&slice, 128); + SKY_cipher_SumSHA256(slice, &h); + bytesnhex(h, sbuff, sizeof(h) >> 1); + GoString s1 = {sbuff, strlen(sbuff)}; + error = SKY_cipher_SHA256FromHex(s1, &h); + ck_assert(error == SKY_ErrInvalidHexLength); + + // Valid hex hash + char buf[33] = {0}; + GoString_ s2 = {.p = buf, .n = 0}; + SKY_cipher_SHA256_Hex(&h, &s2); + cipher__SHA256 h2; + GoString tmps2 = {s2.p, s2.n}; + error = SKY_cipher_SHA256FromHex(tmps2, &h2); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, h2, 32)); +} +END_TEST + +START_TEST(TestSHA256Null) +{ + cipher__SHA256 x; + memset(&x, 0, sizeof(cipher__SHA256)); + GoUint32 result; + GoUint8 isNull; + ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); + ck_assert(isNull); + char buff[130]; + GoSlice b = {buff, 0, 129}; + randBytes(&b, 128); + ck_assert(SKY_cipher_SumSHA256(b, &x) == SKY_OK); + ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); + ck_assert(isNull == 0); +} +END_TEST + +// define test suite and cases +Suite *common_check_cipher_hash(void) +{ + Suite *s = suite_create("Load common check_cipher.hash"); + TCase *tc; + + tc = tcase_create("check_cipher.hash"); + tcase_add_test(tc, TestAddSHA256); + tcase_add_test(tc, TestHashRipemd160); + tcase_add_test(tc, TestSHA256KnownValue); + tcase_add_test(tc, TestSumSHA256); + tcase_add_test(tc, TestSHA256Hex); + tcase_add_test(tc, TestSHA256Set); + tcase_add_test(tc, TestSHA256FromHex); + tcase_add_test(tc, TestSHA256Null); + suite_add_tcase(s, tc); + tcase_set_timeout(tc, 150); + + return s; +} diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 309193931..e0f6cb0a4 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -10,8 +10,8 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED - PATHS "/usr/local/Cellar/curl/7.64.1/lib") +find_package(CURL 7.58.0 EXACT REQUIRED + PATHS "/usr/local/Cellar/curl/7.64.1/lib;/usr/local/Cellar/curl/7.64.1;/usr/local/Cellar;/usr/local/Cellar/curl") if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index be1ef132d..39cda9ca6 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,5 +1,9 @@ mkdir -p build cd build +echo "brew --prefix curl" +brew --prefix curl +echo "brew ls --verbose curl" +brew ls --verbose curl # for normal install use following command cmake .. exit 1 From a7fd772f4435087f851b00bd2ef443fb49e5ce1e Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 17:34:59 -0400 Subject: [PATCH 56/96] build curl with cmake ref #51 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 61fd8718e..9d1eca79d 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ install-deps-skyapi-Linux: sudo apt-get install cmake sudo apt-get install libcurl3-gnutls sudo apt remove curl - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake .. && make && sudo make install) install-deps-skyapi-Darwin: export LDFLAGS="-L/usr/local/opt/curl/lib" From b05aaab5817963013f6633e4bb542646829a3132 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 18:24:34 -0400 Subject: [PATCH 57/96] Revert "build curl with cmake ref #51" This reverts commit a7fd772f4435087f851b00bd2ef443fb49e5ce1e. ref #51 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9d1eca79d..61fd8718e 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ install-deps-skyapi-Linux: sudo apt-get install cmake sudo apt-get install libcurl3-gnutls sudo apt remove curl - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake .. && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) install-deps-skyapi-Darwin: export LDFLAGS="-L/usr/local/opt/curl/lib" From 7cfc1d76db74f1f83a5b2d95abed5cf8275ef8cd Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 18:26:25 -0400 Subject: [PATCH 58/96] build and install curl wiht cmake ref #51 --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 61fd8718e..3654c6da5 100644 --- a/Makefile +++ b/Makefile @@ -185,7 +185,10 @@ install-deps-skyapi-Darwin: export LDFLAGS="-L/usr/local/opt/curl/lib" export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + brew install openssl + brew --prefix openssl + brew ls --verbose openssl + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake .. && make && sudo make install) brew install curl install-deps-libc: install-deps-libc-$(OSNAME) From 68b1cf2a00872b821f88906e3451ef481d328e77 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Wed, 22 May 2019 20:15:55 -0400 Subject: [PATCH 59/96] set openssl dir ref #51 --- Makefile | 3 ++- lib/curl/CMakeLists.txt | 2 +- lib/curl/install_lib_curl.sh | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 3654c6da5..e3db32340 100644 --- a/Makefile +++ b/Makefile @@ -188,8 +188,9 @@ install-deps-skyapi-Darwin: brew install openssl brew --prefix openssl brew ls --verbose openssl - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake .. && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) brew install curl +# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index e0f6cb0a4..1aa57dafa 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") find_package(CURL 7.58.0 EXACT REQUIRED - PATHS "/usr/local/Cellar/curl/7.64.1/lib;/usr/local/Cellar/curl/7.64.1;/usr/local/Cellar;/usr/local/Cellar/curl") + PATHS "/usr/local;/usr/local/lib") if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 39cda9ca6..76438f745 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,11 +1,11 @@ mkdir -p build cd build -echo "brew --prefix curl" -brew --prefix curl -echo "brew ls --verbose curl" -brew ls --verbose curl +#echo "brew --prefix curl" +#brew --prefix curl +#echo "brew ls --verbose curl" +#brew ls --verbose curl # for normal install use following command -cmake .. +cmake -DCURL_ROOT_DIR="/usr/local" .. exit 1 make sudo make install From 4f454b183f72aee10e2f89edd69a58515e8bcb5f Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Wed, 22 May 2019 23:34:28 -0400 Subject: [PATCH 60/96] [circle][docker-test] refs #47 Eliminated the prefix `CIRCLE` of the images to use generic. --- .circleci/config.yml | 2 +- docker/images/circle/Dockerfile | 8 ++++---- docker/images/test-arm/Dockerfile | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa217531b..c49fd79bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: if [[ "$CIRCLE_BRANCH" == "master" ]]; then docker build --build-arg CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg CIRCLE_PROJECT_USERNAME --build-arg CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi + - run: if [[ "$CIRCLE_BRANCH" == "master" ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi workflows: diff --git a/docker/images/circle/Dockerfile b/docker/images/circle/Dockerfile index 83b9e00c1..3cbb29dbe 100644 --- a/docker/images/circle/Dockerfile +++ b/docker/images/circle/Dockerfile @@ -4,9 +4,9 @@ FROM balenalib/${QEMU_PLATFORM}-debian-golang # See https://travis-ci.org/simelo/libskycoin/jobs/529481211#L649-L653 ARG GITHUB_OAUTH_TOKEN -ARG CIRCLE_PROJECT_USERNAME -ARG CIRCLE_PROJECT_REPONAME -ARG CIRCLE_SHA1 +ARG PROJECT_USERNAME +ARG PROJECT_REPONAME +ARG SHA1 ADD . $GOPATH/src/github.com/skycoin/libskycoin/ RUN [ "cross-build-start" ] @@ -23,6 +23,6 @@ ENV OS=Linux RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build RUN tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/* RUN go get github.com/tcnksm/ghr -RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz +RUN ghr -t ${GITHUB_OAUTH_TOKEN} -u ${PROJECT_USERNAME} -r ${PROJECT_REPONAME} -c ${SHA1} -delete ${VERSION} libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz RUN [ "cross-build-end" ] diff --git a/docker/images/test-arm/Dockerfile b/docker/images/test-arm/Dockerfile index 625f11f37..d9bfa0690 100644 --- a/docker/images/test-arm/Dockerfile +++ b/docker/images/test-arm/Dockerfile @@ -9,7 +9,6 @@ ADD . $GOPATH/src/github.com/skycoin/libskycoin/ RUN [ "cross-build-start" ] -RUN uname -m RUN ls -oa $GOPATH/src/github.com/skycoin/libskycoin/ RUN sh $GOPATH/src/github.com/skycoin/libskycoin/ci-scripts/docker_install_${QEMU_OS}.sh RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep From 6713f9561bdb8f6a44974beb35866c7c58bac61b Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Wed, 22 May 2019 23:42:28 -0400 Subject: [PATCH 61/96] [dockerfile-circle][circle] refs #47 Changes in the steps to check the release in Circle CI, and executing only when there is a tag. --- .circleci/config.yml | 4 +++- docker/images/circle/Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c49fd79bb..538f79357 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,7 +64,9 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: if [[ "$CIRCLE_BRANCH" == "master" ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi + - run: VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)" + - run: echo $VERSION + - run: if [[ $VERSION ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi workflows: diff --git a/docker/images/circle/Dockerfile b/docker/images/circle/Dockerfile index 3cbb29dbe..bdf2925f4 100644 --- a/docker/images/circle/Dockerfile +++ b/docker/images/circle/Dockerfile @@ -17,9 +17,9 @@ RUN make -C $GOPATH/src/github.com/skycoin/libskycoin dep RUN go get github.com/gz-c/gox RUN go get -t ./... ENV CGO_ENABLED=1 -ENV VERSION=0.25.1 -ENV ARCH=arm -ENV OS=Linux +RUN export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)" +RUN export ARCH="$(uname -m)" +RUN export OS="$(uname -s)" RUN make -C $GOPATH/src/github.com/skycoin/libskycoin build RUN tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C $GOPATH/src/github.com/skycoin/libskycoin/build $GOPATH/src/github.com/skycoin/libskycoin/build/* RUN go get github.com/tcnksm/ghr From 1204f0acd8abe19bdd590023a5953e350f7584bf Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Wed, 22 May 2019 23:46:21 -0400 Subject: [PATCH 62/96] [dockerfile] refs #47 Remove all comment --- docker/images/circle/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/images/circle/Dockerfile b/docker/images/circle/Dockerfile index bdf2925f4..3c446de9c 100644 --- a/docker/images/circle/Dockerfile +++ b/docker/images/circle/Dockerfile @@ -1,7 +1,5 @@ ARG QEMU_PLATFORM FROM balenalib/${QEMU_PLATFORM}-debian-golang -# FIXME: If not repeated here build fails. -# See https://travis-ci.org/simelo/libskycoin/jobs/529481211#L649-L653 ARG GITHUB_OAUTH_TOKEN ARG PROJECT_USERNAME From ad273b257a8b8b2e71ffdab5058bb5ad6a956c35 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Thu, 23 May 2019 00:34:02 -0400 Subject: [PATCH 63/96] [test-libc] refs # 47 Change in variable typing, to eliminate a memory deficit in ARMv7 --- lib/cgo/tests/check_coin.transactions.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cgo/tests/check_coin.transactions.c b/lib/cgo/tests/check_coin.transactions.c index 6e3a64f81..8f28a0555 100644 --- a/lib/cgo/tests/check_coin.transactions.c +++ b/lib/cgo/tests/check_coin.transactions.c @@ -276,10 +276,11 @@ START_TEST(TestTransactionUpdateHeader) Transaction__Handle handle; coin__Transaction* ptx; ptx = makeTransaction(&handle); - cipher__SHA256 hash, nullHash, hashInner; + cipher__SHA256 hash; + cipher__SHA256 nullHash = ""; + cipher__SHA256 hashInner; memcpy(&hash, &ptx->InnerHash, sizeof(cipher__SHA256)); memset(&ptx->InnerHash, 0, sizeof(cipher__SHA256)); - memset(&nullHash, 0, sizeof(cipher__SHA256)); result = SKY_coin_Transaction_UpdateHeader(handle); ck_assert(!isU8Eq(ptx->InnerHash, nullHash, sizeof(cipher__SHA256))); ck_assert(isU8Eq(ptx->InnerHash, hash, sizeof(cipher__SHA256))); From c5d8afec28de8b6c16e4f977c907b56d5ed53489 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 00:56:55 -0400 Subject: [PATCH 64/96] [ci] refs #51 set skyapi installation with gcc --- lib/curl/install_lib_curl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 36646a541..5e1c21b55 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,7 +1,7 @@ mkdir -p build cd build # for normal install use following command -cmake .. +cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ .. make sudo make install From 41d438cacbb369569f1f7a907ab9e9ccebce6124 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 01:20:13 -0400 Subject: [PATCH 65/96] [make] refs #51 Update installation of skyapi --- Makefile | 1 - lib/curl/CMakeLists.txt | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e3db32340..4ee872ebe 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,6 @@ build-libc: configure-build build-libc-static build-libc-shared ## Build libskyc build-skyapi: ## Build skyapi(libcurl based) library (cd lib/curl && bash ./install_lib_curl.sh) mkdir -p ./build/libskyapi - exit 1 cp lib/curl/build/$(LIBNAME_$(UNAME_S)) ./build/libskyapi build: build-libc build-skyapi ## Build libraries diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 80ddb69c2..93d2b57a3 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -10,9 +10,7 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED - PATHS "/usr/local/Cellar/curl/7.64.1/lib" - NO_DEFAULT_PATH) +find_package(CURL 7.58.0 REQUIRED) if(CURL_FOUND) include_directories(${CURL_INCLUDE_DIR}) set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) From b30189dcf9aff4bd6819fd5218dce9480bff8534 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 01:54:10 -0400 Subject: [PATCH 66/96] [cmake] refs #51 Set specific path to compiler for skyapi --- lib/curl/install_lib_curl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index b4bb34c03..40a48cd61 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -5,7 +5,7 @@ cd build #echo "brew ls --verbose curl" #brew ls --verbose curl # for normal install use following command -cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ .. +cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/g++ .. make sudo make install From 11d7a41565e86beb7a29fecfd992205882205283 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Thu, 23 May 2019 08:37:08 -0400 Subject: [PATCH 67/96] [circle] refs #47 Eliminating bad statement of obtaining of tags for Circle CI. --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 538f79357..e88ed5d89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,9 +64,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)" - - run: echo $VERSION - - run: if [[ $VERSION ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi + - run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi workflows: From ef943f4758452abbb22d8e993fcbd47829f727c3 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 18:03:11 -0400 Subject: [PATCH 68/96] install curl with brew only ref #51 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4ee872ebe..51fd6bfb3 100644 --- a/Makefile +++ b/Makefile @@ -187,7 +187,7 @@ install-deps-skyapi-Darwin: brew install openssl brew --prefix openssl brew ls --verbose openssl - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) +# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) brew install curl # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) From 247891a67889921cca5f1af248101438d61dabe3 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 18:19:20 -0400 Subject: [PATCH 69/96] use gnu compiler ref #51 --- lib/curl/install_lib_curl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 40a48cd61..d79be9ac7 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -5,7 +5,7 @@ cd build #echo "brew ls --verbose curl" #brew ls --verbose curl # for normal install use following command -cmake -D CMAKE_C_COMPILER=/usr/bin/gcc -D CMAKE_CXX_COMPILER=/usr/bin/g++ .. +cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. make sudo make install From dceb52f21194f460fc88598298b5c0ba8fb657aa Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 18:23:34 -0400 Subject: [PATCH 70/96] upgrade curl to a new version with brew ref #51 --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 51fd6bfb3..a7f32b000 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,9 @@ install-deps-skyapi-Darwin: brew --prefix openssl brew ls --verbose openssl # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + brew update brew install curl + brew upgrade curl # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 5dede35887769f384cb697d89a9f6eb0269e6ded Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 18:38:27 -0400 Subject: [PATCH 71/96] a install after a update in brew install the last version, no upgrade required ref #51 --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index a7f32b000..e1128d13e 100644 --- a/Makefile +++ b/Makefile @@ -185,12 +185,9 @@ install-deps-skyapi-Darwin: export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps brew install openssl - brew --prefix openssl - brew ls --verbose openssl # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) brew update brew install curl - brew upgrade curl # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 2a1465aaf18c7957226632708eb9b76da9e267c6 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 18:42:34 -0400 Subject: [PATCH 72/96] [merge] refs #51 Quit cipher hash --- lib/cgo/tests/check_cipher.hash.common.c | 274 ----------------------- lib/curl/install_lib_curl.sh | 2 + 2 files changed, 2 insertions(+), 274 deletions(-) delete mode 100644 lib/cgo/tests/check_cipher.hash.common.c diff --git a/lib/cgo/tests/check_cipher.hash.common.c b/lib/cgo/tests/check_cipher.hash.common.c deleted file mode 100644 index 7c0967762..000000000 --- a/lib/cgo/tests/check_cipher.hash.common.c +++ /dev/null @@ -1,274 +0,0 @@ -#include -#include - -#include -#include "libskycoin.h" -#include "skyerrors.h" -#include "skyassert.h" -#include "skystring.h" -#include "skytest.h" - -// TestSuite(cipher_hash, .init = setup, .fini = teardown); - -void freshSumRipemd160(GoSlice bytes, cipher__Ripemd160* rp160) -{ - SKY_cipher_HashRipemd160(bytes, rp160); -} - -void freshSumSHA256(GoSlice bytes, cipher__SHA256* sha256) -{ - SKY_cipher_SumSHA256(bytes, sha256); -} - -START_TEST(TestAddSHA256) -{ - - unsigned char bbuff[130]; - GoSlice b = {bbuff, 0, 130}; - randBytes(&b, 128); - cipher__SHA256 h; - SKY_cipher_SumSHA256(b, &h); - - unsigned char cbuff[130]; - GoSlice c = {cbuff, 0, 130}; - randBytes(&c, 64); - cipher__SHA256 i; - SKY_cipher_SumSHA256(c, &i); - - cipher__SHA256 add; - cipher__SHA256 tmp; - - SKY_cipher_AddSHA256(&h, &i, &add); - ck_assert(!isU8Eq(add, tmp, 32)); - ck_assert(!isU8Eq(add, h, 32)); - ck_assert(!isU8Eq(add, i, 32)); -} -END_TEST - -START_TEST(TestHashRipemd160) -{ - cipher__Ripemd160 tmp; - cipher__Ripemd160 r; - cipher__Ripemd160 r2; - unsigned char buff[257]; - GoSlice slice = {buff, 0, 257}; - - randBytes(&slice, 128); - SKY_cipher_HashRipemd160(slice, &tmp); - randBytes(&slice, 160); - SKY_cipher_HashRipemd160(slice, &r); - ck_assert(!isU8Eq(tmp, r, sizeof(cipher__Ripemd160))); - - unsigned char buff1[257]; - GoSlice b = {buff1, 0, 257}; - randBytes(&b, 256); - SKY_cipher_HashRipemd160(b, &r2); - ck_assert(!isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); - freshSumRipemd160(b, &tmp); - ck_assert(isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); -} -END_TEST - -START_TEST(TestSHA256KnownValue) -{ - typedef struct - { - char* input; - char* output; - } tmpstruct; - - tmpstruct vals[3]; - - vals[0].input = "skycoin"; - vals[0].output = - "5a42c0643bdb465d90bf673b99c14f5fa02db71513249d904573d2b8b63d353d"; - - vals[1].input = "hello world"; - vals[1].output = - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - - vals[2].input = "hello world asd awd awd awdapodawpokawpod "; - vals[2].output = - "99d71f95cafe05ea2dddebc35b6083bd5af0e44850c9dc5139b4476c99950be4"; - int i; - for (i = 0; i < 3; ++i) { - GoSlice slice_input; - GoSlice slice_output; - - slice_input.data = vals[i].input; - slice_input.len = strlen(vals[i].input); - slice_input.cap = strlen(vals[i].input) + 1; - - cipher__SHA256 sha; - - SKY_cipher_SumSHA256(slice_input, &sha); - - char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ tmp_output = { - .p = raw_buf, - .n = sizeof(raw_buf) - }; - - SKY_cipher_SHA256_Hex(&sha, &tmp_output); - registerMemCleanup((void*)tmp_output.p); - - ck_assert_str_eq(tmp_output.p, vals[i].output); - } -} -END_TEST - -START_TEST(TestSumSHA256) -{ - unsigned char bbuff[257], cbuff[257]; - GoSlice b = {bbuff, 0, 257}; - cipher__SHA256 h1; - randBytes(&b, 256); - SKY_cipher_SumSHA256(b, &h1); - cipher__SHA256 tmp; - ck_assert(!isU8Eq(h1, tmp, 32)); - GoSlice c = {cbuff, 0, 257}; - randBytes(&c, 256); - cipher__SHA256 h2; - SKY_cipher_SumSHA256(c, &h2); - ck_assert(!isU8Eq(h1, tmp, 32)); - cipher__SHA256 tmp_h2; - freshSumSHA256(c, &tmp_h2); - ck_assert(isU8Eq(h2, tmp_h2, 32)); -} -END_TEST - -START_TEST(TestSHA256Hex) -{ - cipher__SHA256 h; - unsigned char buff[101]; - GoSlice slice = {buff, 0, 101}; - int error; - - memset(&h, 0, sizeof(h)); - randBytes(&slice, 32); - SKY_cipher_SHA256_Set(&h, slice); - char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ s = { - .p = raw_buf, - .n = sizeof(raw_buf) - }; - - SKY_cipher_SHA256_Hex(&h, &s); - registerMemCleanup((void*)s.p); - - cipher__SHA256 h2; - GoString tmpS = {.p = s.p, .n = s.n}; - error = SKY_cipher_SHA256FromHex(tmpS, &h2); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, h2, 32)); - - char raw_buf2[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ s2 = { - .p = raw_buf2, - .n = sizeof(raw_buf2) - }; - SKY_cipher_SHA256_Hex(&h2, &s2); - registerMemCleanup((void*)s2.p); - ck_assert_str_eq(s.p, s2.p); -} -END_TEST - -START_TEST(TestSHA256Set) -{ - cipher__SHA256 h; - unsigned char buff[101]; - GoSlice slice = {buff, 0, 101}; - int error; - - randBytes(&slice, 33); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 100); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 31); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 0); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 32); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, slice.data, 32)); -} -END_TEST - -START_TEST(TestSHA256FromHex) -{ - unsigned int error; - cipher__SHA256 tmp; - // Invalid hex hash - GoString tmp_string = {"cawcd", 5}; - error = SKY_cipher_SHA256FromHex(tmp_string, &tmp); - ck_assert(error == SKY_ERROR); - // Truncated hex hash - cipher__SHA256 h; - unsigned char buff[130]; - char sbuff[300]; - GoSlice slice = {buff, 0, 130}; - randBytes(&slice, 128); - SKY_cipher_SumSHA256(slice, &h); - bytesnhex(h, sbuff, sizeof(h) >> 1); - GoString s1 = {sbuff, strlen(sbuff)}; - error = SKY_cipher_SHA256FromHex(s1, &h); - ck_assert(error == SKY_ErrInvalidHexLength); - - // Valid hex hash - char buf[33] = {0}; - GoString_ s2 = {.p = buf, .n = 0}; - SKY_cipher_SHA256_Hex(&h, &s2); - cipher__SHA256 h2; - GoString tmps2 = {s2.p, s2.n}; - error = SKY_cipher_SHA256FromHex(tmps2, &h2); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, h2, 32)); -} -END_TEST - -START_TEST(TestSHA256Null) -{ - cipher__SHA256 x; - memset(&x, 0, sizeof(cipher__SHA256)); - GoUint32 result; - GoUint8 isNull; - ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); - ck_assert(isNull); - char buff[130]; - GoSlice b = {buff, 0, 129}; - randBytes(&b, 128); - ck_assert(SKY_cipher_SumSHA256(b, &x) == SKY_OK); - ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); - ck_assert(isNull == 0); -} -END_TEST - -// define test suite and cases -Suite *common_check_cipher_hash(void) -{ - Suite *s = suite_create("Load common check_cipher.hash"); - TCase *tc; - - tc = tcase_create("check_cipher.hash"); - tcase_add_test(tc, TestAddSHA256); - tcase_add_test(tc, TestHashRipemd160); - tcase_add_test(tc, TestSHA256KnownValue); - tcase_add_test(tc, TestSumSHA256); - tcase_add_test(tc, TestSHA256Hex); - tcase_add_test(tc, TestSHA256Set); - tcase_add_test(tc, TestSHA256FromHex); - tcase_add_test(tc, TestSHA256Null); - suite_add_tcase(s, tc); - tcase_set_timeout(tc, 150); - - return s; -} diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 40a48cd61..3fa478b7f 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + mkdir -p build cd build #echo "brew --prefix curl" From ce98d66b1f2d2aa4c701ec35f8f08bea594c6f7b Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 19:07:21 -0400 Subject: [PATCH 73/96] [curl] refs #51 Install curl with installation prefix --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e1128d13e..53079d8f6 100644 --- a/Makefile +++ b/Makefile @@ -184,11 +184,7 @@ install-deps-skyapi-Darwin: export LDFLAGS="-L/usr/local/opt/curl/lib" export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps - brew install openssl -# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) - brew update - brew install curl -# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure --prefix=/usr/local/curl && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From c2d80ae2d58a4ec0314a5d257f3fa340193956d1 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:07:31 -0400 Subject: [PATCH 74/96] install libcurl 65 with cmake ref #51 --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e1128d13e..44ff01ac3 100644 --- a/Makefile +++ b/Makefile @@ -185,9 +185,7 @@ install-deps-skyapi-Darwin: export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps brew install openssl -# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) - brew update - brew install curl + (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xvf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ && make && sudo make install) # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 7d9e9f36e5edbe1b7f935fe47ed15b5aca0b03f8 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:32:38 -0400 Subject: [PATCH 75/96] unstar without vervose and fix cmake source tree for libcurl ref #51 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44ff01ac3..58a716eef 100644 --- a/Makefile +++ b/Makefile @@ -185,7 +185,7 @@ install-deps-skyapi-Darwin: export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps brew install openssl - (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xvf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. && make && sudo make install) # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 79ca18464c5c399723b9787464d53f330c2fd070 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:32:51 -0400 Subject: [PATCH 76/96] Revert "[merge] refs #51 Quit cipher hash" This reverts commit 2a1465aaf18c7957226632708eb9b76da9e267c6. ref #51 --- lib/cgo/tests/check_cipher.hash.common.c | 274 +++++++++++++++++++++++ lib/curl/install_lib_curl.sh | 2 - 2 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 lib/cgo/tests/check_cipher.hash.common.c diff --git a/lib/cgo/tests/check_cipher.hash.common.c b/lib/cgo/tests/check_cipher.hash.common.c new file mode 100644 index 000000000..7c0967762 --- /dev/null +++ b/lib/cgo/tests/check_cipher.hash.common.c @@ -0,0 +1,274 @@ +#include +#include + +#include +#include "libskycoin.h" +#include "skyerrors.h" +#include "skyassert.h" +#include "skystring.h" +#include "skytest.h" + +// TestSuite(cipher_hash, .init = setup, .fini = teardown); + +void freshSumRipemd160(GoSlice bytes, cipher__Ripemd160* rp160) +{ + SKY_cipher_HashRipemd160(bytes, rp160); +} + +void freshSumSHA256(GoSlice bytes, cipher__SHA256* sha256) +{ + SKY_cipher_SumSHA256(bytes, sha256); +} + +START_TEST(TestAddSHA256) +{ + + unsigned char bbuff[130]; + GoSlice b = {bbuff, 0, 130}; + randBytes(&b, 128); + cipher__SHA256 h; + SKY_cipher_SumSHA256(b, &h); + + unsigned char cbuff[130]; + GoSlice c = {cbuff, 0, 130}; + randBytes(&c, 64); + cipher__SHA256 i; + SKY_cipher_SumSHA256(c, &i); + + cipher__SHA256 add; + cipher__SHA256 tmp; + + SKY_cipher_AddSHA256(&h, &i, &add); + ck_assert(!isU8Eq(add, tmp, 32)); + ck_assert(!isU8Eq(add, h, 32)); + ck_assert(!isU8Eq(add, i, 32)); +} +END_TEST + +START_TEST(TestHashRipemd160) +{ + cipher__Ripemd160 tmp; + cipher__Ripemd160 r; + cipher__Ripemd160 r2; + unsigned char buff[257]; + GoSlice slice = {buff, 0, 257}; + + randBytes(&slice, 128); + SKY_cipher_HashRipemd160(slice, &tmp); + randBytes(&slice, 160); + SKY_cipher_HashRipemd160(slice, &r); + ck_assert(!isU8Eq(tmp, r, sizeof(cipher__Ripemd160))); + + unsigned char buff1[257]; + GoSlice b = {buff1, 0, 257}; + randBytes(&b, 256); + SKY_cipher_HashRipemd160(b, &r2); + ck_assert(!isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); + freshSumRipemd160(b, &tmp); + ck_assert(isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); +} +END_TEST + +START_TEST(TestSHA256KnownValue) +{ + typedef struct + { + char* input; + char* output; + } tmpstruct; + + tmpstruct vals[3]; + + vals[0].input = "skycoin"; + vals[0].output = + "5a42c0643bdb465d90bf673b99c14f5fa02db71513249d904573d2b8b63d353d"; + + vals[1].input = "hello world"; + vals[1].output = + "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; + + vals[2].input = "hello world asd awd awd awdapodawpokawpod "; + vals[2].output = + "99d71f95cafe05ea2dddebc35b6083bd5af0e44850c9dc5139b4476c99950be4"; + int i; + for (i = 0; i < 3; ++i) { + GoSlice slice_input; + GoSlice slice_output; + + slice_input.data = vals[i].input; + slice_input.len = strlen(vals[i].input); + slice_input.cap = strlen(vals[i].input) + 1; + + cipher__SHA256 sha; + + SKY_cipher_SumSHA256(slice_input, &sha); + + char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ tmp_output = { + .p = raw_buf, + .n = sizeof(raw_buf) + }; + + SKY_cipher_SHA256_Hex(&sha, &tmp_output); + registerMemCleanup((void*)tmp_output.p); + + ck_assert_str_eq(tmp_output.p, vals[i].output); + } +} +END_TEST + +START_TEST(TestSumSHA256) +{ + unsigned char bbuff[257], cbuff[257]; + GoSlice b = {bbuff, 0, 257}; + cipher__SHA256 h1; + randBytes(&b, 256); + SKY_cipher_SumSHA256(b, &h1); + cipher__SHA256 tmp; + ck_assert(!isU8Eq(h1, tmp, 32)); + GoSlice c = {cbuff, 0, 257}; + randBytes(&c, 256); + cipher__SHA256 h2; + SKY_cipher_SumSHA256(c, &h2); + ck_assert(!isU8Eq(h1, tmp, 32)); + cipher__SHA256 tmp_h2; + freshSumSHA256(c, &tmp_h2); + ck_assert(isU8Eq(h2, tmp_h2, 32)); +} +END_TEST + +START_TEST(TestSHA256Hex) +{ + cipher__SHA256 h; + unsigned char buff[101]; + GoSlice slice = {buff, 0, 101}; + int error; + + memset(&h, 0, sizeof(h)); + randBytes(&slice, 32); + SKY_cipher_SHA256_Set(&h, slice); + char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ s = { + .p = raw_buf, + .n = sizeof(raw_buf) + }; + + SKY_cipher_SHA256_Hex(&h, &s); + registerMemCleanup((void*)s.p); + + cipher__SHA256 h2; + GoString tmpS = {.p = s.p, .n = s.n}; + error = SKY_cipher_SHA256FromHex(tmpS, &h2); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, h2, 32)); + + char raw_buf2[sizeof(cipher__SHA256) * 2 + 1] = {0}; + GoString_ s2 = { + .p = raw_buf2, + .n = sizeof(raw_buf2) + }; + SKY_cipher_SHA256_Hex(&h2, &s2); + registerMemCleanup((void*)s2.p); + ck_assert_str_eq(s.p, s2.p); +} +END_TEST + +START_TEST(TestSHA256Set) +{ + cipher__SHA256 h; + unsigned char buff[101]; + GoSlice slice = {buff, 0, 101}; + int error; + + randBytes(&slice, 33); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 100); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 31); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 0); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_ErrInvalidLengthSHA256); + + randBytes(&slice, 32); + error = SKY_cipher_SHA256_Set(&h, slice); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, slice.data, 32)); +} +END_TEST + +START_TEST(TestSHA256FromHex) +{ + unsigned int error; + cipher__SHA256 tmp; + // Invalid hex hash + GoString tmp_string = {"cawcd", 5}; + error = SKY_cipher_SHA256FromHex(tmp_string, &tmp); + ck_assert(error == SKY_ERROR); + // Truncated hex hash + cipher__SHA256 h; + unsigned char buff[130]; + char sbuff[300]; + GoSlice slice = {buff, 0, 130}; + randBytes(&slice, 128); + SKY_cipher_SumSHA256(slice, &h); + bytesnhex(h, sbuff, sizeof(h) >> 1); + GoString s1 = {sbuff, strlen(sbuff)}; + error = SKY_cipher_SHA256FromHex(s1, &h); + ck_assert(error == SKY_ErrInvalidHexLength); + + // Valid hex hash + char buf[33] = {0}; + GoString_ s2 = {.p = buf, .n = 0}; + SKY_cipher_SHA256_Hex(&h, &s2); + cipher__SHA256 h2; + GoString tmps2 = {s2.p, s2.n}; + error = SKY_cipher_SHA256FromHex(tmps2, &h2); + ck_assert(error == SKY_OK); + ck_assert(isU8Eq(h, h2, 32)); +} +END_TEST + +START_TEST(TestSHA256Null) +{ + cipher__SHA256 x; + memset(&x, 0, sizeof(cipher__SHA256)); + GoUint32 result; + GoUint8 isNull; + ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); + ck_assert(isNull); + char buff[130]; + GoSlice b = {buff, 0, 129}; + randBytes(&b, 128); + ck_assert(SKY_cipher_SumSHA256(b, &x) == SKY_OK); + ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); + ck_assert(isNull == 0); +} +END_TEST + +// define test suite and cases +Suite *common_check_cipher_hash(void) +{ + Suite *s = suite_create("Load common check_cipher.hash"); + TCase *tc; + + tc = tcase_create("check_cipher.hash"); + tcase_add_test(tc, TestAddSHA256); + tcase_add_test(tc, TestHashRipemd160); + tcase_add_test(tc, TestSHA256KnownValue); + tcase_add_test(tc, TestSumSHA256); + tcase_add_test(tc, TestSHA256Hex); + tcase_add_test(tc, TestSHA256Set); + tcase_add_test(tc, TestSHA256FromHex); + tcase_add_test(tc, TestSHA256Null); + suite_add_tcase(s, tc); + tcase_set_timeout(tc, 150); + + return s; +} diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index f334c68c8..d79be9ac7 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - mkdir -p build cd build #echo "brew --prefix curl" From 1c2c6f158ef58f433f019cfc201daa3d83b9a533 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:34:34 -0400 Subject: [PATCH 77/96] Revert "match exact version for curl package ref #51" This reverts commit e8468ccd5a4f75347b7855a7a0356ed4061b3a77. Conflicts: lib/curl/CMakeLists.txt lib/curl/install_lib_curl.sh ref #51 --- .travis.yml | 1 - lib/cgo/tests/check_cipher.hash.common.c | 274 ----------------------- 2 files changed, 275 deletions(-) delete mode 100644 lib/cgo/tests/check_cipher.hash.common.c diff --git a/.travis.yml b/.travis.yml index 86a0639e9..be62e1e2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,6 @@ install: - make install-deps-libc - make install-deps-skyapi script: - - make build-skyapi - make lint - make test-libc - make lint-libc diff --git a/lib/cgo/tests/check_cipher.hash.common.c b/lib/cgo/tests/check_cipher.hash.common.c deleted file mode 100644 index 7c0967762..000000000 --- a/lib/cgo/tests/check_cipher.hash.common.c +++ /dev/null @@ -1,274 +0,0 @@ -#include -#include - -#include -#include "libskycoin.h" -#include "skyerrors.h" -#include "skyassert.h" -#include "skystring.h" -#include "skytest.h" - -// TestSuite(cipher_hash, .init = setup, .fini = teardown); - -void freshSumRipemd160(GoSlice bytes, cipher__Ripemd160* rp160) -{ - SKY_cipher_HashRipemd160(bytes, rp160); -} - -void freshSumSHA256(GoSlice bytes, cipher__SHA256* sha256) -{ - SKY_cipher_SumSHA256(bytes, sha256); -} - -START_TEST(TestAddSHA256) -{ - - unsigned char bbuff[130]; - GoSlice b = {bbuff, 0, 130}; - randBytes(&b, 128); - cipher__SHA256 h; - SKY_cipher_SumSHA256(b, &h); - - unsigned char cbuff[130]; - GoSlice c = {cbuff, 0, 130}; - randBytes(&c, 64); - cipher__SHA256 i; - SKY_cipher_SumSHA256(c, &i); - - cipher__SHA256 add; - cipher__SHA256 tmp; - - SKY_cipher_AddSHA256(&h, &i, &add); - ck_assert(!isU8Eq(add, tmp, 32)); - ck_assert(!isU8Eq(add, h, 32)); - ck_assert(!isU8Eq(add, i, 32)); -} -END_TEST - -START_TEST(TestHashRipemd160) -{ - cipher__Ripemd160 tmp; - cipher__Ripemd160 r; - cipher__Ripemd160 r2; - unsigned char buff[257]; - GoSlice slice = {buff, 0, 257}; - - randBytes(&slice, 128); - SKY_cipher_HashRipemd160(slice, &tmp); - randBytes(&slice, 160); - SKY_cipher_HashRipemd160(slice, &r); - ck_assert(!isU8Eq(tmp, r, sizeof(cipher__Ripemd160))); - - unsigned char buff1[257]; - GoSlice b = {buff1, 0, 257}; - randBytes(&b, 256); - SKY_cipher_HashRipemd160(b, &r2); - ck_assert(!isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); - freshSumRipemd160(b, &tmp); - ck_assert(isU8Eq(tmp, r2, sizeof(cipher__Ripemd160))); -} -END_TEST - -START_TEST(TestSHA256KnownValue) -{ - typedef struct - { - char* input; - char* output; - } tmpstruct; - - tmpstruct vals[3]; - - vals[0].input = "skycoin"; - vals[0].output = - "5a42c0643bdb465d90bf673b99c14f5fa02db71513249d904573d2b8b63d353d"; - - vals[1].input = "hello world"; - vals[1].output = - "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"; - - vals[2].input = "hello world asd awd awd awdapodawpokawpod "; - vals[2].output = - "99d71f95cafe05ea2dddebc35b6083bd5af0e44850c9dc5139b4476c99950be4"; - int i; - for (i = 0; i < 3; ++i) { - GoSlice slice_input; - GoSlice slice_output; - - slice_input.data = vals[i].input; - slice_input.len = strlen(vals[i].input); - slice_input.cap = strlen(vals[i].input) + 1; - - cipher__SHA256 sha; - - SKY_cipher_SumSHA256(slice_input, &sha); - - char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ tmp_output = { - .p = raw_buf, - .n = sizeof(raw_buf) - }; - - SKY_cipher_SHA256_Hex(&sha, &tmp_output); - registerMemCleanup((void*)tmp_output.p); - - ck_assert_str_eq(tmp_output.p, vals[i].output); - } -} -END_TEST - -START_TEST(TestSumSHA256) -{ - unsigned char bbuff[257], cbuff[257]; - GoSlice b = {bbuff, 0, 257}; - cipher__SHA256 h1; - randBytes(&b, 256); - SKY_cipher_SumSHA256(b, &h1); - cipher__SHA256 tmp; - ck_assert(!isU8Eq(h1, tmp, 32)); - GoSlice c = {cbuff, 0, 257}; - randBytes(&c, 256); - cipher__SHA256 h2; - SKY_cipher_SumSHA256(c, &h2); - ck_assert(!isU8Eq(h1, tmp, 32)); - cipher__SHA256 tmp_h2; - freshSumSHA256(c, &tmp_h2); - ck_assert(isU8Eq(h2, tmp_h2, 32)); -} -END_TEST - -START_TEST(TestSHA256Hex) -{ - cipher__SHA256 h; - unsigned char buff[101]; - GoSlice slice = {buff, 0, 101}; - int error; - - memset(&h, 0, sizeof(h)); - randBytes(&slice, 32); - SKY_cipher_SHA256_Set(&h, slice); - char raw_buf[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ s = { - .p = raw_buf, - .n = sizeof(raw_buf) - }; - - SKY_cipher_SHA256_Hex(&h, &s); - registerMemCleanup((void*)s.p); - - cipher__SHA256 h2; - GoString tmpS = {.p = s.p, .n = s.n}; - error = SKY_cipher_SHA256FromHex(tmpS, &h2); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, h2, 32)); - - char raw_buf2[sizeof(cipher__SHA256) * 2 + 1] = {0}; - GoString_ s2 = { - .p = raw_buf2, - .n = sizeof(raw_buf2) - }; - SKY_cipher_SHA256_Hex(&h2, &s2); - registerMemCleanup((void*)s2.p); - ck_assert_str_eq(s.p, s2.p); -} -END_TEST - -START_TEST(TestSHA256Set) -{ - cipher__SHA256 h; - unsigned char buff[101]; - GoSlice slice = {buff, 0, 101}; - int error; - - randBytes(&slice, 33); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 100); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 31); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 0); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_ErrInvalidLengthSHA256); - - randBytes(&slice, 32); - error = SKY_cipher_SHA256_Set(&h, slice); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, slice.data, 32)); -} -END_TEST - -START_TEST(TestSHA256FromHex) -{ - unsigned int error; - cipher__SHA256 tmp; - // Invalid hex hash - GoString tmp_string = {"cawcd", 5}; - error = SKY_cipher_SHA256FromHex(tmp_string, &tmp); - ck_assert(error == SKY_ERROR); - // Truncated hex hash - cipher__SHA256 h; - unsigned char buff[130]; - char sbuff[300]; - GoSlice slice = {buff, 0, 130}; - randBytes(&slice, 128); - SKY_cipher_SumSHA256(slice, &h); - bytesnhex(h, sbuff, sizeof(h) >> 1); - GoString s1 = {sbuff, strlen(sbuff)}; - error = SKY_cipher_SHA256FromHex(s1, &h); - ck_assert(error == SKY_ErrInvalidHexLength); - - // Valid hex hash - char buf[33] = {0}; - GoString_ s2 = {.p = buf, .n = 0}; - SKY_cipher_SHA256_Hex(&h, &s2); - cipher__SHA256 h2; - GoString tmps2 = {s2.p, s2.n}; - error = SKY_cipher_SHA256FromHex(tmps2, &h2); - ck_assert(error == SKY_OK); - ck_assert(isU8Eq(h, h2, 32)); -} -END_TEST - -START_TEST(TestSHA256Null) -{ - cipher__SHA256 x; - memset(&x, 0, sizeof(cipher__SHA256)); - GoUint32 result; - GoUint8 isNull; - ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); - ck_assert(isNull); - char buff[130]; - GoSlice b = {buff, 0, 129}; - randBytes(&b, 128); - ck_assert(SKY_cipher_SumSHA256(b, &x) == SKY_OK); - ck_assert(SKY_cipher_SHA256_Null(&x, &isNull) == SKY_OK); - ck_assert(isNull == 0); -} -END_TEST - -// define test suite and cases -Suite *common_check_cipher_hash(void) -{ - Suite *s = suite_create("Load common check_cipher.hash"); - TCase *tc; - - tc = tcase_create("check_cipher.hash"); - tcase_add_test(tc, TestAddSHA256); - tcase_add_test(tc, TestHashRipemd160); - tcase_add_test(tc, TestSHA256KnownValue); - tcase_add_test(tc, TestSumSHA256); - tcase_add_test(tc, TestSHA256Hex); - tcase_add_test(tc, TestSHA256Set); - tcase_add_test(tc, TestSHA256FromHex); - tcase_add_test(tc, TestSHA256Null); - suite_add_tcase(s, tc); - tcase_set_timeout(tc, 150); - - return s; -} From 4c259f939678f150220ba8380978797aaadc4d1e Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:38:15 -0400 Subject: [PATCH 78/96] fix after revet in 1c2c6f158ef58f433f019cfc201daa3d83b9a533 and 79ca18464c5c399723b9787464d53f330c2fd070 ref #51 --- .travis.yml | 1 + lib/curl/install_lib_curl.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index be62e1e2b..86a0639e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ install: - make install-deps-libc - make install-deps-skyapi script: + - make build-skyapi - make lint - make test-libc - make lint-libc diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index d79be9ac7..f334c68c8 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + mkdir -p build cd build #echo "brew --prefix curl" From b7c84ac546c6da530daba1f9e5a5aab42908b688 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 19:56:30 -0400 Subject: [PATCH 79/96] set openssl path ref #51 --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 58a716eef..a9d6b54ec 100644 --- a/Makefile +++ b/Makefile @@ -185,7 +185,9 @@ install-deps-skyapi-Darwin: export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps brew install openssl - (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. && make && sudo make install) + brew --prefix openssl + brew ls --verbose openssl + (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) # (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From a065c3f9aa1367791137add33478511754a7182c Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Thu, 23 May 2019 20:16:50 -0400 Subject: [PATCH 80/96] finally install curl with cmake from sources ref #51 --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a9d6b54ec..ee6db7a64 100644 --- a/Makefile +++ b/Makefile @@ -185,10 +185,8 @@ install-deps-skyapi-Darwin: export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps brew install openssl - brew --prefix openssl - brew ls --verbose openssl + #FIXME brew --prefix openssl fix with this instead of /usr/local/opt/openssl https://travis-ci.com/skycoin/libskycoin/jobs/202706851#L2049 (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) -# (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir -p build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/Cellar/openssl/1.0.2l" .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) From 74b6eae5b6deb375584f675065f35b3af524d7ee Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 23 May 2019 21:08:42 -0400 Subject: [PATCH 81/96] [gcc] refs #51 Install specific gcc --- lib/curl/install_lib_curl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index f334c68c8..59d27e8da 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -7,7 +7,7 @@ cd build #echo "brew ls --verbose curl" #brew ls --verbose curl # for normal install use following command -cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. +cmake -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_VERBOSE_MAKEFILE=ON .. make sudo make install From c8b5b07345c103827eaf384476e9a8c7be41f27a Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Thu, 23 May 2019 22:18:50 -0400 Subject: [PATCH 82/96] [ci] refs #51 - Install osx deps with brew Packages openssl, curl, uncrustify. --- Makefile | 7 +++---- lib/curl/install_lib_curl.sh | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ee6db7a64..f3aeb61a7 100644 --- a/Makefile +++ b/Makefile @@ -179,19 +179,18 @@ install-deps-skyapi-Linux: sudo apt-get install libcurl3-gnutls sudo apt remove curl (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xvf curl-7.58.0.tar.gz && cd curl-7.58.0/ && ./configure && make && sudo make install) + (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-skyapi-Darwin: export LDFLAGS="-L/usr/local/opt/curl/lib" export CPPFLAGS="-I/usr/local/opt/curl/include" mkdir -p deps - brew install openssl - #FIXME brew --prefix openssl fix with this instead of /usr/local/opt/openssl https://travis-ci.com/skycoin/libskycoin/jobs/202706851#L2049 - (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) + brew update + brew install openssl curl uncrustify || true install-deps-libc: install-deps-libc-$(OSNAME) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. - (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index 59d27e8da..b278c71e0 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -7,7 +7,7 @@ cd build #echo "brew ls --verbose curl" #brew ls --verbose curl # for normal install use following command -cmake -DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6 -DCMAKE_VERBOSE_MAKEFILE=ON .. +cmake -DCMAKE_VERBOSE_MAKEFILE=ON .. make sudo make install From e3946c2ddc2fcef7d1ad5b645717829437e24901 Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Fri, 24 May 2019 11:46:13 -0400 Subject: [PATCH 83/96] refactor in cmake to use good practices 51 --- Makefile | 2 +- lib/curl/CMakeLists.txt | 125 +++++++++++++++++++--------------------- 2 files changed, 60 insertions(+), 67 deletions(-) diff --git a/Makefile b/Makefile index ee6db7a64..f852af87d 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ install-deps-skyapi-Darwin: mkdir -p deps brew install openssl #FIXME brew --prefix openssl fix with this instead of /usr/local/opt/openssl https://travis-ci.com/skycoin/libskycoin/jobs/202706851#L2049 - (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index 93d2b57a3..cfb4e66a9 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 2.6) -project (CGenerator) +cmake_minimum_required(VERSION 2.6) +project(CGenerator) cmake_policy(SET CMP0063 NEW) @@ -10,84 +10,77 @@ set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") -find_package(CURL 7.58.0 REQUIRED) -if(CURL_FOUND) - include_directories(${CURL_INCLUDE_DIR}) - set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${CURL_LIBRARIES} ) -else(CURL_FOUND) - message(FATAL_ERROR "Could not find the CURL library and development files.") -endif() +find_package(CURL 7.58.0 EXACT REQUIRED) set(SRCS - src/list.c - src/apiKey.c - src/apiClient.c - external/cJSON.c - model/_api_v1_explorer_address_inputs.c - model/_api_v1_explorer_address_outputs.c - model/_api_v1_explorer_address_status.c - model/_api_v1_pending_txs_transaction.c - model/_api_v1_wallet_transaction_hours_selection.c - model/_api_v1_wallet_transaction_to.c - model/_api_v1_wallet_transaction_wallet.c - model/_api_v1_wallets_entries.c - model/_api_v1_wallets_meta.c - model/inline_object.c - model/inline_response_200.c - model/inline_response_200_1.c - model/inline_response_200_2.c - model/inline_response_200_3.c - model/inline_response_200_3_unconfirmed_verify_transaction.c - model/inline_response_200_4.c - model/inline_response_200_5.c - model/inline_response_200_6.c - model/inline_response_200_7.c - model/inline_response_200_7_data.c - model/inline_response_default.c - api/DefaultAPI.c - + ${CMAKE_CURRENT_SOURCE_DIR}/src/list.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/apiKey.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/apiClient.c + ${CMAKE_CURRENT_SOURCE_DIR}/external/cJSON.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_inputs.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_outputs.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_status.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_pending_txs_transaction.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_hours_selection.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_to.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_2.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3_unconfirmed_verify_transaction.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_4.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_5.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_6.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7_data.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_default.c + ${CMAKE_CURRENT_SOURCE_DIR}/api/DefaultAPI.c ) set(HDRS - include/apiClient.h - include/list.h - include/keyValuePair.h - external/cJSON.h - model/_api_v1_explorer_address_inputs.h - model/_api_v1_explorer_address_outputs.h - model/_api_v1_explorer_address_status.h - model/_api_v1_pending_txs_transaction.h - model/_api_v1_wallet_transaction_hours_selection.h - model/_api_v1_wallet_transaction_to.h - model/_api_v1_wallet_transaction_wallet.h - model/_api_v1_wallets_entries.h - model/_api_v1_wallets_meta.h - model/inline_object.h - model/inline_response_200.h - model/inline_response_200_1.h - model/inline_response_200_2.h - model/inline_response_200_3.h - model/inline_response_200_3_unconfirmed_verify_transaction.h - model/inline_response_200_4.h - model/inline_response_200_5.h - model/inline_response_200_6.h - model/inline_response_200_7.h - model/inline_response_200_7_data.h - model/inline_response_default.h - api/DefaultAPI.h - + ${CMAKE_CURRENT_SOURCE_DIR}/include/apiClient.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/list.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/keyValuePair.h + ${CMAKE_CURRENT_SOURCE_DIR}/external/cJSON.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_inputs.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_outputs.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_explorer_address_status.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_pending_txs_transaction.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_hours_selection.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_to.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_2.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_3_unconfirmed_verify_transaction.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_4.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_5.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_6.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_7_data.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_default.h + ${CMAKE_CURRENT_SOURCE_DIR}/api/DefaultAPI.h ) +include_directories(${CURL_INCLUDE_DIR}) # Add library with project file with projectname as library name add_library(${pkgName} SHARED ${SRCS} ${HDRS}) # Link dependent libraries -target_link_libraries(${pkgName} ${CURL_LIBRARIES} ) +target_link_libraries(${pkgName} ${CURL_LIBRARIES}) #install library to destination install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) # Setting file variables to null -set(SRCS "") -set(HDRS "") +#set(SRCS "") +#set(HDRS "") ## This section shows how to use the above compiled libary to compile the source files From 14e252a90afa9ab207be6bc8a3c444072b8c6f6a Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Fri, 24 May 2019 11:48:21 -0400 Subject: [PATCH 84/96] get out the visibility instructions ref #51 --- Makefile | 2 +- lib/curl/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f852af87d..a5e15e878 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ install-deps-skyapi-Darwin: mkdir -p deps brew install openssl #FIXME brew --prefix openssl fix with this instead of /usr/local/opt/openssl https://travis-ci.com/skycoin/libskycoin/jobs/202706851#L2049 - (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) + (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) install-deps-libc: install-deps-libc-$(OSNAME) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index cfb4e66a9..d1fc5f912 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 2.6) project(CGenerator) -cmake_policy(SET CMP0063 NEW) +#cmake_policy(SET CMP0063 NEW) -set(CMAKE_C_VISIBILITY_PRESET default) -set(CMAKE_CXX_VISIBILITY_PRESET default) -set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) +#set(CMAKE_C_VISIBILITY_PRESET default) +#set(CMAKE_CXX_VISIBILITY_PRESET default) +#set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF) set(CMAKE_BUILD_TYPE Debug) set(pkgName "skyapi") From 80472b185589ea29dfe1d98f6541a08f83a1c0da Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Fri, 24 May 2019 12:35:02 -0400 Subject: [PATCH 85/96] verbose buil for swagger curl lib ref #51 --- lib/curl/install_lib_curl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/curl/install_lib_curl.sh b/lib/curl/install_lib_curl.sh index f334c68c8..169dabd02 100755 --- a/lib/curl/install_lib_curl.sh +++ b/lib/curl/install_lib_curl.sh @@ -7,7 +7,8 @@ cd build #echo "brew ls --verbose curl" #brew ls --verbose curl # for normal install use following command -cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. +cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_VERBOSE_MAKEFILE=ON .. +grep -R object_convertToJSON ../../ make sudo make install From 15e4de5c9c87fb3e1a47059b9055440f636cc93a Mon Sep 17 00:00:00 2001 From: Alvaro Denis Date: Fri, 24 May 2019 16:02:20 -0400 Subject: [PATCH 86/96] fix bug from the swagger generator ref #51 --- lib/curl/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/curl/CMakeLists.txt b/lib/curl/CMakeLists.txt index d1fc5f912..62f57701d 100644 --- a/lib/curl/CMakeLists.txt +++ b/lib/curl/CMakeLists.txt @@ -26,6 +26,7 @@ set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.c ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.c ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.c + ${CMAKE_CURRENT_SOURCE_DIR}/model/object.c ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.c ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.c ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.c @@ -55,6 +56,7 @@ set(HDRS ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallet_transaction_wallet.h ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_entries.h ${CMAKE_CURRENT_SOURCE_DIR}/model/_api_v1_wallets_meta.h + ${CMAKE_CURRENT_SOURCE_DIR}/model/object.h ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_object.h ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200.h ${CMAKE_CURRENT_SOURCE_DIR}/model/inline_response_200_1.h From 83bc508ca63e1c981f0b897f07d1d73278c61a9a Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 24 May 2019 17:53:11 -0400 Subject: [PATCH 87/96] [make] refs #51 Working in makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ee6db7a64..22587ea07 100644 --- a/Makefile +++ b/Makefile @@ -188,17 +188,17 @@ install-deps-skyapi-Darwin: #FIXME brew --prefix openssl fix with this instead of /usr/local/opt/openssl https://travis-ci.com/skycoin/libskycoin/jobs/202706851#L2049 (cd deps && wget http://curl.haxx.se/download/curl-7.65.0.tar.gz && tar -xf curl-7.65.0.tar.gz && cd curl-7.65.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) -install-deps-libc: install-deps-libc-$(OSNAME) +install-deps-libc: install-deps-libc-$(UNAME_S) install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. (cd deps && git clone https://github.com/uncrustify/uncrustify.git && cd uncrustify && mkdir build && cd build && cmake .. && make && sudo make install) -install-deps-libc-linux: configure-build ## Install locally dependencies for testing libskycoin +install-deps-libc-Linux: configure-build ## Install locally dependencies for testing libskycoin wget -c https://github.com/libcheck/check/releases/download/0.12.0/check-0.12.0.tar.gz tar -xzf check-0.12.0.tar.gz cd check-0.12.0 && ./configure --prefix=/usr --disable-static && make && sudo make install -install-deps-libc-osx: configure-build ## Install locally dependencies for testing libskycoin +install-deps-libc-Darwin: configure-build ## Install locally dependencies for testing libskycoin brew install check format: ## Formats the code. Must have goimports installed (use make install-linters). From 896a969e8e0912fa816b647340948bde81720b1e Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 24 May 2019 18:02:25 -0400 Subject: [PATCH 88/96] [make] refs #51 update makefile targets --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b17db9533..0743e93d3 100644 --- a/Makefile +++ b/Makefile @@ -204,13 +204,17 @@ install-deps-libc-Darwin: configure-build ## Install locally dependencies for te format: ## Formats the code. Must have goimports installed (use make install-linters). goimports -w -local github.com/skycoin/skycoin ./lib -clean-libc: ## Clean files generate by library +clean-libc: ## Clean files generated by library rm -rfv $(BUILDLIB_DIR) - rm -rfv $(BUILDLIBSKYAPI_DIR) rm -rfv bin rm -rfv qemu_test_libskycoin* rm -rfv include/libskycoin.h +clean-skyapi: ## Clean files generated by skyapi + rm -rfv $(BUILDLIBSKYAPI_DIR) + +clean: clean-libc clean-skyapi ## Clean all files generated by libraries + format-libc: $(PKG_CLANG_FORMAT) -sort-includes -i -assume-filename=.clang-format lib/cgo/tests/*.c $(PKG_CLANG_FORMAT) -sort-includes -i -assume-filename=.clang-format include/*.h From 2d5bd8f0a7d289de37543e57c19057ba865a9231 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 24 May 2019 18:11:31 -0400 Subject: [PATCH 89/96] [doc] refs #51 Fix make targets in makefile --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4fbbe99f8..52548cc67 100644 --- a/README.md +++ b/README.md @@ -46,19 +46,24 @@ All these make rules require skycoin to be a git submodule of libskycoin | :------------- | :----------: | |build-libc-static |Build libskycoin C static library| |build-libc-shared |Build libskycoin C shared library| -|build-libc |Build libskycoin C client libraries| |build |Build all C libraries +|build-libc |Build libskycoin C client libraries| +|build-skyapi |Build skyapi(libcurl based) library| +|test |Run all test for libskycoin| |test-libc |Run tests for libskycoin C client library| +|test-skyapi |Run test for skyapi(libcurl based) library| |docs |Generate documentation for all libraries| |docs-libc |Generate libskycoin documentation| |docs-skyapi |Generate SkyApi (libcurl) documentation| |lint |Run linters. Use make install-linters first.| |check |Run tests and linters| -|install-libraries-deps |Install deps for `lib\curl` wrapper of Skycoin REST API| +|install-deps-skyapi |Install skyapi(libcurl based) library.| |install-linters |Install linters| |format |Formats the code. Must have goimports installed (use make install-linters).| -|clean-libc |Clean files generate by library| - +|clean |Clean all files generated by libraries(libcurl based and libc)| +|clean-libc |Clean files generated by libc| +|clean-skyapi |Clean files generated by skyapi| + ## Development setup ### Running tests @@ -148,8 +153,3 @@ This code example can be found at `include/cipher.bitcoin.go.h`. Inside `/* */` we found struct documentation, meanwhile `//<` symbol is used to describe fields of the struct. After that, run `make docs` for a new docs generation. You can found the api documentation at `docs/libc` folder. - -|build |Build libraries| -|test-skyapi |Run test for skyapi(libcurl based) library| -|test |Run all test for libskycoin| -|install-deps-skyapi |Install skyapi(libcurl based) library.| \ No newline at end of file From ceb9f3661b80e64878a668989d043b274f6d4137 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 24 May 2019 18:12:23 -0400 Subject: [PATCH 90/96] [make] refs #51 Fix make mispelling --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0743e93d3..8ca16fc35 100644 --- a/Makefile +++ b/Makefile @@ -204,13 +204,13 @@ install-deps-libc-Darwin: configure-build ## Install locally dependencies for te format: ## Formats the code. Must have goimports installed (use make install-linters). goimports -w -local github.com/skycoin/skycoin ./lib -clean-libc: ## Clean files generated by library +clean-libc: ## Clean files generated by libc rm -rfv $(BUILDLIB_DIR) rm -rfv bin rm -rfv qemu_test_libskycoin* rm -rfv include/libskycoin.h -clean-skyapi: ## Clean files generated by skyapi +clean-skyapi: ## Clean files generated by skyapi rm -rfv $(BUILDLIBSKYAPI_DIR) clean: clean-libc clean-skyapi ## Clean all files generated by libraries From 8f7873fd44e52f142bdd7e487631c148fd2fa8df Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Fri, 24 May 2019 18:19:55 -0400 Subject: [PATCH 91/96] [docs] refs #51 Refactored some endpoints in readme --- Makefile | 4 +++- README.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8ca16fc35..1e99f24f3 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,7 @@ install-deps-skyapi-Darwin: brew install openssl curl uncrustify || true (cd deps && wget http://curl.haxx.se/download/curl-7.58.0.tar.gz && tar -xf curl-7.58.0.tar.gz && cd curl-7.58.0/ && mkdir build && cd build && cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .. && make && sudo make install) -install-deps-libc: install-deps-libc-$(UNAME_S) +install-deps-libc: install-deps-libc-$(UNAME_S) ## Install deps for libc install-deps-skyapi: install-deps-skyapi-$(UNAME_S) ## Install skyapi(libcurl based) library. @@ -201,6 +201,8 @@ install-deps-libc-Linux: configure-build ## Install locally dependencies for tes install-deps-libc-Darwin: configure-build ## Install locally dependencies for testing libskycoin brew install check +install-deps: install-deps-libc install-deps-skyapi ## Install deps for libc and skyapi + format: ## Formats the code. Must have goimports installed (use make install-linters). goimports -w -local github.com/skycoin/skycoin ./lib diff --git a/README.md b/README.md index 52548cc67..c34961974 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ All these make rules require skycoin to be a git submodule of libskycoin |docs-skyapi |Generate SkyApi (libcurl) documentation| |lint |Run linters. Use make install-linters first.| |check |Run tests and linters| +|install-deps |Install deps for libc and skyapi| +|install-deps-libc |Install deps for libc| |install-deps-skyapi |Install skyapi(libcurl based) library.| |install-linters |Install linters| |format |Formats the code. Must have goimports installed (use make install-linters).| @@ -153,3 +155,4 @@ This code example can be found at `include/cipher.bitcoin.go.h`. Inside `/* */` we found struct documentation, meanwhile `//<` symbol is used to describe fields of the struct. After that, run `make docs` for a new docs generation. You can found the api documentation at `docs/libc` folder. + From 0897796dcd33cd04e3860536c46e04b82383e621 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Fri, 24 May 2019 23:34:54 -0400 Subject: [PATCH 92/96] refs #30 - Update release process docs --- README.md | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c34961974..cbef32f16 100644 --- a/README.md +++ b/README.md @@ -68,33 +68,37 @@ All these make rules require skycoin to be a git submodule of libskycoin ## Development setup - ### Running tests +### Running tests - ```sh - $ make test-libc - ``` +```sh +$ make test-libc +``` + +### Releases - ### Releases +#### Update the version - #### Update the version +0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures) +0. Switch to a new release branch named `release-X.Y.Z` for preparing the release. +0. If the release process needs modifications, edit these steps before moving forward +0. Ensure that the submodule at `vendor/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository. +0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date. +0. Run `make docs` to regenerate documentation for all libraries and ensure they ar up-to-date. +0. Follow the steps in [pre-release testing](#pre-release-testing) +0. Make a PR merging the release branch into `master` +0. Review the PR and merge it +0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release". +0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds). +0. Merge changes in `master` back into `develop` branch to start working towards next stable version. - 0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures) - 0. Switch to a new release branch named `release-X.Y.Z` for preparing the release. - 0. Ensure that the submodule at `gopath/src/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository. - 0. Update `CHANGELOG.md`: move the "unreleased" changes to the version and add the date. - 0. Follow the steps in [pre-release testing](#pre-release-testing) - 0. Make a PR merging the release branch into `master` - 0. Review the PR and merge it - 0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a "release". - 0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds). +#### Pre-release testing - #### Pre-release testing +Perform these actions before releasing: - Perform these actions before releasing: +```sh +make check +``` - ```sh - make check - ``` ## Development We have two branches: `master` and `develop`. From a81f58b92b3df249597133f5e3d60847a0821592 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Fri, 24 May 2019 23:39:53 -0400 Subject: [PATCH 93/96] refs #30 - Update project changelog CHANGELOG prior to 0.25.1 release --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6897545..8224130cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +### Fixed + +### Changed + +### Removed + +## [0.25.1] - 2019-05-24 + +### Added + +- Export functions in Skycoin 0.25.1 core API's - `skyapi` C client for Skycoin node REST at `lib/curl`. - Support for building `libskycoin` on ARM and 32 / 64 bits. @@ -23,11 +34,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Delete function `SKY_base58_String2Hex` - ## [0.25.0] - 2018-12-19 ### Added +- Export functions in Skycoin 0.25.0 core API's - Coinhour burn factor when creating transactions can be configured at runtime with `USER_BURN_FACTOR` envvar - Max transaction size when creating transactions can be configured at runtime with `USER_MAX_TXN_SIZE` envvar - Max decimals allowed when creating transactions can be configured at runtime with `USER_MAX_DECIMALS` envvar From c5f68af0a540b863a5d28fc64e7c88ee3a708842 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Sat, 25 May 2019 00:32:28 -0400 Subject: [PATCH 94/96] [ci] refs #30 - Change current dir before archiving release binaries ... aimed at fixing https://travis-ci.org/skycoin/libskycoin/ --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86a0639e9..be2b4fbd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ before_deploy: - export ARCH="$(uname -m)" - export OS="$(uname -s)" - make build - - tar -c -z -f libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz -C build ./* + - cd build && tar czf ../libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz ./* deploy: - provider: releases api_key: From 3cb637dbd49eb3073d18b25205cc58e2519a28c7 Mon Sep 17 00:00:00 2001 From: Olemis Lang Date: Sat, 25 May 2019 00:55:40 -0400 Subject: [PATCH 95/96] [ci] refs #30 - Fix failed upload to Github Releases due to pwd --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be2b4fbd2..db4b522e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,8 @@ before_deploy: - export ARCH="$(uname -m)" - export OS="$(uname -s)" - make build - - cd build && tar czf ../libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz ./* + - ( cd build && tar czf ../libskycoin-${VERSION}-${OS}-${ARCH}.tar.gz ./* ) + - pwd && ls -l . deploy: - provider: releases api_key: From eef23fbaca0e9b31e5f1708f7e314af861d3c0c5 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Sat, 25 May 2019 08:06:00 -0400 Subject: [PATCH 96/96] [circle] refs #30 Rename folder docker/images/circle/ => docker/images/deploy-arm and change in conf the Circle CI --- .circleci/config.yml | 2 +- docker/images/{circle => deploy-arm}/Dockerfile | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename docker/images/{circle => deploy-arm}/Dockerfile (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index e88ed5d89..44db59e69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,7 +64,7 @@ jobs: - checkout - setup_remote_docker: version: 18.06.0-ce - - run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi + - run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/deploy-arm/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi workflows: diff --git a/docker/images/circle/Dockerfile b/docker/images/deploy-arm/Dockerfile similarity index 100% rename from docker/images/circle/Dockerfile rename to docker/images/deploy-arm/Dockerfile