-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2: upgrade build to include go1.21 #890
Changes from 2 commits
8cf5bbc
b1b4661
3997993
77ca4ec
d7feea9
1299359
ce1fa35
52555e3
9838121
f08a1ea
bf14d3e
0e6e4d2
318fdaa
c5768c2
576d604
54cc8e8
3826f9d
f131d09
b8662b9
e94e01e
22ad479
960eca4
60e8ff2
ebff55e
45dbf25
f607a79
36328b1
961da3e
f28c2fc
7e13876
5665cda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
files: # Configure what Unified CI templates should be used for your repository; defaults to primary language default fileset | ||
- .github/workflows/go-check.yml | ||
- .github/workflows/go-test.yml | ||
force: true # Configure whether Unified CI should overwrite existing workflows; defaults to false | ||
versions: | ||
go: 1.21 # Configure what version of Go should be used; defaults to oldstable | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ import ( | |
"github.com/libp2p/go-libp2p/core/protocol" | ||
ma "github.com/multiformats/go-multiaddr" | ||
manet "github.com/multiformats/go-multiaddr/net" | ||
"github.com/plprobelab/go-kademlia/coord" | ||
"github.com/plprobelab/go-kademlia/kad" | ||
"github.com/plprobelab/go-kademlia/key" | ||
"github.com/plprobelab/go-kademlia/routing" | ||
|
@@ -21,6 +20,8 @@ import ( | |
"go.opentelemetry.io/otel/trace" | ||
"go.uber.org/zap/exp/zapslog" | ||
"golang.org/x/exp/slog" | ||
|
||
"github.com/libp2p/go-libp2p-kad-dht/v2/coord" | ||
) | ||
|
||
// ServiceName is used to scope incoming streams for the resource manager. | ||
|
@@ -112,7 +113,7 @@ type Config struct { | |
Mode ModeOpt | ||
|
||
// Kademlia holds the configuration of the underlying Kademlia implementation. | ||
Kademlia *coord.Config | ||
Kademlia *coord.CoordinatorConfig | ||
|
||
// BucketSize determines the number of closer peers to return | ||
BucketSize int | ||
|
@@ -178,11 +179,15 @@ type Config struct { | |
// instantiate a fully functional [DHT] client. All fields that are nil require | ||
// some additional information to instantiate. The default values for these | ||
// fields come from separate top-level methods prefixed with Default. | ||
func DefaultConfig() *Config { | ||
func DefaultConfig() (*Config, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is a result from a merge. We don't need an error return value here. This is the source for the comparatively large diff here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed in the next PR in the chain #887 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will remove here though - didn't realise there were so many |
||
coordConfig, err := coord.DefaultCoordinatorConfig() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &Config{ | ||
Clock: clock.New(), | ||
Mode: ModeOptAutoClient, | ||
Kademlia: coord.DefaultConfig(), | ||
Kademlia: coordConfig, | ||
BucketSize: 20, // MAGIC | ||
ProtocolID: ProtocolIPFS, | ||
RoutingTable: nil, // nil because a routing table requires information about the local node. triert.TrieRT will be used if this field is nil. | ||
|
@@ -193,7 +198,7 @@ func DefaultConfig() *Config { | |
AddressFilter: AddrFilterPrivate, | ||
MeterProvider: otel.GetMeterProvider(), | ||
TracerProvider: otel.GetTracerProvider(), | ||
} | ||
}, nil | ||
} | ||
|
||
// DefaultRoutingTable returns a triert.TrieRT routing table. This routing table | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
module github.com/libp2p/go-libp2p-kad-dht/v2 | ||
|
||
go 1.20 | ||
go 1.21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks the Go version compatibility promise adhered to by all of libp2p and PL Go packages in general. Is there a really good reason to do this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kubo/Boxo is expecting to upgrade within the next month. go-libp2p-kad-dht v1 will remain at the current Go version for now. v2 is going to be experimental for a while yet. As long as we don't use any 1.21 features (or 1.20) then we can retain the 2 versions compatibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kubo and Boxo have the same compatibility guarantee, regardless of the version they’re building the binaries with. I’ve made significant efforts to support the latest two Go versions in quic-go, even when it would have been a lot easier to just drop Go 1.20. Our users (not only Kubo!) are relying on us keeping our compatibility promise. There should be really, really good reasons (on the order of weeks of developer time) to justify breaking that promise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can drop it back to 1.20. The main point of this pr is to be ready to build with go 1.21, which we were not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that makes sense. What uCI is designed to do is test with the latest 2 Go versions (i.e. Go 1.20 and Go 1.21, at this point). This means that the version in go.mod should be kept at the lower version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. We target the go 1.20 language but test with both go 1.20 and go 1.21. If you're happy with this can you approve the PR @marten-seemann ? |
||
|
||
replace github.com/multiformats/go-multistream => github.com/multiformats/go-multistream v0.4.1 | ||
dennis-tra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
require ( | ||
github.com/benbjohnson/clock v1.3.5 | ||
|
@@ -10,12 +12,12 @@ require ( | |
github.com/ipfs/go-datastore v0.6.1-0.20230901172804-1caa2449ed7c | ||
github.com/ipfs/go-ds-leveldb v0.5.0 | ||
github.com/ipfs/go-log/v2 v2.5.1 | ||
github.com/libp2p/go-libp2p v0.30.0 | ||
github.com/libp2p/go-libp2p v0.29.1-0.20230817072656-d2398ee4f251 | ||
dennis-tra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
github.com/libp2p/go-libp2p-record v0.2.0 | ||
github.com/libp2p/go-msgio v0.3.0 | ||
github.com/multiformats/go-base32 v0.1.0 | ||
github.com/multiformats/go-multiaddr v0.11.0 | ||
github.com/plprobelab/go-kademlia v0.0.0-20230901130940-286ab4ceca60 | ||
github.com/plprobelab/go-kademlia v0.0.0-20230911085009-18d957853c57 | ||
github.com/stretchr/testify v1.8.4 | ||
go.opentelemetry.io/otel v1.17.0 | ||
go.opentelemetry.io/otel/exporters/jaeger v1.16.0 | ||
|
@@ -24,7 +26,7 @@ require ( | |
go.opentelemetry.io/otel/sdk/metric v0.40.0 | ||
go.opentelemetry.io/otel/trace v1.17.0 | ||
go.uber.org/zap/exp v0.1.0 | ||
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 | ||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 | ||
google.golang.org/protobuf v1.31.0 | ||
) | ||
|
||
|
@@ -49,10 +51,10 @@ require ( | |
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect | ||
github.com/google/gopacket v1.1.19 // indirect | ||
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect | ||
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/gorilla/websocket v1.5.0 // indirect | ||
github.com/huin/goupnp v1.2.0 // indirect | ||
github.com/huin/goupnp v1.3.0 // indirect | ||
github.com/ipld/go-ipld-prime v0.21.0 // indirect | ||
github.com/jackpal/go-nat-pmp v1.0.2 // indirect | ||
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect | ||
|
@@ -85,7 +87,7 @@ require ( | |
github.com/multiformats/go-multistream v0.4.1 // indirect | ||
github.com/multiformats/go-varint v0.0.7 // indirect | ||
github.com/nxadm/tail v1.4.8 // indirect | ||
github.com/onsi/ginkgo/v2 v2.11.0 // indirect | ||
github.com/onsi/ginkgo/v2 v2.12.0 // indirect | ||
github.com/opencontainers/runtime-spec v1.1.0 // indirect | ||
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
|
@@ -94,10 +96,10 @@ require ( | |
github.com/prometheus/client_golang v1.16.0 // indirect | ||
github.com/prometheus/client_model v0.4.0 // indirect | ||
github.com/prometheus/common v0.44.0 // indirect | ||
github.com/prometheus/procfs v0.11.0 // indirect | ||
github.com/prometheus/procfs v0.11.1 // indirect | ||
github.com/quic-go/qpack v0.4.0 // indirect | ||
github.com/quic-go/qtls-go1-20 v0.3.2 // indirect | ||
github.com/quic-go/quic-go v0.37.6 // indirect | ||
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect | ||
github.com/quic-go/quic-go v0.38.1 // indirect | ||
github.com/quic-go/webtransport-go v0.5.3 // indirect | ||
github.com/raulk/go-watchdog v1.3.0 // indirect | ||
github.com/spaolacci/murmur3 v1.1.0 // indirect | ||
|
@@ -106,13 +108,13 @@ require ( | |
go.uber.org/fx v1.20.0 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.25.0 // indirect | ||
golang.org/x/crypto v0.12.0 // indirect | ||
golang.org/x/crypto v0.13.0 // indirect | ||
golang.org/x/mod v0.12.0 // indirect | ||
golang.org/x/net v0.14.0 // indirect | ||
golang.org/x/net v0.15.0 // indirect | ||
golang.org/x/sync v0.3.0 // indirect | ||
golang.org/x/sys v0.11.0 // indirect | ||
golang.org/x/text v0.12.0 // indirect | ||
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect | ||
golang.org/x/sys v0.12.0 // indirect | ||
golang.org/x/text v0.13.0 // indirect | ||
golang.org/x/tools v0.13.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
lukechampine.com/blake3 v1.2.1 // indirect | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include Go 1.20 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually no-op. uci.yaml isn't used by go-check or go-test (see https://filecoinproject.slack.com/archives/C03KLC57LKB/p1694518386936719?thread_ts=1694429677.253269&cid=C03KLC57LKB) Also we have customised both to pass in a v2 working directory, so this is irrelevant.
As mentions in the PR description the plan is to get working builds during v2 development and then integrate the CI with version 1 when we are closer to completion. Right now we are in the frustrating situation of not ever having clean builds.