gorules / zen-go

Open-source business rules engine for Go
https://gorules.io
MIT License
76 stars 8 forks source link

Cannot build go when using CGO_ENABLED=0 #17

Closed christianmahardhika closed 2 months ago

christianmahardhika commented 3 months ago

Hello Zen-Go maintainers,

I've encountered an issue when trying to build the zen-go package with the condition CGO_ENABLED=0. Here's a brief description of the problem and the context in which it occurs:

Issue Description: When building the zen-go package with CGO_ENABLED=0, the build process fails. This issue arises when attempting to create a Docker container based on Alpine Linux, which uses musl libc instead of glibc. The zen-go package seems to have dependencies or components that require CGO, which in turn relies on glibc.

Steps to Reproduce:

  1. Set the environment variable CGO_ENABLED=0.
  2. Run the build command: GOOS=linux go build -o bin/main cmd/main.go.
  3. Attempt to run the resulting binary in an Alpine-based Docker container.

Expected Behavior: The binary should build without issues and run successfully in an Alpine-based Docker environment.

Actual Behavior: The build process fails, indicating a dependency on CGO-enabled libraries that are not compatible with musl libc.

Environment:

I believe this is an important compatibility issue that could affect anyone looking to deploy zen-go in a minimal Docker environment like Alpine. Any guidance or fixes would be greatly appreciated.

Thank you for your attention to this matter.

Best regards, Christian

ivanmiletic commented 2 months ago

Hi @christianmahardhika we do not support musl yet. This is our support matrix:

https://github.com/gorules/zen?tab=readme-ov-file#support-matrix

Best regards, Ivan

christianmahardhika commented 2 months ago

Appreciate for the answer @ivanmiletic