Skip to content

build: release the C API and columnar-dbc crates with GoReleaser - #549

Merged
zeroshade merged 14 commits into
feat/rust-cratesfrom
build/release-capi-rust
Nov 4, 2026
Merged

zeroshade merged 14 commits into
feat/rust-cratesfrom
build/release-capi-rust

Conversation

@zeroshade

@zeroshade zeroshade commented Oct 28, 2026 •

Copy link
Copy Markdown
Member
  • .goreleaser.yaml gains a capi c-archive build that cross-compiles all 5 targets with Zig 0.17.0 (glibc 2.28 / macOS 12 floors).
  • scripts/stage_capi.py checks size and stages each archive; scripts/publish_crates.py runs cargo package (snapshot) or cargo publish (on v* tag pushes, from the production_deploy GoReleaser run). Publishing skips crate versions already on crates.io, so re-running a partially published release finishes the rest. ids: [dbc] filters keep the archives out of the CLI packaging.
  • New rust_test job runs on the snapshot's archives on six native runners (Linux x64/arm64, macOS arm64/x64, Windows MSVC and GNU), with a 30-minute timeout.
  • Needs a CARGO_REGISTRY_TOKEN secret in the production environment (see RELEASE.md).

Stacked on #548. Supersedes #543.

libdbc-dev / libdbc-devel

  • A new capi-shared build (linux amd64/arm64, SONAME libdbc.so).
  • Two nfpm entries: deb libdbc-dev (/usr/lib/<triplet>) and rpm libdbc-devel (/usr/lib64). Each ships libdbc.a, libdbc.so, /usr/include/libdbc.h and pkgconfig/dbc.pc.
  • scripts/stage_devel.py stages the .so and .pc files.
  • nfpm takes only the c-archive build's artifacts, because both builds emit libdbc.h and GoReleaser doesn't deduplicate.
  • The packages ship in release, blobs, and Cloudsmith (columnar/dbc, alongside the CLI packages; stable releases only).

New CI job devel packages (amd64 + arm64):

  • installs the snapshot .deb;
  • runs the Rust tests with the default build (pkg-config, statically linked, checked with ldd), with DBC_DYNAMIC, and with DBC_SYS_LIB_DIR (scripts/test_devel_rust.sh);
  • installs the .rpm in a Fedora container, runs the same Rust tests against it, and compiles and runs a C smoke program, statically and dynamically.

Docs

  • docs/getting_started/installation.md gains a "Linux Package Repositories (deb/rpm)" section: adding the Cloudsmith columnar/dbc apt/dnf repo (setup script or manual config), installing dbc / libdbc-dev / libdbc-devel, or installing a file from GitHub Releases. Linked from the README.
  • The columnar-dbc / columnar-dbc-sys rustdoc and crate README explain installing the dev package from the repo or from GitHub Releases, with links to the repo, releases, and install docs.

macOS / Windows static libdbc-dev

  • New libdbc-dev archive from the capi build: libdbc-dev_<v>_darwin_{amd64,arm64}.tar.gz and libdbc-dev_<v>_windows_amd64.zip with libdbc.a (libdbc.lib on Windows), libdbc.h, LICENSE, and a relocatable dbc.pc (prefix=${pcfiledir}). Attached to the release and the bucket.
  • libdbc Homebrew formula via GoReleaser brews → columnar-tech/homebrew-tap (brew install columnar-tech/tap/libdbc). brews is deprecated in favor of casks, but casks can't install into lib//include/, so a formula is the only option for a library.
  • Windows zip → Cloudsmith raw package libdbc-dev-windows-x64 via a cloudsmith-raw custom publisher (scripts/publish_cloudsmith_raw.py); the cloudsmiths pipe only handles deb/rpm/apk. Stable releases only.
  • DBC_SYS_LIB_DIR accepts libdbc.lib on Windows. winget is now restricted to the CLI archives (it otherwise skips with "multiple archives for the same platform").
  • New CI job devel archive: on macOS arm64/x64 installs the snapshot formula from a local tap, runs brew test, and runs the Rust suite with the default pkg-config build; on Windows MSVC/GNU runs the Rust suite against the unpacked zip with DBC_SYS_LIB_DIR.

