veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

XBuilding #569

Open jkassis opened 1 year ago

jkassis commented 1 year ago

Go version: go version go1.19.4 darwin/arm64

Go-SDL2 version: require github.com/veandco/go-sdl2 v0.4.34

SDL2 version: ??

OS: MacOS

Architecture: arm64

Having trouble with cross-platform builds inside a Docker container on MacOS arm64 (Macbook M2) host OS...

The build is easily replicated by...

git clone https://github.com/jkassis/gas
cd go
go run bin/make.go setup
go run bin/make.go buildx

It uses an Ubuntu image setup for cross platform builds and a build script derived from the xgo project to build for multiple platforms using libraries vendored into the project on the HostOS.

Here's what I get from the docker builds...

[I] jkassis@Js-MacBook-Air ~/co/ga/go (main)> go run bin/make.go buildx                                                                                                                                                        05.03 18:28
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/386...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/arm-7...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.
Compiling for linux/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:5:11: fatal error: SDL.h: No such file or directory
    5 |  #include <SDL.h>
      |           ^~~~~~~
compilation terminated.

I'm concerned and confused by the references to what appear to be SDL1.x headers here.

veeableful commented 1 year ago

Hi @jkassis, it looks like it can't find the SDL2 header file (which should be SDL.h under /usr/include/SDL2 directory). If it's on Ubuntu, has libsdl2-dev been installed?

jkassis commented 1 year ago

Thanks for looking into this @veeableful.

I can ls on the build container. SDL.h is there.

#9 [6/6] RUN ls -l /usr/include/SDL2
#9 sha256:3d2718aca6babdad36371547a63677b218362094ff9d77106485a3f559a971a6
#9 0.275 total 1836
#9 0.275 -rw-r--r-- 1 root root   4210 Apr 13  2020 SDL.h
#9 0.275 -rw-r--r-- 1 root root  11045 Apr 13  2020 SDL_assert.h
#9 0.275 -rw-r--r-- 1 root root  10839 Apr 13  2020 SDL_atomic.h
...

I'm setting these env variables through docker when running the build...

               `-e", "FLAG_LDFLAGS="-w -s -D_REENTRANT -I/usr/include/SDL2
-lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf"`,
               "-e", `CGO_CXXFLAGS="-I/usr/include/SDL2 -D_REENTRANT"`,
               "-e", `CGO_CPPFLAGS="-I/usr/include/SDL2 -D_REENTRANT"`,
               "-e", "OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1",

Maybe those linker flags are not right for a static build? I know the build picks up those env vars because the OSXCROSS_NO_INCLUDE_PATH_WARNINGS actually shuts the warnings down.

On Thu, 4 May 2023 at 21:22, veeableful @.***> wrote:

Hi @jkassis https://github.com/jkassis, it looks like it can't find the SDL2 header file (which should be SDL.h under /usr/include/SDL2 directory). If it's on Ubuntu, has libsdl2-dev been installed?

— Reply to this email directly, view it on GitHub https://github.com/veandco/go-sdl2/issues/569#issuecomment-1535680499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3WITHFB3WBRQNMGTJMH2TXER6A5ANCNFSM6AAAAAAXVES62M . You are receiving this because you were mentioned.Message ID: @.***>

jkassis commented 1 year ago

Also, I updated https://github.com/jkassis/gas with the latest.

On Fri, 5 May 2023 at 11:39, Jeremy Kassis @.***> wrote:

Thanks for looking into this @veeableful.

I can ls on the build container. SDL.h is there.

#9 [6/6] RUN ls -l /usr/include/SDL2
#9 sha256:3d2718aca6babdad36371547a63677b218362094ff9d77106485a3f559a971a6
#9 0.275 total 1836
#9 0.275 -rw-r--r-- 1 root root   4210 Apr 13  2020 SDL.h
#9 0.275 -rw-r--r-- 1 root root  11045 Apr 13  2020 SDL_assert.h
#9 0.275 -rw-r--r-- 1 root root  10839 Apr 13  2020 SDL_atomic.h
...

I'm setting these env variables through docker when running the build...

               `-e", "FLAG_LDFLAGS="-w -s -D_REENTRANT -I/usr/include/SDL2
-lSDL2 -lSDL2main -lSDL2_image -lSDL2_mixer -lSDL2_ttf"`,
               "-e", `CGO_CXXFLAGS="-I/usr/include/SDL2 -D_REENTRANT"`,
               "-e", `CGO_CPPFLAGS="-I/usr/include/SDL2 -D_REENTRANT"`,
               "-e", "OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1",

Maybe those linker flags are not right for a static build? I know the build picks up those env vars because the OSXCROSS_NO_INCLUDE_PATH_WARNINGS actually shuts the warnings down.

On Thu, 4 May 2023 at 21:22, veeableful @.***> wrote:

Hi @jkassis https://github.com/jkassis, it looks like it can't find the SDL2 header file (which should be SDL.h under /usr/include/SDL2 directory). If it's on Ubuntu, has libsdl2-dev been installed?

— Reply to this email directly, view it on GitHub https://github.com/veandco/go-sdl2/issues/569#issuecomment-1535680499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3WITHFB3WBRQNMGTJMH2TXER6A5ANCNFSM6AAAAAAXVES62M . You are receiving this because you were mentioned.Message ID: @.***>

veeableful commented 1 year ago

Hi @jkassis, could you try without the static tag and see if it works? We have our special Go files for static tag so they might have interfered.

jkassis commented 1 year ago

Hi @veeableful. I did try just now without the static tag. I'm seeing this, which reminds me of the errors that surfaced in https://github.com/veandco/go-sdl2/issues/555 for vendored builds...

