Giter Club home page Giter Club logo

Comments (9)

brianathere avatar brianathere commented on July 21, 2024 1

Looking at this now.

from go-libp2p-core.

vyzo avatar vyzo commented on July 21, 2024

Can we fix our CI globally to do 1.17 compat tidy?
We've had this problem elsewhere too.

from go-libp2p-core.

marten-seemann avatar marten-seemann commented on July 21, 2024

Can we fix our CI globally to do 1.17 compat tidy?

We could, but the problem is that every user of go-libp2p would not be able to run a normal go mod tidy any more.

I don't really understand why the Go tool would care about 1.16 when the go.mod file clearly states go 1.17 (as all our go.mod files do), but apparently that's what the Go team decided.

from go-libp2p-core.

galargh avatar galargh commented on July 21, 2024

I found another change that makes the errors go away - see libp2p/go-libp2p#1524 - but I'm yet to understand exactly what's going on.

from go-libp2p-core.

marten-seemann avatar marten-seemann commented on July 21, 2024

Adding the following file to go-libp2p works:

//go:build !go1.17
// +build !go1.17

package libp2p

import (
	_ "github.com/btcsuite/btcd/chaincfg"
)

and then making sure that go.mod has require github.com/btcsuite/btcd v0.22.1.

from go-libp2p-core.

marten-seemann avatar marten-seemann commented on July 21, 2024

This could also be applied in this repo: #254

Not sure where the right place for this to live would be. Thoughts?

from go-libp2p-core.

galargh avatar galargh commented on July 21, 2024

Given what I've read so far here's my guess.

Before

go-libp2p depends on [email protected] and [email protected].

github.com/libp2p/go-libp2p github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]

This is fine, these two are compatible (in terms of what go mod tidy does i.e. dep resolution model of go 1.16) with each other.

The only version of chainhash that is used is the one that comes as a subdir of btcd.

After

go-libp2p-core changes dependency on [email protected] to a dependency on btcd/btcec/v2 v2.1.3. Important note: btcec depends on released chainhash (v1.0.0 to be exact).

go-libp2p still depends on [email protected] and [email protected].

github.com/libp2p/go-libp2p github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]
github.com/libp2p/[email protected] github.com/btcsuite/[email protected]

But now it also depends on [email protected].

github.com/libp2p/[email protected] github.com/btcsuite/btcd/btcec/[email protected]

And transitively, it also starts depending on released [email protected].

github.com/btcsuite/btcd/btcec/[email protected] github.com/btcsuite/btcd/chaincfg/[email protected]

Now we have 2 incompatible versions of chainhash in chain, one from btcd's subdir and one from a proper v1.0.0 release.

Resolution

We can either force replace btcd to v0.22.1 which doesn't have chainhash subdir at all anymore, or we can upgrade btcd in all of these:

  • libp2p/go-libp2p
  • libp2p/go-libp2p-quic-transport
  • libp2p/go-libp2p-resource-manager
  • libp2p/go-libp2p-testing
  • libp2p/go-libp2p-tls
  • libp2p/go-libp2p-yamux

The latter seems cleaner but it's much more work.

from go-libp2p-core.

galargh avatar galargh commented on July 21, 2024

This could also be applied in this repo: #254

Not sure where the right place for this to live would be. Thoughts?

Nice! I tested it locally and it seems to do the trick :)

Testing

I checked out your branch in go-libp2p-core and updated the reference in go-libp2p's go.mod to point at the local checkout. After this, I ran go mod tidy and it didn't complain anymore.

from go-libp2p-core.

galargh avatar galargh commented on July 21, 2024

I think maybe #252 (comment) fits better in go-libp2p because we'd be able to remove it once/if we stop transitively depending on lower versions?

Either way, I think yours is better than my replace all.

from go-libp2p-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.