Skip to content

feat: add typed C API static library for language bindings - #547

Draft
zeroshade wants to merge 2 commits into
refactor/wasm-internal-apifrom
feat/capi
Draft

zeroshade wants to merge 2 commits into
refactor/wasm-internal-apifrom
feat/capi

Conversation

@zeroshade

Copy link
Copy Markdown
Member

capi/ builds as a Go c-archive exposing 13 functions: an opaque dbc_client configured with ADBC-style key/value options, and a single dbc_list result type read with dbc_list_get/dbc_list_info (DBC_FIELD_* ids). libdbc.h is generated by cgo from capi/exports.go; there is no hand-written header.

Stacked on #546.

I removed the sentence in `capi/main.go` that said releases build the C library through a `capi` GoReleaser build, since no such build exists. Release artifacts still won't include `libdbc.a`.
I didn't add the GoReleaser build. The existing release config builds everything with `CGO_ENABLED=0`, and a `-buildmode=c-archive` build needs cgo plus a C cross-compiler for every OS/architecture pair, which CI doesn't have yet. That needs its own change if you want the library in releases. The package comment still gives the manual `go build` command.
The build passes and `go test ./...` passes.
Changes:
- Removed the comment in `capi/main.go` saying a `capi` build in `.goreleaser.yaml` produces the C archive, since that packaging isn't set up yet

This branch was successfully deployed

1 active deployment
snapshot — d0bbfc97 Deployed Oct 29, 2026 by zeroshade via snapshot #1089
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.

1 participant