Skip to content

release: derive C version from Git tags for v0.1.0-preview.1 - #91

Merged
Xuanwo merged 10 commits into
mainfrom
xuanwo/prepare-prerelease-version
Nov 21, 2026
Merged

Xuanwo merged 10 commits into
mainfrom
xuanwo/prepare-prerelease-version

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Prepare the first C preview under the independent, tag-based C SemVer policy. The Cargo package is fixed at 0.0.0; CMake, pkg-config, documentation and the package manifest take the version from the exact Git tag at HEAD. Untagged trees and sources without their own Git repository report 0.0.0-dev. The first release tag will be v0.1.0-preview.1; this PR creates no tag or release.

The preview ships five native packages: Linux amd64/arm64, Apple Silicon macOS, and Windows amd64/arm64. Intel macOS is not built or released.

Version policy

  • Tags use strict SemVer with a v prefix: ASCII digits, no leading zeroes in major/minor/patch or numeric prerelease identifiers, no empty identifiers, and valid build metadata. v0.0.0-dev is reserved for the untagged fallback.
  • Local versions come from actual tag refs pointing at HEAD. Invalid tags are filtered first, and each selected tag is checked by its peeled commit. If several valid tags point at the same commit, local builds prefer the last stable tag in Git's version sort, otherwise the last prerelease. A tag-dispatched build always uses the explicitly selected verified tag.
  • .github/scripts/version.py is the shared policy for packaging, standalone Sphinx and workflow tag validation. CMake implements the same policy without adding a Python dependency to ordinary builds. CMake keeps a numeric project(VERSION) and exposes the full pre-release text to the status line, pkg-config and Doxyfile.
  • CMake reads the tag when it configures. After creating or moving a tag in an existing build directory, rerun the CMake configuration step before building.

Tagged workflow dispatch

Create an annotated tag on the exact commit and dispatch Shared Library Packages on that tag. The workflow keeps the exact-SHA checkout, validates the tag name with the shared Python policy, fetches the tag ref explicitly, and requires its peeled commit to equal the checked-out HEAD. It records the tag object, peeled commit and version for the package steps. A tag on a parent commit, another branch or an enclosing repository is rejected or ignored.

The package manifest and consumer verification use the same peeled commit and tag version as the build. The workflow does not create tags or upload releases.

Main integration

