Repository navigation
feat: columnar-dbc Rust crates over a typed C API, with signature verification in Client.Install - #543
Closed
zeroshade wants to merge 13 commits into
Closed
feat: columnar-dbc Rust crates over a typed C API, with signature verification in Client.Install#543zeroshade wants to merge 13 commits into
zeroshade wants to merge 13 commits into
Conversation
…ly tests out of crate
Changes: - Limited Windows support in `columnar-dbc-sys` to `x86_64-pc-windows-gnu`, using `target_env = "gnu"` in `Cargo.toml`, `src/lib.rs` and `build.rs`. The Windows archive is built with `zig cc -target x86_64-windows-gnu`, so it depends on the MinGW C runtime and can't be linked reliably by MSVC. MSVC targets now get the existing "no prebuilt dbc library for this target" build error instead of unresolved symbols at link time. - `rust/platforms/windows-x64/build.rs` now fails with a clear message on non-GNU targets. After the archive, it links `kernel32` (the only DLL the Go runtime imports directly; other Windows DLLs are loaded at runtime) and the MinGW runtime libraries `mingwex`, `mingw32` and `msvcrt`. - Changed the Windows row in the README's supported-targets table, which said "see below" but had nothing below it, to `x86_64-pc-windows-gnu` with a note that MSVC isn't supported. Verification: Go build and `go test ./...` pass. `cargo test -p columnar-dbc -p columnar-dbc-sys` passes on Linux, and the Windows `build.rs` compiles. No Windows toolchain is available here, so the actual Windows link is untested.
I removed the MSVC Windows row from the Rust release test matrix, which leaves `x86_64-pc-windows-gnu` as the only Windows target there. No other part of `.github/` mentions `windows-msvc`. The Go build passes and the workflow YAML is valid. I didn't run the Go test suite because this change only touches workflow YAML, and the Rust release CI itself wasn't run here. Changes: - Removed the `x86_64-pc-windows-msvc` row from the `rust_test` matrix in `.github/workflows/release.yml`, since `columnar-dbc-sys` no longer supports that target and the release CI would fail on it
This reverts commit 3533c1f.
This reverts commit 3246e63.
zeroshade
added a commit
that referenced
this pull request
Nov 4, 2026
- `.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`.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
columnar-dbc, a Rust crate that statically links dbc, built on a new typed C API (capi/). It also fixes a gap where library installs skipped signature verification.Signature verification (security fix)
SignedByColumnar's deprecation note saysClient.Installverifies signatures, but it didn't: only the CLI did. Library and npm-wasm installs accepted drivers whose library was modified after signing.dbc.VerifyManifestSignature(moved from the CLI) is now shared by the library,install, andsync.Client.Installverifies on a staged copy before touching the target location, so a failed reinstall never damages an existing install.dbc.AllowUnsigned()opts out, like--no-verify.api.InstallOptions,DBC_INSTALL_ALLOW_UNSIGNED, RustInstallOptions::allow_unsigned, npminstall(name, location, { allowUnsigned }).Shared operation layer
internal/apiholds search/resolve/install/uninstall/list once. The WASM bindings now use it, and install/uninstall/list accept an explicit directory or theuser/systemconfig level.Typed C API (
capi/, 13 functions)dbc_client_new; every operation returns onedbc_list(dbc_list_get/dbc_list_infowithDBC_FIELD_*ids).libdbc.his generated by cgo fromcapi/exports.go; Rust bindings are generated from it by pinned bindgen 0.73.2 and drift-checked in CI.Rust crates (
rust/)columnar-dbc(safe API),columnar-dbc-sys(bindings), and fivecolumnar-dbc-sys-<platform>crates, each bundling a prebuiltlibdbc.a.Release
.goreleaser.yamlgains acapic-archive build that cross-compiles all 5 targets with Zig 0.17.0 (glibc 2.28 / macOS 12 floors).afterhookscargo package(snapshot) orcargo publish(release).ids: [dbc]filters keep the archives out of the CLI's packaging.rust_testmatrix runs on the snapshot's archives on six native runners: Linux x64/arm64, macOS arm64/x64, Windows MSVC and GNU.go.modminimum unchanged).CARGO_REGISTRY_TOKENsecret in theproductionenvironment (see RELEASE.md).Windows
One Zig-built archive is intended for both
x86_64-pc-windows-msvcand-gnu. It imports only kernel32 plus standard CRT symbols, and has no.drectveentries or MinGW/libgcc helpers. The GNU link was verified locally with an msvcrt mingw-w64 toolchain (mingw-w64 provides__acrt_iob_func). The MSVC link is verified by this PR'srust x86_64-pc-windows-msvcjob; this is plan Task 6, still open.Testing
go vet/go test ./...(with and without cgo), npm-wasm smoke/worker tests, a C smoke test against the generated header, Zig cross-builds for all 5 targets, Rust roundtrip + level tests (including a real user-level install), a bindgen drift check, actionlint, and a windows-gnu cross-link of the Rust tests.rust_testjobs.