Skip to content

Build Fails Due to Dependency Version Mismatch #2

@back678

Description

@back678

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: github.com/topxeq/gotx imports

    github.com/AllenDang/giu/imgui: module github.com/AllenDang/giu@latest found (v0.11.0), but does not contain package github.com/AllenDang/giu/imgui

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/build: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/build

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/grep: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/grep

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/snippets: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/snippets

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/timer: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/example/timer

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/include/boost: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/include/boost

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/performance: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/performance

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/performance/config: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/performance/config

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/src: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/src

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/c_compiler_checks: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/c_compiler_checks

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/captures: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/captures

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/collate_info: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/collate_info

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/concepts: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/concepts

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/config_info: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/config_info

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/de_fuzz: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/de_fuzz

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/named_subexpressions: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/named_subexpressions

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/object_cache: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/object_cache

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/pathology: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/pathology

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/regress: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/regress

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/static_mutex: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/static_mutex

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/unicode: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/test/unicode

go: github.com/topxeq/gotx imports

    github.com/AllenDang/giu imports

    github.com/AllenDang/cimgui-go/imgui imports

    github.com/AllenDang/cimgui-go imports

    github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/tools/generate: module github.com/AllenDang/cimgui-go@latest found (v1.3.0), but does not contain package github.com/AllenDang/cimgui-go/cwrappers/ImGuiColorTextEdit/vendor/regex/tools/generate

Result

The build fails with errors related to missing or mismatched dependencies.

The error dependency is github.com/AllenDang/giu.

The build process automatically pulls the latest dependency versions by default. However, the required package github.com/AllenDang/giu/imgui is not included in version v1.3.0.

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/AllenDang/giu is v0.4.1-0.20200623154505-8e6a14816f75.

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:

module github.com/topxeq/gotx

go 1.23

require (
	github.com/360EntSecGroup-Skylar/excelize v1.4.1
	github.com/AllenDang/giu v0.4.1-0.20200623154505-8e6a14816f75
	github.com/aliyun/alibaba-cloud-sdk-go v1.63.88
	github.com/beevik/etree v1.5.0
	github.com/boombuler/barcode v1.0.2
	github.com/denisenkom/go-mssqldb v0.12.3
	github.com/go-sql-driver/mysql v1.9.0
	github.com/mattn/go-sqlite3 v1.14.24
	github.com/sciter-sdk/go-sciter v0.5.0
	github.com/sqweek/dialog v0.0.0-20240226140203-065105509627
	github.com/stretchr/objx v0.4.0
	github.com/topxeq/doc2vec v0.0.0-20200623133505-b167170c691e
	github.com/topxeq/imagetk v0.0.0-20240618054658-f2d6fa68b37f
	github.com/topxeq/sqltk v0.0.0-20241222022816-b39dde4c2ebe
	github.com/topxeq/tk v1.0.5
	github.com/topxeq/xiaoxian v0.0.0-20200619081039-f62ef707acf4
	github.com/traefik/yaegi v0.16.1
	gonum.org/v1/plot v0.15.0
)

