Skip to content

Commit

Permalink
Stable 6.0.10 backports (#59)
Browse files Browse the repository at this point in the history
* updated TestParseNode to work with go v1.12.8 (#42)

* Closes #46 update mainnet bootnodes list (#45)

* Windows build fix and makefile update (#48)

* Makefile: allow building windows binaries

* circleci/config: add windows build and release steps

* Makefile: allow building macos binaries

* circleci/config: add darwin build and release steps

* Fixed for windows

* Remove default env variable and update chainconfig

* Fix circliCI build

* Added back platform specific building assume will be needed for release binary gen

* Updated CI to use mac build

* Remove cross compiling from CI workflow, refactored makefile

* Changed binary compression to zip for windows

* ecrecover edge case chains fix (#58)

* Added edge case test and refactored logic

* Wip specific tests still failing

* Update invalid tests to use actual invalid chainid

@austinabell made this change
  • Loading branch information
soc1c committed Oct 21, 2019
1 parent 72c72b6 commit 69d8ab8
Show file tree
Hide file tree
Showing 14 changed files with 515 additions and 191 deletions.
136 changes: 135 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ jobs:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
build-darwin-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Compile Binaries
command: make mac/build
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
build-windows-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Compile Binaries
command: make win/build
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
tests-linux-go-1.12:
working_directory: ~/go-ethereum
docker:
Expand Down Expand Up @@ -46,7 +78,7 @@ jobs:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Compile Binaries
command: make build
command: make lin/build
- run:
name: Release Artifacts
command: |
Expand All @@ -73,6 +105,82 @@ jobs:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
release-darwin-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Compile Binaries
command: make mac/build
- run:
name: Release Binaries
command: |
pushd ./bin/
sha256sum ./abigen > ./abigen.sha256
sha256sum ./bootnode > ./bootnode.sha256
sha256sum ./disasm > ./disasm.sha256
sha256sum ./ethtest > ./ethtest.sha256
sha256sum ./evm > ./evm.sha256
sha256sum ./geth > ./geth.sha256
sha256sum ./rlpdump > ./rlpdump.sha256
popd
mkdir ./artifacts/
cp -rv ./bin ./geth-classic-${VERSION}-darwin
tar -zcvf geth-classic-${VERSION}-darwin.tar.gz geth-classic-${VERSION}-darwin
cp -v ./geth-classic-${VERSION}-darwin.tar.gz ./artifacts/
pushd ./artifacts
sha256sum ./geth-classic-${VERSION}-darwin.tar.gz > ./geth-classic-${VERSION}-darwin.sha256
popd
- store_artifacts:
path: ~/go-ethereum/artifacts
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
release-windows-go-1.12:
working_directory: ~/go-ethereum
docker:
- image: circleci/golang:1.12
steps:
- checkout
- restore_cache:
keys:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Compile Binaries
command: make win/build
- run:
name: Release Artifacts
command: |
pushd ./bin/
sha256sum ./abigen.exe > ./abigen.exe.sha256
sha256sum ./bootnode.exe > ./bootnode.exe.sha256
sha256sum ./disasm.exe > ./disasm.exe.sha256
sha256sum ./ethtest.exe > ./ethtest.exe.sha256
sha256sum ./evm.exe > ./evm.exe.sha256
sha256sum ./geth.exe > ./geth.exe.sha256
sha256sum ./rlpdump.exe > ./rlpdump.exe.sha256
popd
mkdir ./artifacts/
VERSION=$(bin/geth version | grep -i version | head -n1 | awk '{print $2}')
rm ./bin/geth
cp -rv ./bin ./geth-classic-${VERSION}-windows
zip geth-classic-${VERSION}-windows.zip geth-classic-${VERSION}-windows
cp -v ./geth-classic-${VERSION}-windows.zip ./artifacts/
pushd ./artifacts
sha256sum ./geth-classic-${VERSION}-windows.zip > ./geth-classic-${VERSION}-windows.sha256
popd
- store_artifacts:
path: ~/go-ethereum/artifacts
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"

workflows:
version: 2
Expand All @@ -82,6 +190,14 @@ workflows:
filters:
tags:
only: /.*/
# - build-darwin-go-1.12:
# filters:
# tags:
# only: /.*/
# - build-windows-go-1.12:
# filters:
# tags:
# only: /.*/
- tests-linux-go-1.12:
requires:
- build-linux-go-1.12
Expand All @@ -96,3 +212,21 @@ workflows:
only: /^v.*/
branches:
ignore: /.*/
# - release-darwin-go-1.12:
# requires:
# - build-darwin-go-1.12
# - tests-linux-go-1.12
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/
# - release-windows-go-1.12:
# requires:
# - build-windows-go-1.12
# - tests-linux-go-1.12
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/
82 changes: 71 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ TEST_PATTERN?=.
TEST_OPTIONS?=-race

GO_MOD=GO111MODULE=on
LINFLAGS=GOOS=linux GOARCH=amd64
WINFLAGS=GOOS=windows GOARCH=amd64
MACFLAGS=GOOS=darwin GOARCH=amd64
LDFLAGS=-ldflags "-X main.Version="`git describe --tags`

SETMACFLAGS=$(eval BUILDFLAGS=${MACFLAGS})
SETLINFLAGS=$(eval BUILDFLAGS=${LINFLAGS})

BINARY=bin
BUILD_TIME=`date +%FT%T%z`
COMMIT=`git log --pretty=format:'%h' -n 1`
Expand All @@ -18,54 +24,108 @@ export GOPATH?=${HOME}/go
build: cmd/abigen cmd/bootnode cmd/disasm cmd/ethtest cmd/evm cmd/gethrpctest cmd/rlpdump cmd/geth ## Build a local snapshot binary version of all commands
@ls -ld $(BINARY)/*

mac/build: macflags build

lin/build: linflags build

macflags:
${SETMACFLAGS}

linflags:
${SETLINFLAGS}

win/build: win/abigen win/bootnode win/disasm win/ethtest win/evm win/gethrpctest win/rlpdump win/geth ## Build a local snapshot binary version of all commands
@ls -ld $(BINARY)/*

cmd/geth: chainconfig ## Build a local snapshot binary version of geth.
mkdir -p ./${BINARY}
${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/geth -tags="netgo" ./cmd/geth
${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/geth -tags="netgo" ./cmd/geth
@echo "Done building geth."
@echo "Run \"$(BINARY)/geth\" to launch geth."

cmd/abigen: ## Build a local snapshot binary version of abigen.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/abigen ./cmd/abigen
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/abigen ./cmd/abigen
@echo "Done building abigen."
@echo "Run \"$(BINARY)/abigen\" to launch abigen."

cmd/bootnode: ## Build a local snapshot of bootnode.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/bootnode ./cmd/bootnode
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/bootnode ./cmd/bootnode
@echo "Done building bootnode."
@echo "Run \"$(BINARY)/bootnode\" to launch bootnode."

cmd/disasm: ## Build a local snapshot of disasm.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/disasm ./cmd/disasm
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/disasm ./cmd/disasm
@echo "Done building disasm."
@echo "Run \"$(BINARY)/disasm\" to launch disasm."

cmd/ethtest: ## Build a local snapshot of ethtest.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/ethtest ./cmd/ethtest
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/ethtest ./cmd/ethtest
@echo "Done building ethtest."
@echo "Run \"$(BINARY)/ethtest\" to launch ethtest."

cmd/evm: ## Build a local snapshot of evm.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/evm ./cmd/evm
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/evm ./cmd/evm
@echo "Done building evm."
@echo "Run \"$(BINARY)/evm\" to launch evm."

cmd/gethrpctest: ## Build a local snapshot of gethrpctest.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/gethrpctest ./cmd/gethrpctest
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/gethrpctest ./cmd/gethrpctest
@echo "Done building gethrpctest."
@echo "Run \"$(BINARY)/gethrpctest\" to launch gethrpctest."

cmd/rlpdump: ## Build a local snapshot of rlpdump.
mkdir -p ./${BINARY} && ${GO_MOD} go build ${LDFLAGS} -o ${BINARY}/rlpdump ./cmd/rlpdump
mkdir -p ./${BINARY} && ${GO_MOD} ${BUILDFLAGS} go build ${LDFLAGS} -o ${BINARY}/rlpdump ./cmd/rlpdump
@echo "Done building rlpdump."
@echo "Run \"$(BINARY)/rlpdump\" to launch rlpdump."

win/geth: ## Build a local snapshot binary version of geth.
mkdir -p ./${BINARY}
${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/geth.exe -tags="netgo" ./cmd/geth
@echo "Done building geth."
@echo "Run \"$(BINARY)/geth\" to launch geth."

win/abigen: ## Build a local snapshot binary version of abigen.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/abigen.exe ./cmd/abigen
@echo "Done building abigen."
@echo "Run \"$(BINARY)/abigen\" to launch abigen."

win/bootnode: ## Build a local snapshot of bootnode.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/bootnode.exe ./cmd/bootnode
@echo "Done building bootnode."
@echo "Run \"$(BINARY)/bootnode\" to launch bootnode."

win/disasm: ## Build a local snapshot of disasm.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/disasm.exe ./cmd/disasm
@echo "Done building disasm."
@echo "Run \"$(BINARY)/disasm\" to launch disasm."

win/ethtest: ## Build a local snapshot of ethtest.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/ethtest.exe ./cmd/ethtest
@echo "Done building ethtest."
@echo "Run \"$(BINARY)/ethtest\" to launch ethtest."

win/evm: ## Build a local snapshot of evm.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/evm.exe ./cmd/evm
@echo "Done building evm."
@echo "Run \"$(BINARY)/evm\" to launch evm."

win/gethrpctest: ## Build a local snapshot of gethrpctest.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/gethrpctest.exe ./cmd/gethrpctest
@echo "Done building gethrpctest."
@echo "Run \"$(BINARY)/gethrpctest\" to launch gethrpctest."

win/rlpdump: ## Build a local snapshot of rlpdump.
mkdir -p ./${BINARY} && ${GO_MOD} ${WINFLAGS} go build ${LDFLAGS} -o ${BINARY}/rlpdump.exe ./cmd/rlpdump
@echo "Done building rlpdump."
@echo "Run \"$(BINARY)/rlpdump\" to launch rlpdump."

install: ## Install all packages to $GOPATH/bin
${GO_MOD} go install ./cmd/{abigen,bootnode,disasm,ethtest,evm,gethrpctest,rlpdump}
${GO_MOD} ${BUILDFLAGS} go install ./cmd/{abigen,bootnode,disasm,ethtest,evm,gethrpctest,rlpdump}
$(MAKE) install_geth

install_geth: chainconfig ## Install geth to $GOPATH/bin
$(info Installing $$GOPATH/bin/geth)
${GO_MOD} go install ${LDFLAGS} -tags="netgo" ./cmd/geth
${GO_MOD} ${BUILDFLAGS} go install ${LDFLAGS} -tags="netgo" ./cmd/geth

fmt: ## gofmt and goimports all go files
find . -name '*.go' -not -wholename './vendor/*' -not -wholename './_vendor*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
Expand Down Expand Up @@ -119,4 +179,4 @@ help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


.PHONY: setup test cover fmt lint ci build cmd/geth cmd/abigen cmd/bootnode cmd/disasm cmd/ethtest cmd/evm cmd/gethrlptest cmd/rlpdump install install_geth clean help static
.PHONY: setup test cover fmt lint ci build mac/build lin/build macflags linflags cmd/geth cmd/abigen cmd/bootnode cmd/disasm cmd/ethtest cmd/evm cmd/gethrlptest cmd/rlpdump install install_geth clean help static
Loading

0 comments on commit 69d8ab8

Please sign in to comment.