erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.1k stars 1.09k forks source link

Error with `make erigon` on both devel & stable branches #7558

Open AustinFoss opened 1 year ago

AustinFoss commented 1 year ago

System information

Erigon version: stable & devel branches

OS & Version: Linux (Debian 12, Testing/Bookworm)

Erigon Command (with flags/config): make erigon

Go v1.20.4 Clang v14.0.6 Kernel v6.1.0-9

Expected behaviour

Following the build instructions in this repo's README I'd expect the build to just work and output the binary to the ./build/bin/ directory as described.

Actual behaviour

My make process output the following error:

Building erigon
github.com/ledgerwatch/erigon-lib/sais: build constraints exclude all Go files in /home/erigon/go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230423044930-fc9dd74e6407/sais
github.com/torquem-ch/mdbx-go/mdbx: build constraints exclude all Go files in /home/erigon/go/pkg/mod/github.com/torquem-ch/mdbx-go@v0.27.10/mdbx
# github.com/supranational/blst/bindings/go
../../../../go/pkg/mod/github.com/supranational/blst@v0.3.10/bindings/go/rb_tree.go:130:18: undefined: Message
# github.com/anacrolix/go-libutp
../../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.2.0/status.go:9:2: undefined: mu
../../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.2.0/status.go:10:8: undefined: mu
../../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.2.0/status.go:11:20: undefined: libContextToSocket
# github.com/ledgerwatch/erigon-lib/types
../../../../go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230423044930-fc9dd74e6407/types/txn.go:450:24: undefined: secp256k1.RecoverPubkeyWithContext
../../../../go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230423044930-fc9dd74e6407/types/txn.go:450:59: undefined: secp256k1.DefaultContext
make: *** [Makefile:98: erigon.cmd] Error 1

That last line refers to the following section of the Make file, the second last line:

%.cmd:
        @# Note: $* is replaced by the command name
        @echo "Building $*"
        @cd ./cmd/$* && $(GOBUILD) -o $(GOBIN)/$*
        @echo "Run \"$(GOBIN)/$*\" to launch $*."

Steps to reproduce the behaviour

Just follow the existing build instructions.

AustinFoss commented 1 year ago

Okay I got it to work shortly after posting.

I think the README is not quite accurate. I was attempting to build this on a very fresh, like two day old install, of Debian testing so I didn't have really anything else installed just yet.

The README currently lists the following system requirements: [Golang version >= 1.19](https://golang.org/doc/install); GCC 10+ or Clang; On Linux: kernel > v4

My kernel and Go versions are fine. I'm a curl > wget person, and was going to use Clang over GCC because it's worded that I could use either one. Well my system didn't have gcc installed and the above error output results from a system that only has Clang installed.

After install GCC to my system I still got another error: github.com/anacrolix/go-libutp: g++: exec: "g++": executable file not found in $PATH

This was resolved by installing build-essential, which was also not installed on the fresh host.

So I think that maybe Clang should be removed as an option for now and build-essential or just g++ be added to the README as part of the requirements.

AskAlexSharov commented 1 year ago

maybe you can take a look into our Dockerfile also

wmitsuda commented 1 year ago

I do confirm I'm getting the same in a brand new ubuntu 22.04 machine:

Building erigon
github.com/ledgerwatch/erigon-lib/sais: build constraints exclude all Go files in /home/wmitsuda/go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230617020636-2aa24aa05de6/sais
github.com/torquem-ch/mdbx-go/mdbx: build constraints exclude all Go files in /home/wmitsuda/go/pkg/mod/github.com/torquem-ch/mdbx-go@v0.27.10/mdbx
# github.com/anacrolix/go-libutp
../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.3.0/status.go:9:2: undefined: mu
../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.3.0/status.go:10:8: undefined: mu
../../../go/pkg/mod/github.com/anacrolix/go-libutp@v1.3.0/status.go:11:20: undefined: libContextToSocket
# github.com/ledgerwatch/erigon-lib/types
../../../go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230617020636-2aa24aa05de6/types/txn.go:450:24: undefined: secp256k1.RecoverPubkeyWithContext
../../../go/pkg/mod/github.com/ledgerwatch/erigon-lib@v0.0.0-20230617020636-2aa24aa05de6/types/txn.go:450:59: undefined: secp256k1.DefaultContext
# github.com/supranational/blst/bindings/go
../../../go/pkg/mod/github.com/supranational/blst@v0.3.10/bindings/go/rb_tree.go:130:18: undefined: Message
make: *** [Makefile:97: erigon.cmd] Error 1

I installed build-essential, gcc, clang, but there is still something missing I can't figure out.

wmitsuda commented 1 year ago

my mistake, I was able to build it after installing build-essential.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.

yperbasis commented 1 month ago

Recently reported on Discord: https://discord.com/channels/687972960811745322/738982866670714901/1268604960359190619