Closed lucymhdavies closed 4 years ago
Findings from today:
Running go, and even gopherjs, within Netlify is doable.
e.g. https://app.netlify.com/sites/lmhd-egg-game/deploys/5d32378087a9b80007e6740a
However, it fails due to
10:36:36 PM: go: extracting github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1
10:36:37 PM: # github.com/go-gl/glfw/v3.2/glfw
10:36:37 PM: In file included from ./glfw/src/internal.h:169:0,
10:36:37 PM: from ./glfw/src/context.c:28,
10:36:37 PM: from /opt/buildhome/.gimme_cache/gopath/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/c_glfw.go:4:
10:36:37 PM: ./glfw/src/x11_platform.h:39:33: fatal error: X11/Xcursor/Xcursor.h: No such file or directory
10:36:37 PM: compilation terminated.
10:36:44 PM: # github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl
10:36:44 PM: /opt/buildhome/.gimme_cache/gopath/pkg/mod/github.com/hajimehoshi/ebiten@v1.10.0-alpha.0.20190719200005-3f6628f1cca1/internal/graphicsdriver/opengl/gl/procaddr_notwindows.go:42:21: fatal error: GL/glx.h: No such file or directory
And that appears to be due to a known issue https://github.com/hajimehoshi/ebiten/issues/353
If I had more permissions within the netlify build image, or if i could specify my own custom image, I could install whatever dependencies I needed. But with the limitations of running inside this massive beast mean I cannot do that: https://github.com/netlify/build-image/blob/xenial/Dockerfile#L415-L431
All is not lost. Ebiten itself is tested within travis: https://github.com/hajimehoshi/ebiten/blob/master/.travis.yml
So I could build my code within travis too, and then ship an artifact... somewhere.
Possibly follow a similar build process to lucli: https://github.com/LMHD/lucli/blob/master/Makefile
Given JSGO does not currently support Ebiten (https://github.com/dave/jsgo/issues/22) I've had to Vendor Ebiten.
This is fine as a short term solution, but long term is not ideal, especially as there are updates to Ebiten I'm missing out on
Could switch to just raw GopherJS, if I can automate it.