jbenet / jbenet/hashpipe

Build Fails Due to Dependency Version Mismatch

Open
#8 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
410
Forks
16
PR merge metrics
No merged PRs in 30d

Description

## Description

While rebuilding the project using the latest version of Go, with Go's official recommendation to use gomodule for initialization and building, we found that the build process fails **due to mismatched module path.**

The following error log was produced during the build process:

```text
......
go: found github.com/jbenet/go-multihash/opts in github.com/jbenet/go-multihash v0.2.3
go: github.com/jbenet/hashpipe imports
github.com/jbenet/go-multihash: github.com/jbenet/go-multihash@v0.2.3: parsing go.mod:
module declares its path as: github.com/multiformats/go-multihash
but was required as: github.com/jbenet/go-multihash
```
## Result

The build fails with errors related to mismatched module path.

The error dependency is `github.com/jbenet/go-multihash`.

## Reason

The error log suggests module path declaration **`github.com/multiformats/go-multihash`** in go.mod, which is inconsistent with import path **`github.com/jbenet/go-multihash`** .

## 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 declaration for the dependency is **`replace github.com/jbenet/go-multihash => github.com/multiformats/go-multihash v0.2.4-0.20240826011505-2a742b029246`.**

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:

```text

require github.com/spaolacci/murmur3 v1.1.0 // indirect

require github.com/multiformats/go-varint v0.0.8-0.20240826011517-5d4c294a8f6b // indirect

replace github.com/jbenet/go-multihash => github.com/multiformats/go-multihash v0.2.4-0.20240826011505-2a742b029246

require github.com/minio/sha256-simd v1.0.1 // indirect

require (
github.com/jbenet/go-multihash v0.0.0-00010101000000-000000000000
github.com/mr-tron/base58 v1.2.1-0.20200531145327-7feefc872974 // indirect
)

require (
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
lukechampine.com/blake3 v1.1.6 // indirect
)
```

## 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.