-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Description
While reproducing the project, we found that the build process fails due to mismatched or unresolved dependencies.
The following error log was produced during the build process:
......
go: found github.com/davecgh/go-spew/spew in github.com/davecgh/go-spew v1.1.1
go: finding module for package github.com/btcsuite/btcd/btcec
go: github.com/btcsuite/btcsim imports
github.com/btcsuite/btcutil imports
github.com/btcsuite/btcd/btcec: module github.com/btcsuite/btcd@latest found (v0.24.2), but does not contain package github.com/btcsuite/btcd/btcec
Result
The build fails with errors related to missing or mismatched dependencies.
The error dependency is github.com/btcsuite/btcd .
The build process automatically pulls the latest dependency versions by default. However, the required package github.com/btcsuite/btcd/btcec is not included in version v0.24.2 .
Reason
This issue appears to be caused by the absence of precise version tracking in GOPATH, which leads to inconsistency in dependency resolution.
Proposed Solution
To resolve this issue, we analyzed the project and identified the correct versions of the required dependencies.
The analysis shows that the correct version for the dependency github.com/btcsuite/btcd is v0.22.3 .
Consider adopting this suggested version to prevent other developers from encountering build failures when constructing the project.
This information can be documented in the README.md file or another relevant location.
Additional Suggestions
To ensure reproducible builds and align with the evolving trends of the Go programming language, it is recommended that the current project be migrated to the Go module mechanism.
Updating to the go module mechanism allows for managing third-party dependency versions through the go.mod file, which provides a centralized and consistent way to specify dependency constraints.
We have generated a go.mod file with the correct versions of the third-party dependencies needed for this project.
The suggested go.mod file is as follows:
Go module github.com/btcsuite/btcd
require (
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
github.com/btcsuite/winsvc v1.0.0
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/decred/dcrd/lru v1.0.0
github.com/gorilla/websocket v1.5.0
github.com/jessevdk/go-flags v1.4.0
github.com/jrick/logrotate v1.0.0
github.com/stretchr/testify v1.8.4
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
golang.org/x/crypto v0.22.0
golang.org/x/sys v0.19.0
)
require (
github.com/aead/siphash v1.0.1 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/net v0.24.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
// The retract statements below fixes an accidental push of the tags of a btcd
// fork.
retract (
v0.18.1
v0.18.0
v0.17.1
v0.17.0
v0.16.5
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.2
v0.15.1
v0.15.0
v0.14.7
v0.14.6
v0.14.6
v0.14.5
v0.14.4
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.0-beta2
v0.13.0-beta
)
go 1.17
Additional Information:
This issue was identified as part of our research project focused on automating the analysis of GOPATH projects to provide accurate dependency versions for seamless migration to Go Modules. We value your feedback and would appreciate any comments or suggestions regarding this approach.