Forking gotk3 not working?

93 views
Skip to first unread message

erich...@gmail.com

unread,
Sep 24, 2019, 12:11:53 PM9/24/19
to golang-nuts
Hi! This is perhaps more a question about git than Go but must have something to do with go get, too. I tried to fork gotk3 from github on the web page (using Fork button), because I need to merge some important 3rd party pull requests and the maintainer is no longer active.

However, after creating a fresh fork and without making any changes, if I add the repo into an import statement, go get -u fails with the message: cannot load github.com/rasteric/gotk3/gtk: zip: not a valid zip file

My fork is at github.com/rasteric/gotk3, the project using it is private.

How is that possible? Shouldn't a fresh fork work exactly like the original? Does anyone have an idea what's going wrong?

If I cannot merge those pull requests (for copy&paste in a TextView), I can basically scrap the results of half a year of work and say good-bye to GTK. It is very frustrating, so I appreciate very much any help.

Dimas Prawira

unread,
Sep 24, 2019, 12:50:36 PM9/24/19
to erich...@gmail.com, golang-nuts
Maybe this is not the answer for the problem, just want to share about do 'go get-ing' a private repo, first you should do a configuration 

Here is the reference : 


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1e8e88ba-4d25-4705-bbc0-bbc221c89236%40googlegroups.com.

Sascha Andres

unread,
Sep 25, 2019, 12:12:44 AM9/25/19
to golang-nuts
Hi,

Are you working inside the GOPATH? Or are you trying to use it like a project that is go mod enabled? I ask because it sound it might try to use a proxy if you are on the latest go version.

Volker Dobler

unread,
Sep 25, 2019, 4:11:38 AM9/25/19
to golang-nuts
In general: You cannot use a Github Fork of a Go module.
A fork creates a new package/module with different package/module
names and in general (trivial cases _do_ work) you cannot even build it.

What you should do:
 - Fork the repo but do not work on your fork!
 - Clone the repo you want to work with
 - Make changes to the clone, build and test (this works as it is not a fork)
 - Add your fork as a new remote and push to your fork
 - Create a pull request from your fork to the original repo
You need the fork for the PR but you do not do actual work there.
That your fork is private does not make it better (but not worse either).

(In your case you have to get your work from the fork into the clone,
but this should be simple).

V.

Ian Davis

unread,
Sep 25, 2019, 4:54:04 AM9/25/19
to golan...@googlegroups.com

On Tue, 24 Sep 2019, at 11:02 AM, erich...@gmail.com wrote:
Hi! This is perhaps more a question about git than Go but must have something to do with go get, too. I tried to fork gotk3 from github on the web page (using Fork button), because I need to merge some important 3rd party pull requests and the maintainer is no longer active.

However, after creating a fresh fork and without making any changes, if I add the repo into an import statement, go get -u fails with the message: cannot load github.com/rasteric/gotk3/gtk: zip: not a valid zip file

I don't know what would cause this specific error. I suspect it is emitted by this code https://github.com/golang/go/blob/master/src/cmd/go/internal/modload/build.go#L240 which points to it being a problem with your local package cache, perhaps an interrupted download. Try running go clean --modcache and see if that fixes it.

I got the example from the readme to almost work by copying it into a main.go, editing the import to refer to your fork, running go mod init and adding this to the go.mod:


It fetches the module but fails with some compile errors but at least it looks like it could work in theory:

09:42 $ go get -u -v
go: finding github.com/gotk3/gotk3 latest
../../pkg/mod/github.com/rasteric/go...@v0.0.1/gtk/glarea.go:146:33: undefined: gdk.GLContext
../../pkg/mod/github.com/rasteric/go...@v0.0.1/gtk/glarea.go:152:11: undefined: gdk.GLContext
../../pkg/mod/github.com/rasteric/go...@v0.0.1/gtk/gtk_since_3_8.go:46:52: undefined: gdk.FrameClock
../../pkg/mod/github.com/rasteric/go...@v0.0.1/gtk/widget_since_3_8.go:60:9: undefined: gdk.WrapFrameClock

Ian

Reply all
Reply to author
Forward
0 new messages