genai-toolbox icon indicating copy to clipboard operation
genai-toolbox copied to clipboard

Update build system to enable CGO

Open averikitsch opened this issue 6 months ago • 3 comments

Prerequisites

What are you trying to do that currently feels hard or impossible?

The Kuzu and DuckDB libraries require CGO support. The binary (and docker) build need to be updated to enable the support and have the correct supporting libraries to build the binary.

Suggested Solution(s)

No response

Alternatives Considered

No response

Additional Details

No response

averikitsch avatar Aug 06 '25 22:08 averikitsch

DuckDB specific -- Able to generate multi platform images (linux/amd64 and linux/arm64) in #1101 . However, the binary build is still unsuccessful.

Found an open issue to update documentation at DuckDB regarding cross-compilation: https://github.com/marcboeker/go-duckdb/issues/279

Cloudbuild uses Linux amd64, hence we will need the following cross compilation for our binaries: linux amd64 -> darwin arm64: no verified successes linux amd64 -> darwin amd64: no verified successes linux amd64 -> windows amd64: an example was provided, I tried but that example didn't work. no verified success

Yuan325 avatar Aug 07 '25 17:08 Yuan325

Hi @averikitsch @Yuan325, any updates on this? The PRs for both KuzuDB and DuckDB are currently blocked due to this issue. Is there anything I can do on my end to help? I don’t have a personal GCP account with Cloud Build set up, but I could experiment with a local Cloud Build setup. Here’s a potential solution I’m considering—please let me know if it seems viable: Instead of relying on cross-compilation, could we spin up separate Docker instances with the required OS combinations to build and release the project from those instances?

bpranava avatar Sep 23 '25 16:09 bpranava

We need to update both the container and binary builds to have the right dependencies for DuckDB and KuzuDB. We have tried following the advice in https://github.com/marcboeker/go-duckdb/issues/279, but haven't had a chance to dive deeper. The Cloud Build setup can be simulated by using a container image. Most steps use the container golang:1. I believe we will need to update this to be a Go + OS system container to pull in the right C libraries. Here are the logs from the attempt in #1101 https://gist.github.com/averikitsch/caa25e077a7ebaa23944e359a97c3446 and the logs from the current build system for DuckDB https://gist.github.com/averikitsch/0140338a91dfc4f9caaa3562b7d910a7.

averikitsch avatar Sep 23 '25 17:09 averikitsch