Current main 5388ca84d6213aa9468518d2c7c7090c6bd5e602 includes the Windows Cargo-home fix (#94) and the ordered update API (#81). The branch merges that main append-only at 2c41461b930a03cd83fe749f595fcf12cc478367; the Windows fix appears exactly once.

This branch removes the Intel macOS job so PR CI cannot schedule it. A separate cleanup PR owns the matching CMake/package target removal; after it lands, this branch will absorb that main commit without duplicating behavior.

Validation

Validated in isolated local fixtures; no tag was created in the product checkout and no remote tag was used:

  • Untagged commit: CMake, pkg-config, Doxyfile, Sphinx and package manifest report 0.0.0-dev; project(VERSION) is 0.0.0.
  • Exact annotated v0.1.0-preview.1: the same surfaces report 0.1.0-preview.1; project version is 0.1.0; standalone Sphinx on the tagged tree reports the tag version.
  • Ordinary child commit after the tag: all surfaces return to 0.0.0-dev, including cached local CMake reconfiguration.
  • Invalid leading-zero, malformed, annotated non-release and v0.0.0-dev tags are ignored; a valid tag at the same commit is still selected. Multiple valid tags follow the documented stable-first rule.
  • A source directory without its own .git inside a tagged parent repository still reports 0.0.0-dev.
  • A shallow, exact-SHA clone with no tags accepts an explicit tag fetch; refs/tags/v0.1.0-preview.1^{} equals HEAD.
  • Package fixture tests: 15/15 passed, including strict-tag, invalid-tag coexistence, multiple-tag, annotated-tag, child-commit and parent-repository cases.
  • cargo metadata --locked --offline passes for the root and example provider; workflow YAML has five targets and tag verification before build/package.
  • No Rust rebuild was run locally. Hosted CI is running on 2c41461.

Migration notes for the preview

0.33.0 was an unpublished Cargo version used across incompatible public headers. Do not use it as an ABI baseline. If a comparison needs a named baseline, use source commit b18804a or the final landed header. Recompile against the preview header.

  • lancedb_connection_open_table changed shape. At 0ae98b4 it was LanceDBTable* lancedb_connection_open_table(const LanceDBConnection*, const char*). The preview takes four arguments (LanceDBTable** table_out, char** error_message) and returns LanceDBError. Update call sites and recompile.
  • LANCEDB_UNKNOWN moved from 22 to 99. 22 is now LANCEDB_PERMISSION_DENIED and 23 is LANCEDB_NOT_FOUND. Recompile and update any persisted numeric codes.
  • Public struct layouts changed. LanceDBVectorIndexConfig.accelerator and LanceDBScalarIndexConfig.force_update_statistics were removed. LanceDBFtsIndexConfig.max_tokens became max_token_length; the old field never took effect, so set max_token_length when a single-token limit is required. LanceDBMergeInsertConfig gained condition fields; earlier clients that assign its fields individually must initialize both added condition pointers to NULL for unconditional behavior. Recompile with updated initializers.
  • Three no-op stub symbols were removed. lancedb_table_cleanup_old_versions, lancedb_table_compact_files and lancedb_table_restore_version returned success without doing work. Clients that call them dynamically should remove those calls and use the supported optimize/restore paths where needed.
  • SQL predicates use SQL-standard quoting. String literals use single quotes and double quotes delimit identifiers. Replace key = "value" with key = 'value'; double-quoted identifiers such as "Column Name" still work.
  • IVF probe defaults are adaptive. Leaving nprobes unset now uses Lance's adaptive bounds instead of a fixed 20/20. Call lancedb_vector_query_nprobes(query, 20, ...) to keep the old fixed behavior.
  • nprobes(0) fails at execution. lancedb_vector_query_nprobes() still returns LANCEDB_SUCCESS; lancedb_vector_query_execute() returns NULL and lancedb_vector_query_explain_plan() returns LANCEDB_INVALID_INPUT with nprobes must be greater than 0.
  • Vector index creation on an empty table succeeds. lancedb_table_create_vector_index now creates a listed index instead of failing. Callers that relied on that failure should use lancedb_table_count_rows_with_status().
  • Enterprise db:// connections reject custom sessions. Attaching a session then executing a db:// connection returns LANCEDB_NOT_SUPPORTED; omit the session and use server-managed caching.
  • Build requirement moves to Rust 1.95.0 with the SDK upgrade.
  • Additive C APIs in this preview: status-preserving count and version getters, named-index prewarm, ordered update expressions with LanceDBUpdateResult (zero may mean unknown on legacy remote responses), and a public header that compiles as C. EXPLAIN plans now honor stored SQL filters.
  • First prebuilt packages: five shared-library archives cover Linux, Apple Silicon macOS and Windows. The release must record the tag object and peeled commit, the pinned SDK revision, and each archive SHA-256 for Go.

Re-evaluate these notes against the final landed headers before publication.

Locked release inputs

  • SDK: lancedb 0.42.0-beta.21, tag v0.42.0-beta.21, revision b35cce60d66e5ae58e7ef470af7bd268d22c0396
  • Lance: lance, lance-io, lance-namespace 15.0.0-beta.25, tag v15.0.0-beta.25, revision f5dbd55dd79f1f0412f897ed1917128300fb8c1a
  • Root package: lancedb-c 0.0.0, rust-version 1.95.0

No tag, release, asset upload or merge is created here.

Cargo.toml owns the package version. CMake derives the numeric project version from it for project(VERSION), while pkg-config and the CMake status line report the full pre-release version. The packaging manifest now records the same Cargo version, and documentation metadata follows it.

The example provider lock only changes the path package version; dependency resolution is unchanged.
The locked Lance v15.0.0-beta.25 fixture has a 188-character relative test-data path. Cargo's default Windows checkout prefix pushes it to 261 characters, over MAX_PATH, so use C:\c as CARGO_HOME only on Windows and report the effective value. The longest checkout path becomes 238 characters. The Rust cache reads CARGO_HOME, so it caches the same short home.
Keep the unpublished Cargo package at 0.0.0. CMake, pkg-config, documentation and the package manifest now use a v-prefixed Git tag at HEAD, or 0.0.0-dev when the source is untagged or has no repository of its own. CMake keeps a numeric project version and passes the full version to the docs build.

Tag dispatch fetches the tag ref after the exact-SHA checkout, requires its peeled commit to be HEAD, and records the tag object and commit for the package. A tag on a parent commit, another branch or an enclosing repository is not inherited.
@Xuanwo Xuanwo changed the title release: prepare v0.34.0-preview.1 metadata release: derive C version from Git tags for v0.1.0-preview.1 Nov 21, 2026
Centralize strict SemVer in version.py for packaging, Sphinx and tag workflow validation. Resolve local tags from actual refs at HEAD instead of git describe, filter invalid and reserved tags first, and prefer the last stable tag in Git's version sort otherwise the last prerelease. Reject leading-zero, development and v-prefixed overrides consistently.

Drop the Intel macOS package job so the first preview covers Linux amd64/arm64, Apple Silicon macOS, and Windows amd64/arm64. Leave the CMake/package target removal to the standalone cleanup change.
…ease-version

# Conflicts:
#	.github/workflows/packages.yml
CMake no longer forwards its internal 0.0.0-dev fallback as LANCEDB_VERSION. Sphinx resolves the same tag or explicit override itself, so ordinary PR and untagged docs builds keep the strict public version semantics.
CMake forwards its resolved result to conf.py as LANCEDB_RESOLVED_VERSION, which takes precedence over the public LANCEDB_VERSION override for the docs build. Standalone Sphinx still uses the strict public resolution and rejects an explicit 0.0.0-dev. This keeps pkg-config, Doxyfile and Sphinx on the same configure-time release without treating the dev fallback as a user override.
version.resolve_version() no longer reads LANCEDB_RESOLVED_VERSION. docs/conf.py consumes it through parse_resolved(), so package.py cannot be overridden by the docs transport. Public LANCEDB_VERSION validation no longer strips whitespace, matching CMake's strict behavior.
Keep git tag output as one string and consume one complete newline-terminated tag at a time with string(FIND/SUBSTRING). Semicolons and unmatched brackets in Git-legal invalid tags are no longer CMake list delimiters, so they cannot swallow or reorder valid tags. Existing ref and peeled verification stay in place.
@Xuanwo
Xuanwo merged commit 7526923 into main Nov 21, 2026
14 checks passed
Xuanwo added a commit that referenced this pull request Nov 21, 2026
Integrate #91 tag-derived versioning and provenance with the five-platform package workflow. Keep package archives on v* tags and explicit dispatch, the strict selected-tag object and peeled-commit checks, the Windows native MSVC Debug consumer, Apple Silicon target policy, fast PR package fixtures, and read-only workflow token.
Xuanwo added a commit that referenced this pull request Nov 21, 2026
Integrate #108 strict C17 checks and workflow hardening alongside the native Windows C and C++ consumer build. Keep one test PATH mechanism based on RUST_TARGET_DIR, the MSVC lancedb.dll.lib import path, five release-tag/dispatch package targets, and #91 exact tag provenance.
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