@zeroshade
zeroshade added this pull request to stack #550 October 28, 2026 22:46
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 7781288 to 80ee534 Compare October 28, 2026 22:51
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 80ee534 to 60e48e1 Compare October 28, 2026 23:29
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 60e48e1 to 324ef29 Compare October 28, 2026 23:45
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 324ef29 to 646d26d Compare October 29, 2026 17:07
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 646d26d to 992be1e Compare October 30, 2026 15:54
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 992be1e to 8d24200 Compare November 3, 2026 18:07
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 98244ec to a317e41 Compare November 3, 2026 18:21
@zeroshade

Copy link
Copy Markdown
Member Author

@felipecrv it's not built on a manylinux container, but the shared libs do pin the lower glibc versions (2.3.2 on x86_64 and 2.17 on aarch64) which are well under 2.28 and thus would pass any manylinux check.

When we add python bindings to this, we'd use manylinux for the wheel builds. We're targeting gnu.2.28 which is the same glibc 2.28 floor that manylinux_2_28 sets without needing to actually build it on the container.

and yes, both claude AND codex have reviewed the scripts 😄

@felipecrv

Copy link
Copy Markdown
Contributor

but the shared libs do pin the lower glibc versions (2.3.2 on x86_64 and 2.17 on aarch64)

I'm always afraid of forgetting a pin somewhere and producing a binary that depends on late glibc.

@zeroshade

Copy link
Copy Markdown
Member Author

It's easy enough to add a check in the workflow to validate the glibc symbols, i'll do that 😄

zeroshade added a commit that referenced this pull request Nov 4, 2026
…sitories

Moved out of #549 for separate review: adds a Linux Package Repositories
(deb/rpm) section and libdbc development library instructions to
installation.md, linked from the README, and restores the columnar-dbc /
columnar-dbc-sys links to that section.
…bc.pc

Build Linux shared libraries with an unversioned libdbc.so SONAME alongside the existing C archives. Stage format-specific pkg-config metadata and package Debian multiarch and RPM lib64 development layouts without duplicate generated headers.

Exercise installed Debian libraries from Rust in static, dynamic, and custom-directory modes, and test Fedora RPMs with static and dynamic C consumers. Publish the development packages with the existing release and blob artifacts.
Move the Rust devel-package test loop into scripts/test_devel_rust.sh and
run it in the Fedora container after installing the snapshot's
libdbc-devel, alongside the existing libdbc-dev run on Ubuntu.
…-dev

Add installation docs for adding the columnar/dbc Cloudsmith repository
(setup script or manual config) and link them from the README. The Rust
crate docs and README now explain installing libdbc-dev/libdbc-devel from
the repository or from GitHub Releases.
Package the capi static library for macOS (tar.gz) and Windows (zip) with
libdbc.h, LICENSE, and a relocatable dbc.pc. Publish a libdbc Homebrew
formula to columnar-tech/homebrew-tap with GoReleaser's brews publisher,
and upload the Windows zip to Cloudsmith as a raw package through a
custom publisher. DBC_SYS_LIB_DIR now accepts the zip's libdbc.lib on
Windows. Restrict winget to the CLI archives.

