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

Force CGO_ENABLED=0 env when cross-compiling project binaries #116

Closed
djelusic opened this issue Mar 4, 2022 · 0 comments
Closed

Force CGO_ENABLED=0 env when cross-compiling project binaries #116

djelusic opened this issue Mar 4, 2022 · 0 comments

Comments

@djelusic
Copy link
Contributor

djelusic commented Mar 4, 2022

While analyzing user logs we discovered an instance of builds failing with the following error:

# runtime/cgo
linux_syscall.c:67:13: error: implicit declaration of function 'setresgid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
linux_syscall.c:67:13: note: did you mean 'setregid'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here
linux_syscall.c:73:13: error: implicit declaration of function 'setresuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
linux_syscall.c:73:13: note: did you mean 'setreuid'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:595:6: note: 'setreuid' declared here

Full logs: 9a0cfd14-5344-418f-871d-660115756bd4.csv

We were able to reproduce this by explicitly setting CGO_ENABLED=1 when building project binaries so there is likely an override somewhere in the user's environment. We can fix this by always forcing CGO_ENABLED=0 in when mantil is building binaries.

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

No branches or pull requests

1 participant