Build Fails Due to Dependency Version Mismatch
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với bản build Go hiện tại và kiểm tra import dependency từ cmd/ssh2docker. Xem xét thay thế go.mod được đề xuất cho github.com/codegangsta/cli và các đường dẫn module liên quan, sau đó xác minh rằng project build thành công với cấu hình dependency đã cập nhật. README.md được đề cập là một vị trí có thể dùng để hướng dẫn build.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
......
go: found github.com/codegangsta/cli in github.com/codegangsta/cli v1.22.15
go: found github.com/smartystreets/goconvey/convey in github.com/smartystreets/goconvey v1.8.1
go: github.com/moul/ssh2docker/cmd/ssh2docker imports
github.com/codegangsta/cli: github.com/codegangsta/[email protected]: parsing go.mod:
module declares its path as: github.com/urfave/cli
but was required as: github.com/codegangsta/cli
Result
The build fails with errors related to mismatched module path.
The error dependency is github.com/codegangsta/cli.
Reason
The error log suggests module path declaration github.com/urfave/cli in go.mod, which is inconsistent with import path github.com/codegangsta/cli .
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/codegangsta/cli => github.com/urfave/cli v1.22.9.
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:
require github.com/apex/log v1.8.1-0.20200817094143-421394d88c94
require github.com/parnurzeal/gorequest v0.3.1-0.20240221155414-2f6d15e4738b
require github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
require github.com/pkg/errors v0.9.2-0.20201214064552-5dd12d0cfe7f // indirect
require github.com/stretchr/testify v1.10.0 // indirect
replace github.com/cpuguy83/go-md2man => github.com/cpuguy83/go-md2man/v2 v2.0.3
require github.com/mitchellh/go-homedir v1.1.0
require github.com/kr/pty v1.1.8
require github.com/creack/pty v1.1.23 // indirect
replace github.com/codegangsta/cli => github.com/urfave/cli v1.22.9
replace github.com/moul/http2curl => moul.io/http2curl/v2 v2.3.1-0.20221024080105-10c404f653f7
require (
github.com/codegangsta/cli v0.0.0-00010101000000-000000000000
github.com/smartystreets/goconvey v1.8.1
golang.org/x/crypto v0.32.0
)
require (
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/elazarl/goproxy v1.7.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/smarty/assertions v1.15.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
moul.io/http2curl v1.0.0 // 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.
- Ngôn ngữ chính
- Go
- Star
- 198
- Fork
- 17
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của moul/ssh2docker
-
Dependency DashboardĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
moul/ssh2docker#96 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
moul/ssh2docker#89 ·
-
stdin -> docker exec is closed too earlyCó thể làm lại được @moul đã nhận 3740 ngày trước và không có pull request nào đang mở. Đang mởbug ready
moul/ssh2docker#82 · 3 bình luận · 1 người được giao ·
-
Add an API + web admin to manage and monitor server stateCó thể làm lại được @moul đã nhận 3740 ngày trước và không có pull request nào đang mở. Đang mởfreeze
moul/ssh2docker#81 · 1 người được giao ·
-
Also cleanup containers on remote when option --clean-on-startup is presentCó thể làm lại được @moul đã nhận 4015 ngày trước và không có pull request nào đang mở. Đang mởfreeze
moul/ssh2docker#60 · 1 bình luận · 1 người được giao ·
Tất cả issue của moul/ssh2docker
Issue tương tự
-
raised-by:reviewer
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
medici-finance/assay#2681 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(icons): add [solidping]Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refine bluetooth scan listĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AvengeMedia/DankMaterialShell#3761 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: clarify replacement for outdated Terms of Service URL in readme.mdCó thể đã có người làm @mohitjoshi-hey đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 66/100