CI installs the snapshot formula from a local tap and runs the default
pkg-config Rust build on macOS, and runs the Rust suite against the
unpacked zip on Windows MSVC and GNU.
GoReleaser 2.19 (used by CI via "~> v2") archives the c-archive's cgo
header itself, so the explicit files entry collided with it.
Go builds the macOS c-archives on Linux with GNU ar, whose members are not
8-byte aligned; Apple's arm64 linker rejects them when linking libdbc.a
directly (the Homebrew formula's brew test). Rewrite them with zig ar
--format=darwin in the capi post hook.
- Explain why setup-zig caching stays off (zizmor cache-poisoning, #366)
  and why rust_test has a 30-minute timeout.
- macOS devel archive job: brew tap-new --no-git, no auto-update/cleanup.
- libdbc-dev/libdbc-devel: lint-clean under lintian and rpmlint --strict.
  Section libdevel, copyright/LICENSE, synopsis + extended description,
  libc dependency, ldconfig trigger, a changelog, stripped libdbc.so
  (--strip-all), pkgconfig(dbc) provides, 0755 .so on rpm. Intentional
  findings (unversioned SONAME, GoReleaser's fixed 0755 artifact mode) are
  overridden in the package / rpmlintrc.
- New scripts/lint_devel_packages.sh, run by the devel packages job.
Per review: the installation.md section and README link are reviewed
separately, in the docs PR stacked on this one.
The Linux package repositories section of installation.md moved to #559, so
the anchor these links pointed at doesn't exist on this branch. #559 adds
the links back with the section.
The Zig targets set the glibc floor, but nothing checked the result: a cgo or
Zig change pulling in a newer symbol would have shipped. A post hook on the
capi and capi-shared builds runs scripts/check_glibc_floor.py on each Linux
library before anything is packaged or published. A shared library's
required versions are read with readelf; a static archive, which records
none, is linked whole against Zig's glibc 2.28 stubs, then checked the same
way.
zeroshade added a commit that referenced this pull request Nov 4, 2026
…sitories

Moved out of #549 for separate review: adds a Linux Package Repositories
(deb/rpm) section and libdbc development library instructions to
installation.md, linked from the README, and restores the columnar-dbc /
columnar-dbc-sys links to that section.
@zeroshade
zeroshade force-pushed the build/release-capi-rust branch from 611c20d to 5c6d5d0 Compare November 4, 2026 20:02
@zeroshade
zeroshade merged commit 03e0dae into main Nov 4, 2026
34 checks passed
@zeroshade
zeroshade deleted the build/release-capi-rust branch November 4, 2026 20:11
zeroshade added a commit that referenced this pull request Nov 4, 2026
…sitories

Moved out of #549 for separate review: adds a Linux Package Repositories
(deb/rpm) section and libdbc development library instructions to
installation.md, linked from the README, and restores the columnar-dbc /
columnar-dbc-sys links to that section.
zeroshade added a commit that referenced this pull request Nov 4, 2026
… support (#551)

Stacked on #549.

Brings the language bindings up to the CLI's registry and auth handling.
Goes through `internal/api` → C ABI → Rust → npm-wasm.

### Registries
- Explicit registry list: `registries: [{url, name}]` (C:
`registry.<n>.url` / `registry.<n>.name`) → `dbc.WithRegistries`. It is
used as given, with no merging.
- **Behaviour change:** bindings now honor the user's global
`config.toml` by default, like the CLI. `registryConfig: "none"` (C:
`registry_config=none`) opts out. In the browser it is always `none`.
- Project registries: `projectFile` (C: `project_file`) → the
`registries` / `replace_defaults` keys from a `dbc.toml`.
- `baseURL` or an explicit list overrides all configuration files, as
`DBC_BASE_URL` does for the CLI.

### Credentials
- `login(credential)` / `logout(registryURL)` (C: `dbc_login`,
`dbc_logout`) store or remove token credentials in dbc's credential
store.
- An injected `credential` now applies only to its own host; other hosts
fall back to stored credentials, matching what the header already
documented. `credentialStore: "none"` (C: `credential_store=none`)
disables stored-credential lookup.
- `auth.AddCredential`/`RemoveCredential` re-read the credentials file
before writing. Without this, a stale snapshot held by another worker or
process dropped other entries on write. Test included.

### License
- `licensePath()` / `installLicense(path, {force})` (C:
`dbc_license_path`, `dbc_install_license` + `DBC_LICENSE_FORCE`).

The C ABI goes from 13 to 17 exports; Rust bindings are regenerated.
Node/Rust docs note that credential lookups in an already-running
runtime don't see changes another runtime makes.

### Testing
Go (including `-race ./auth`), npm-wasm smoke and worker tests, Rust
tests and clippy, bindgen drift check, and a throwaway C ABI smoke run
against a local registry with an isolated credential store.

---------

Co-authored-by: Bryce Mecum <[email protected]>

This branch was previously deployed

1 inactive deployment
snapshot — 5c6d5d0b Deployed Nov 4, 2026 by zeroshade via snapshot #1221
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.

3 participants