Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Revert "Remove btcsuite/btcd dep (#272)" #278

Closed
wants to merge 1 commit into from

Conversation

marten-seemann
Copy link
Contributor

This reverts commit 8814b31. The underlying issue was not fixed in #272, and this continues to break downstream users. Most recently, go-libp2p-webtransport is not able to update to v0.19.1:

❯ go mod tidy
github.com/marten-seemann/go-libp2p-webtransport imports
        github.com/libp2p/go-libp2p-core/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash loaded from github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1,
        but go 1.16 would fail to locate it:
        ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.21.0-beta (/Users/marten/src/go/pkg/mod/github.com/btcsuite/btcd@v0.21.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/Users/marten/src/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)

To proceed despite packages unresolved in go 1.16:
        go mod tidy -e
If reproducibility with go 1.16 is not needed:
        go mod tidy -compat=1.17
For other options, see:
        https://golang.org/doc/modules/pruning

@MarcoPolo
Copy link
Contributor

What does go mod graph say in webtransport? I can take a look later, but I’d like to avoid this if possible.

@marten-seemann
Copy link
Contributor Author

The only repo pulling in github.com/btcsuite/btcd@v0.21.0-beta is this repo, but removing the indirect dependency leads to this error:

github.com/marten-seemann/go-libp2p-webtransport imports
        github.com/libp2p/go-libp2p-core/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.21.0-beta (/Users/marten/src/go/pkg/mod/github.com/btcsuite/btcd@v0.21.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/Users/marten/src/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)

@marten-seemann
Copy link
Contributor Author

I think I (kind of) understand what's going on here. The problem only occurs if you're importing two packages (or two versions of a package, via a transitive dependency) that import different versions of btcd / btcec.

As annoying as this is, at least we can point users in the right direction when this problem occurs. Either

With that solution figured out, I withdraw this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants