-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to build for linux on macOS #465
Comments
Try to build in Docker or you can build in CI and grab binary from artifacts (in GitLab) |
Hi @newtorn, did you try this command?
|
Is |
Hi @nasermirzaei89, yes I believe so. It points to the |
Need Help!! building for linux on MacOS
|
Hi @pavankumar-go, I believe I could cross-compile to Linux successfully before on macOS but now I also get the same error (though I'm now on the newer macOS Catalina instead of Mojave). It could be caused by the new OS or Xcode updates. What do you think of using Docker to build it? I will create the Docker image later and it can be used as an alternative way to cross-compile to other OS. Linux is our most tested platform for cross-compiling so I thought it might be a good choice. |
I have created a Docker image that I've tried on macOS Catalina to compile go-sdl2 application. After installing and launching Docker, you should be able to go to the application directory and run |
Hi @veeableful tried building using your docker image still no luck :(
|
I built sample with this Dockerfile: FROM golang:1.14-alpine as prequisite
RUN apk add build-base libx11-dev sdl2-dev
FROM prequisite AS base
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
FROM base as build
COPY main.go .
RUN go build -v -o game1 main.go
FROM scratch as release
COPY --from=build /src/game1 / but I didn't test it on Linux!!! Build with: (Docker Engine 19.03) DOCKER_BUILDKIT=1 docker build --target release --output type=local,dest=. . After that, you can find |
Anyway i wrote one too
able to build for linux os |
Ahh yes, I'm sorry. I did not test for other packages, only |
No description provided.
The text was updated successfully, but these errors were encountered: