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

Changes to compilation to support linux #140

Merged
merged 1 commit into from
Mar 14, 2024
Merged

Conversation

jakeschuurmans
Copy link
Contributor

@jakeschuurmans jakeschuurmans commented Mar 14, 2024

Why CGO_ENABLED=0 to support linux:

CGO_ENABLED tells Go to interoperate with C stdlibs. Its for xcompile. So it is dynamically linking the stdlibs when its started. So when we turn it off with CGO_ENABLED=0 we statically link the binary.
Alpine is very lightweight, and don't have any stdlibs at all. They are expecting a fully functional binary. So when our containers (with dynamic linked) try to run the binary, they attempt to load in the shared libs.
The problem is that on MacOS, this is by default turned off. On Linux it is on by default. So we need to turn it off.

Thats why you would get errors like this:
exec /usr/sbin/flasher: no such file or directory
Its not that the binary is missing, but that linux failed to find the shared libs it needed.

Also doing some cleanup of the makefile

@jakeschuurmans jakeschuurmans merged commit 91ed505 into main Mar 14, 2024
7 checks passed
@jakeschuurmans jakeschuurmans deleted the LinuxSupport branch March 14, 2024 14:28
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

Successfully merging this pull request may close these issues.

2 participants