Skip to content
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

Unable to compile an nginx unit Golang application under Windows #1008

Open
ritterzk opened this issue Nov 23, 2023 · 1 comment
Open

Unable to compile an nginx unit Golang application under Windows #1008

ritterzk opened this issue Nov 23, 2023 · 1 comment

Comments

@ritterzk
Copy link

Is: When I try to compile a Golang application for nginx unit under Windows I get the following error:

$ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o myapp cmd/main.go;
# runtime/cgo
linux_syscall.c: In function ‘_cgo_libc_setresgid’:
linux_syscall.c:67:20: error: implicit declaration of function ‘setresgid’; did you mean ‘setregid’? [-Werror=implicit-function-declaration]
   67 |         SET_RETVAL(setresgid((gid_t) x->args[0], (gid_t) x->args[1],
      |                    ^~~~~~~~~
linux_syscall.c:34:31: note: in definition of macro ‘SET_RETVAL’
   34 |   uintptr_t ret = (uintptr_t) fn ; \
      |                               ^~
linux_syscall.c: In function ‘_cgo_libc_setresuid’:
linux_syscall.c:73:20: error: implicit declaration of function ‘setresuid’; did you mean ‘setreuid’? [-Werror=implicit-function-declaration]
   73 |         SET_RETVAL(setresuid((uid_t) x->args[0], (uid_t) x->args[1],
      |                    ^~~~~~~~~
linux_syscall.c:34:31: note: in definition of macro ‘SET_RETVAL’
   34 |   uintptr_t ret = (uintptr_t) fn ; \
      |                               ^~
cc1: all warnings being treated as errors

I found out that the package unit-dev/unit-devel is required for compilation, which is not available for Windows (not even for mingw).

Question: Is there a possibility or is it planned to be able to compile nginx unit Golang projects under Windows without WSL?
We have an environment under which WSL is not available.

@tippexs
Copy link
Contributor

tippexs commented Nov 24, 2023

Good morning! Thanks for reaching out! Windows is not a supported platform to run Unit but this is an interesting question. The dev packages for Unit contains all the important requirements to build such applications. It will need some investigation on how to do it property on windows. I would recommend using a dev container as WSL is not an option for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants