Skip to content

Commit

Permalink
remove libmdbx git-submodule, make db-tools work on vendored to mdbx-…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
AskAlexSharov authored Sep 17, 2022
1 parent 0fef7c3 commit 0e8d5d4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
**/*.dSYM

build
tests
tests/testdata
cmd/prometheus
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "tests"]
path = tests/testdata
url = https://github.com/ethereum/tests
[submodule "libmdbx"]
path = libmdbx
url = https://github.com/torquem-ch/libmdbx.git
22 changes: 7 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ COMMANDS += integration
COMMANDS += observer
COMMANDS += pics
COMMANDS += rpcdaemon
COMMANDS += rpcdaemon22
COMMANDS += rpctest
COMMANDS += sentry
COMMANDS += state
COMMANDS += txpool
COMMANDS += verkle
COMMANDS += evm

# build each command using %.cmd rule
$(COMMANDS): %: %.cmd
Expand All @@ -119,20 +119,13 @@ $(COMMANDS): %: %.cmd
all: erigon $(COMMANDS)

## db-tools: build db tools
db-tools: git-submodules
db-tools:
@echo "Building db-tools"

@# hub.docker.com setup incorrect gitpath for git modules. Just remove it and re-init submodule.
rm -rf libmdbx
git submodule update --init --recursive --force libmdbx

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)
go mod vendor
cd vendor/github.com/torquem-ch/mdbx-go && MDBX_BUILD_TIMESTAMP=unknown make tools
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
@echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file."

## test: run unit tests with a 50s timeout
Expand All @@ -155,13 +148,12 @@ lintci:
## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint
lintci-deps:
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:
go clean -cache
rm -fr build/*
cd libmdbx/ && make clean

# The devtools target installs tools required for 'go generate'.
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.18

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/log/v3 v3.4.1
github.com/ledgerwatch/secp256k1 v1.0.0
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
github.com/stretchr/testify v1.8.0
github.com/tendermint/go-amino v0.14.1
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/codecgen v1.1.13
github.com/urfave/cli v1.22.9
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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/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/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e h1:B5h48sxHuWEJptsdBlC/wLlTwG5Kd9K5e5MFZXl0uIg=
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 h1:HEchu2DFX7dhuYNHt2+oARGMZJN4ZY6AQrZ4YacY8J0=
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/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc=
Expand Down Expand Up @@ -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.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/torquem-ch/mdbx-go v0.25.3 h1:Moz3A/KERndd2aeLGygeD6zC6ZedyuFdw1pdBQRf6N8=
github.com/torquem-ch/mdbx-go v0.25.3/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
github.com/torquem-ch/mdbx-go v0.26.0 h1:d8ph2MsVZoBZr0eFWHRiSYjoCXggED6XzcspUX/HsZM=
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/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4=
github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU=
Expand Down
1 change: 0 additions & 1 deletion libmdbx
Submodule libmdbx deleted from 1cac65
2 changes: 2 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package tools
import (
_ "github.com/fjl/gencodec"
_ "github.com/kevinburke/go-bindata"
_ "github.com/torquem-ch/mdbx-go"
_ "github.com/torquem-ch/mdbx-go/mdbxdist"
_ "github.com/ugorji/go/codec/codecgen"
_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
)

0 comments on commit 0e8d5d4

Please sign in to comment.