Could the warning about the host and image platform have something to do with this?

[I] jkassis@Js-MacBook-Air ~/co/ga/go (main)> go run bin/make.go buildx                       05.08 06:53
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for darwin-10.10/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for darwin-10.10/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for windows-4.0/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Cleaning up build environment...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/amd64...
go build frogger: copying /tmp/go-build398559834/b001/exe/a.out: open /build/frogger-linux-amd64: operation not permitted
Compiling for linux/386...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/arm-7...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips64...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips64le...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mipsle...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for windows-4.0/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Compiling for windows-4.0/386...
# github.com/veandco/go-sdl2/sdl
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Compiling for darwin-10.10/amd64...
# github.com/veandco/go-sdl2/sdl
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/SDL2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for darwin-10.10/arm64...
# github.com/veandco/go-sdl2/sdl
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/SDL2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
In file included from vendor/github.com/veandco/go-sdl2/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Cleaning up build environment...
jkassis commented 1 year ago

I did one more test after removing the vendor folder...

[I] jkassis@Js-MacBook-Air ~/co/ga/go (main)> rm -R vendor                                                                                                                05.08 08:49
[I] jkassis@Js-MacBook-Air ~/co/ga/go (main)> go run bin/make.go buildx                                                                                                   05.08 08:49
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/arm64...
go: downloading cloud.google.com/go/profiler v0.3.1
go: downloading github.com/veandco/go-sdl2 v0.4.34
go: downloading cloud.google.com/go v0.105.0
go: downloading github.com/goradd/maps v0.1.4
go: downloading cloud.google.com/go/compute/metadata v0.2.3
go: downloading github.com/golang/protobuf v1.5.2
go: downloading cloud.google.com/go/compute v1.14.0
go: downloading github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c
go: downloading github.com/googleapis/gax-go/v2 v2.7.0
go: downloading google.golang.org/api v0.107.0
go: downloading google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef
go: downloading google.golang.org/grpc v1.52.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
go: downloading go.opencensus.io v0.24.0
go: downloading golang.org/x/net v0.7.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading golang.org/x/sys v0.5.0
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.1
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading golang.org/x/text v0.7.0
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for darwin-10.10/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for darwin-10.10/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for windows-4.0/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Cleaning up build environment...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Building /source/go.mod...
Compiling for linux/amd64...
go: downloading cloud.google.com/go/profiler v0.3.1
go: downloading github.com/veandco/go-sdl2 v0.4.34
go: downloading cloud.google.com/go v0.105.0
go: downloading github.com/goradd/maps v0.1.4
go: downloading cloud.google.com/go/compute/metadata v0.2.3
go: downloading github.com/golang/protobuf v1.5.2
go: downloading cloud.google.com/go/compute v1.14.0
go: downloading github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c
go: downloading github.com/googleapis/gax-go/v2 v2.7.0
go: downloading google.golang.org/api v0.107.0
go: downloading google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef
go: downloading google.golang.org/grpc v1.52.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
go: downloading go.opencensus.io v0.24.0
go: downloading golang.org/x/net v0.7.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading golang.org/x/sys v0.5.0
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.1
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading golang.org/x/text v0.7.0
go build frogger: copying /tmp/go-build2225081648/b001/exe/a.out: open /build/frogger-linux-amd64: operation not permitted
Compiling for linux/386...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/arm-7...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/arm64...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips64...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips64le...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mips...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for linux/mipsle...
# github.com/veandco/go-sdl2/sdl
In file included from /usr/include/SDL2/SDL_stdinc.h:31,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:32,
                 from ./sdl_wrapper.h:5,
                 from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: SDL2/_real_SDL_config.h: No such file or directory
    4 | #include <SDL2/_real_SDL_config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling for windows-4.0/amd64...
# github.com/veandco/go-sdl2/sdl
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Compiling for windows-4.0/386...
# github.com/veandco/go-sdl2/sdl
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
./sdl_wrapper.h:2:11: fatal error: SDL2/SDL.h: No such file or directory
    2 |  #include <SDL2/SDL.h>
      |           ^~~~~~~~~~~~
compilation terminated.
Compiling for darwin-10.10/amd64...
# github.com/veandco/go-sdl2/sdl
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/SDL2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Compiling for darwin-10.10/arm64...
# github.com/veandco/go-sdl2/sdl
osxcross: warning: possibly dangerous include path specified: '-I /usr/include/SDL2'
osxcross: info: you can silence this warning via 'OSXCROSS_NO_INCLUDE_PATH_WARNINGS=1' (env)
In file included from /go/pkg/mod/github.com/veandco/go-sdl2@v0.4.34/sdl/audio.go:4:
In file included from ./sdl_wrapper.h:5:
In file included from /usr/include/SDL2/SDL.h:32:
In file included from /usr/include/SDL2/SDL_main.h:25:
In file included from /usr/include/SDL2/SDL_stdinc.h:31:
/usr/include/SDL2/SDL_config.h:4:10: fatal error: 'SDL2/_real_SDL_config.h' file not found
#include <SDL2/_real_SDL_config.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Cleaning up build environment...
veeableful commented 1 year ago

Hi @jkassis, perhaps you need to cross-compile SDL2 for other OS and architecture as well as it seems like it compiled fine on linux/amd64. At least, I don't see the error that appeared on other builds when looking at the output that you provided. There is go build frogger: copying /tmp/go-build2225081648/b001/exe/a.out: open /build/frogger-linux-amd64: operation not permitted but I suppose that's simply a permission issue.