remove libmdbx git-submodule, make db-tools work on vendored to mdbx-go .c code (after "make dist") (#5392)

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
This commit is contained in:
Alex Sharov 2022-09-17 18:55:38 +07:00 committed by GitHub
parent 0fef7c392c
commit 0e8d5d41fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 26 deletions

View File

@ -5,5 +5,5 @@
**/*.dSYM **/*.dSYM
build build
tests tests/testdata
cmd/prometheus cmd/prometheus

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "tests"] [submodule "tests"]
path = tests/testdata path = tests/testdata
url = https://github.com/ethereum/tests url = https://github.com/ethereum/tests
[submodule "libmdbx"]
path = libmdbx
url = https://github.com/torquem-ch/libmdbx.git

View File

@ -105,12 +105,12 @@ COMMANDS += integration
COMMANDS += observer COMMANDS += observer
COMMANDS += pics COMMANDS += pics
COMMANDS += rpcdaemon COMMANDS += rpcdaemon
COMMANDS += rpcdaemon22
COMMANDS += rpctest COMMANDS += rpctest
COMMANDS += sentry COMMANDS += sentry
COMMANDS += state COMMANDS += state
COMMANDS += txpool COMMANDS += txpool
COMMANDS += verkle COMMANDS += verkle
COMMANDS += evm
# build each command using %.cmd rule # build each command using %.cmd rule
$(COMMANDS): %: %.cmd $(COMMANDS): %: %.cmd
@ -119,20 +119,13 @@ $(COMMANDS): %: %.cmd
all: erigon $(COMMANDS) all: erigon $(COMMANDS)
## db-tools: build db tools ## db-tools: build db tools
db-tools: git-submodules db-tools:
@echo "Building db-tools" @echo "Building db-tools"
@# hub.docker.com setup incorrect gitpath for git modules. Just remove it and re-init submodule. go mod vendor
rm -rf libmdbx cd vendor/github.com/torquem-ch/mdbx-go && MDBX_BUILD_TIMESTAMP=unknown make tools
git submodule update --init --recursive --force libmdbx cd vendor/github.com/torquem-ch/mdbx-go/mdbxdist && cp mdbx_chk $(GOBIN) && cp mdbx_copy $(GOBIN) && cp mdbx_dump $(GOBIN) && cp mdbx_drop $(GOBIN) && cp mdbx_load $(GOBIN) && cp mdbx_stat $(GOBIN)
rm -rf vendor
cd libmdbx && MDBX_BUILD_TIMESTAMP=unknown make tools
cp libmdbx/mdbx_chk $(GOBIN)
cp libmdbx/mdbx_copy $(GOBIN)
cp libmdbx/mdbx_dump $(GOBIN)
cp libmdbx/mdbx_drop $(GOBIN)
cp libmdbx/mdbx_load $(GOBIN)
cp libmdbx/mdbx_stat $(GOBIN)
@echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file." @echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file."
## test: run unit tests with a 50s timeout ## test: run unit tests with a 50s timeout
@ -155,13 +148,12 @@ lintci:
## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint ## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint
lintci-deps: lintci-deps:
rm -f ./build/bin/golangci-lint rm -f ./build/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.48.0 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.49.0
## clean: cleans the go cache, build dir, libmdbx db dir ## clean: cleans the go cache, build dir, libmdbx db dir
clean: clean:
go clean -cache go clean -cache
rm -fr build/* rm -fr build/*
cd libmdbx/ && make clean
# The devtools target installs tools required for 'go generate'. # The devtools target installs tools required for 'go generate'.
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'. # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.

4
go.mod
View File

@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.18 go 1.18
require ( require (
github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe
github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1 github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1
github.com/ledgerwatch/log/v3 v3.4.1 github.com/ledgerwatch/log/v3 v3.4.1
github.com/ledgerwatch/secp256k1 v1.0.0 github.com/ledgerwatch/secp256k1 v1.0.0
@ -57,7 +57,7 @@ require (
github.com/stretchr/testify v1.8.0 github.com/stretchr/testify v1.8.0
github.com/tendermint/go-amino v0.14.1 github.com/tendermint/go-amino v0.14.1
github.com/tendermint/tendermint v0.31.11 github.com/tendermint/tendermint v0.31.11
github.com/torquem-ch/mdbx-go v0.25.3 github.com/torquem-ch/mdbx-go v0.26.0
github.com/ugorji/go/codec v1.1.13 github.com/ugorji/go/codec v1.1.13
github.com/ugorji/go/codec/codecgen v1.1.13 github.com/ugorji/go/codec/codecgen v1.1.13
github.com/urfave/cli v1.22.9 github.com/urfave/cli v1.22.9

8
go.sum
View File

@ -394,8 +394,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0= github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e h1:B5h48sxHuWEJptsdBlC/wLlTwG5Kd9K5e5MFZXl0uIg= github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe h1:HEchu2DFX7dhuYNHt2+oARGMZJN4ZY6AQrZ4YacY8J0=
github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e/go.mod h1:SRpLIrl+gTW8068Vw4cMSr2Q7Fncpw9KgiWNmmtv+sc= github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe/go.mod h1:S8/VVAjaE7cVGeI1i58Zb4nUnEy4YtUJDiGDosapbWo=
github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1 h1:qRIJu6cs6fbI8L52DSdPF27j3sOrEriXz1zQSuQvYpA= github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1 h1:qRIJu6cs6fbI8L52DSdPF27j3sOrEriXz1zQSuQvYpA=
github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo= github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc= github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc=
@ -625,8 +625,8 @@ github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDW
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/torquem-ch/mdbx-go v0.25.3 h1:Moz3A/KERndd2aeLGygeD6zC6ZedyuFdw1pdBQRf6N8= github.com/torquem-ch/mdbx-go v0.26.0 h1:d8ph2MsVZoBZr0eFWHRiSYjoCXggED6XzcspUX/HsZM=
github.com/torquem-ch/mdbx-go v0.25.3/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= github.com/torquem-ch/mdbx-go v0.26.0/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc=
github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4= github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4=
github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU=

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

View File

@ -19,6 +19,8 @@ package tools
import ( import (
_ "github.com/fjl/gencodec" _ "github.com/fjl/gencodec"
_ "github.com/kevinburke/go-bindata" _ "github.com/kevinburke/go-bindata"
_ "github.com/torquem-ch/mdbx-go"
_ "github.com/torquem-ch/mdbx-go/mdbxdist"
_ "github.com/ugorji/go/codec/codecgen" _ "github.com/ugorji/go/codec/codecgen"
_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
) )