libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

go get fails

Open markus2330 opened this issue 2 years ago • 11 comments

$ go get github.com/ElektraInitiative/libelektra/src/bindings/[email protected]
go: downloading github.com/ElektraInitiative/libelektra v0.10.0
go: module github.com/ElektraInitiative/[email protected] found, but does not contain package github.com/ElektraInitiative/libelektra/src/bindings/go-elektra

markus2330 avatar May 23 '23 15:05 markus2330

@markus2330 is v0.10.0 tag pushed?

tmakar avatar May 23 '23 15:05 tmakar

Yes, and it is found, see output above.

markus2330 avatar May 23 '23 15:05 markus2330

@markus2330 When using go get one needs to use the commit hash instead of using the tag, when using go modules which are nested, see following output (the go.mod then automatically uses v0.10.0):

$ go get -v github.com/ElektraInitiative/libelektra/src/bindings/go-elektra@4f45d0c
go: downloading github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0
go: added github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0
$ cat go.mod 
module irgendwas

go 1.20

require github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0 // indirect

tmakar avatar May 23 '23 16:05 tmakar

4f45d0c is the commit hash where also the tag v0.10.0 exists

tmakar avatar May 23 '23 16:05 tmakar

At least the correct version tag is used in the go.mod file which is the most important thing.

tmakar avatar May 23 '23 16:05 tmakar

I also tested the example in the go-elektra/README.md in an external go program, works also perfectly :grin:

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ go mod tidy
go: finding module for package github.com/ElektraInitiative/libelektra/src/bindings/go-elektra/kdb
go: found github.com/ElektraInitiative/libelektra/src/bindings/go-elektra/kdb in github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0
$ go run t.go 
Value of "/go/elektra" is: Hello World!
$ 

tmakar avatar May 23 '23 17:05 tmakar

@markus2330 Well, I don't know why, but now also go get github.com/ElektraInitiative/libelektra/src/bindings/[email protected] works. Probably it took some time :smile:

tmakar avatar May 23 '23 17:05 tmakar

$ go clean -modcache
$ go get -v github.com/ElektraInitiative/libelektra/src/bindings/[email protected]
go: downloading github.com/ElektraInitiative/libelektra v0.10.0
go: downloading github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0
$ 

tmakar avatar May 23 '23 17:05 tmakar

So, I think we can close this issue now!

tmakar avatar May 23 '23 17:05 tmakar

@markus2330 Tried on windows as well, works also perfectly 🎉

PS> go get github.com/ElektraInitiative/libelektra/src/bindings/[email protected]
go: downloading github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0
go: downloading github.com/ElektraInitiative/libelektra v0.10.0
go: added github.com/ElektraInitiative/libelektra/src/bindings/go-elektra v0.10.0

tmakar avatar May 23 '23 19:05 tmakar

Seems like go version 0.20.0 is needed. With the versions before it did not work for me.

markus2330 avatar May 24 '23 04:05 markus2330

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar May 24 '24 01:05 github-actions[bot]

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Jun 07 '24 01:06 github-actions[bot]