Closed jclc closed 5 years ago
Hi @jclc, I'm not familiar with the Go modules yet but could you see if the sub-module directory is there via ls -a
? If it's there but not initialized, you could try running git submodule update --init
in the go-sdl2
directory and try again.
I'm not sure if we should put the static libraries into the main repository though. I fear that the size will increase too much. It is already at 36M and each version update may double the size.
I'm an idiot, forgot the -a
flag. But still no submodules. Also, the module directory isn't a git repository so I can't download the submodules either (tried that earlier).
I'm not sure if we should put the static libraries into the main repository though. I fear that the size will increase too much.
This seems pretty common with cgo packages. They could be split into their respective packages, eg. libSDL2_image_*.a
in go-sdl2/img/
and so on. I don't consider the extra space requirement to be a huge issue, you'd be downloading the binaries anyway. Doesn't really matter if they're in the same repository or not.
Another option could be to make both this and go-sdl2-libs
Go modules (definitely a good idea to do that anyway; just run go mod init <module name>
and commit go.mod and go.sum). Then, add go-sdl2-libs
as a dependency for go-sdl2
and import the package containing the libs whenever static
is enabled. This might get really convoluted, though, and I'm not even sure if it would work.
It is already at 36M and each version update may double the size.
Why would updating double the size?
Also, the module directory isn't a git repository so I can't download the sub-modules either (tried that earlier).
Ahh that's too bad. I guess since it's not a git repository, it should be fine to include the static libraries here then.
This seems pretty common with cgo packages. They could be split into their respective packages, eg.
libSDL2_image_*.a
ingo-sdl2/img/
and so on. I don't consider the extra space requirement to be a huge issue, you'd be downloading the binaries anyway. Doesn't really matter if they're in the same repository or not.
Hmm I suppose you're right.. If you're not in a hurry, I'll get it done later this week (probably this Saturday when I have my morning breakfast in the cafe 😌). But let me know if you need it ASAP. I'll make time for it!
I'll create a PR and ask @gen2brain for his comments when it's done as he's a lot more experienced than me..
Why would updating double the size?
This only applies to the git repository. I believe compression doesn't work as well on binaries. I've seen some repository that has binaries updated once in a while and it grew to a very large size. If I'm not mistaken, the repository size usually increases by a large portion of the size of all binaries for every update.
No rush :)
Hi @jclc, I have merged the static libraries into the repository so you should have no problem building with the Module system now using the master branch like this:
go get -v github.com/veandco/go-sdl2/sdl@master
Let me know if this solves your problem!
Yep, works like a charm now!
I'm trying out the
static
build tag and I'm getting this:Contents of the module directory:
So the git submodule with SDL2 binaries isn't being downloaded. This seems logical to me, since it is in a different repository (I don't think Go fetches git submodules as part of Go modules?). Moving the binaries into a subdirectory in this repository might fix this.