OffchainLabs / nitro

Nitro goes vroom and fixes everything
Other
752 stars 450 forks source link

quic-go 0.33.0 is incompatible with go1.21 while compile nitro from soucecode #2311

Closed zhangxf55 closed 6 months ago

zhangxf55 commented 6 months ago

Describe the bug I have tried compile nitro from soucecode with offical doc: https://docs.arbitrum.io/run-arbitrum-node/nitro/build-nitro-locally, and my os is ubuntu 22.04 and my environment is:

root@host:~# uname -a
Linux host 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@host:~# go version
go version go1.21.10 linux/amd64
root@host:~# rustc --version
rustc 1.73.0 (cc66ad468 2023-10-03)
root@host:~# node --version
v16.19.1
root@host:~# yarn --version
1.22.22
root@host:~# npm --version
8.19.3

To Reproduce

  1. Clone the sourcecode from this repo:
    git clone --branch v2.3.3 https://github.com/OffchainLabs/nitro.git
  2. Fetch the submodules
    cd nitro && git submodule update --init --recursive --force
  3. Make
    make

Expected behavior

mkdir -p solgen/go/
go run solgen/gen.go
successfully generated go abi files
successfully exported abi files
go run ./linters ./...
-: # github.com/quic-go/quic-go/internal/qtls
../go/pkg/mod/github.com/quic-go/quic-go@v0.33.0/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.21 yet. F...) as int value in variable declaration
/root/go/pkg/mod/github.com/quic-go/quic-go@v0.33.0/internal/qtls/go121.go:5:13: cannot use "The version of quic-go you're using can't be built on Go 1.21 yet. For more details, please see https://github.com/quic-go/quic-go/wiki/quic-go-and-Go-versions." (untyped string constant "The version of quic-go you're using can't be built on Go 1.21 yet. F...) as int value in variable declaration
linters: 2 errors during loading
exit status 1
make: *** [Makefile:314: .make/lint] Error 1

Screenshots

image
PlasmaPower commented 6 months ago

Those instructions are for compiling master, which uses Go 1.21. To build v2.3.3 from source, you'll need to use Go 1.20.