require (
	filippo.io/edwards25519 v1.1.0 // indirect
	git.sr.ht/~sbinet/gg v0.6.0 // indirect
	github.com/ALTree/bigfloat v0.2.0 // indirect
	github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect
	github.com/aarzilli/sandblast v0.0.0-20151220083925-43f8fb998d06 // indirect
	github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
	github.com/alecthomas/chroma v0.10.0 // indirect
	github.com/andybalholm/brotli v1.0.4 // indirect
	github.com/antonmedv/expr v1.12.5 // indirect
	github.com/atotto/clipboard v0.1.4 // indirect
	github.com/buger/jsonparser v1.1.1 // indirect
	github.com/campoy/embedmd v1.0.0 // indirect
	github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a // indirect
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/dlclark/regexp2 v1.4.0 // indirect
	github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
	github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 // indirect
	github.com/expr-lang/expr v1.16.9 // indirect
	github.com/go-fonts/liberation v0.3.3 // indirect
	github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect
	github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200420212212-258d9bec320e // indirect
	github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e // indirect
	github.com/go-pdf/fpdf v0.9.0 // indirect
	github.com/go-resty/resty/v2 v2.1.0 // indirect
	github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
	github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
	github.com/golang-sql/sqlexp v0.1.0 // indirect
	github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
	github.com/golang/snappy v0.0.4 // indirect
	github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 // indirect
	github.com/jhillyerd/enmime v1.2.0 // indirect
	github.com/jmespath/go-jmespath v0.4.0 // indirect
	github.com/json-iterator/go v1.1.12 // indirect
	github.com/klauspost/compress v1.14.4 // indirect
	github.com/klauspost/pgzip v1.2.5 // indirect
	github.com/kr/fs v0.1.0 // indirect
	github.com/lxn/win v0.0.0-20210218163916-a377121e959e // indirect
	github.com/mailru/easyjson v0.7.7 // indirect
	github.com/mattn/go-runewidth v0.0.15 // indirect
	github.com/mholt/archiver/v3 v3.5.1 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.2 // indirect
	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
	github.com/mozillazg/go-pinyin v0.20.0 // indirect
	github.com/nwaples/rardecode v1.1.2 // indirect
	github.com/olekukonko/tablewriter v0.0.5 // indirect
	github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
	github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
	github.com/pierrec/lz4/v4 v4.1.14 // indirect
	github.com/pkg/errors v0.9.1 // indirect
	github.com/pkg/sftp v1.13.4 // indirect
	github.com/pmezard/go-difflib v1.0.0 // indirect
	github.com/pquerna/otp v1.4.0 // indirect
	github.com/rivo/uniseg v0.4.4 // indirect
	github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
	github.com/tidwall/gjson v1.18.0 // indirect
	github.com/tidwall/match v1.1.1 // indirect
	github.com/tidwall/pretty v1.2.1 // indirect
	github.com/tinylib/msgp v1.2.5 // indirect
	github.com/topxeq/countingwriter v0.0.0-20230115115152-84660be6de09 // indirect
	github.com/topxeq/gods v0.0.0-20220125023913-b5718bb0c704 // indirect
	github.com/topxeq/goph v0.0.0-20240813015542-ebac0794140b // indirect
	github.com/topxeq/mahonia v0.0.0-20190828060648-12b0599ddd1a // indirect
	github.com/topxeq/regexpx v0.0.0-20230721063247-f118dbe089d7 // indirect
	github.com/topxeq/socks v0.0.0-20230721063359-4740c5e460e9 // indirect
	github.com/topxeq/tkc v0.0.0-20241222022015-956a8313619f // indirect
	github.com/topxeq/txtk v0.0.0-20190727114208-7d2d0e659847 // indirect
	github.com/topxeq/uuid v0.0.0-20210318003930-0d149e412ca1 // indirect
	github.com/topxeq/xmlx v0.3.0 // indirect
	github.com/ulikunitz/xz v0.5.10 // indirect
	github.com/wangbin/jiebago v0.3.2 // indirect
	github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
	github.com/yeka/zip v0.0.0-20231116150916-03d6312748a9 // indirect
	github.com/yuin/goldmark v1.7.2 // indirect
	github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594 // indirect
	golang.org/x/crypto v0.31.0 // indirect
	golang.org/x/image v0.21.0 // indirect
	golang.org/x/net v0.33.0 // indirect
	golang.org/x/sys v0.28.0 // indirect
	golang.org/x/term v0.27.0 // indirect
	golang.org/x/text v0.21.0 // indirect
	gopkg.in/ini.v1 v1.67.0 // indirect
)

Here the +incompatible suffix in go.mod indicates that the module does not follow Go Modules' semantic versioning (SemVer) rules correctly. But Go can still build and run the project normally despite the +incompatible tag.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions