Skip to content
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

found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules #22

Closed
jxlwqq opened this issue May 21, 2022 · 3 comments
Closed

Comments

@jxlwqq
Copy link

jxlwqq commented May 21, 2022

when I update deps:

go get -u ./...

returns:

go get -u ./...
go: upgraded github.com/btcsuite/btcd v0.22.0-beta => v0.22.1
go: added github.com/btcsuite/btcd/btcec/v2 v2.2.0
go: added github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
go: upgraded github.com/ethereum/go-ethereum v1.10.15 => v1.10.17
go: upgraded github.com/gorilla/websocket v1.4.2 => v1.5.0
go: upgraded github.com/ipfs/go-cid v0.1.0 => v0.2.0
go: upgraded github.com/klauspost/cpuid/v2 v2.0.11 => v2.0.12
go: upgraded github.com/tklauser/go-sysconf v0.3.9 => v0.3.10
go: upgraded github.com/tklauser/numcpus v0.4.0 => v0.5.0
go: upgraded golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506 => v0.0.0-20220518034528-6f7dac969898
go: upgraded golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd => v0.0.0-20220520000938-2e3eb7b945c2
go: upgraded golang.org/x/sys v0.0.0-20220209214540-3681064d5158 => v0.0.0-20220520151302-bc2c85ada10a

but, when I try to run go mod tidy:

returns:

ens imports
        github.com/ethereum/go-ethereum/ethclient imports
        github.com/ethereum/go-ethereum/core/types imports
        github.com/ethereum/go-ethereum/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.22.0-beta (/Users/jxlwqq/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/Users/jxlwqq/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)

@mcdee
Copy link
Collaborator

mcdee commented May 21, 2022

There is no reason to update the dependencies locally. Upgrades can cause dependency issues, as you have found, and packages like go-ethereum commonly change their public-facing functions even in patch releases. Best to stick with the package versions as currently set in the repository.

@mcdee mcdee closed this as completed May 21, 2022
@lukekim
Copy link

lukekim commented Jun 24, 2022

We're also seeing this issue. It's not a matter of just not updating dependencies, adding go-ens to our project, then doing go mod tidy twice will reproduce the error.

Other packages also seeing the error: btcsuite/btcd#1839

TL;DR: Run go get github.com/btcsuite/btcd; go get github.com/btcsuite/btcd/btcec/v2

@mcdee
Copy link
Collaborator

mcdee commented Jun 24, 2022

I have updated the dependencies for this module so that it uses the latest packages, which (assuming that dependencies have addressed the issue) should solve this. The release is v3.5.5

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

No branches or pull requests

3 participants