From 899081d55eb54fa2674042fd26d16442034ed595 Mon Sep 17 00:00:00 2001 From: Shawn Chen Date: Mon, 13 Jul 2026 17:10:17 +1200 Subject: [PATCH 1/2] release: publish subpackages as 26.5.3 and test the freshly built addon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v3.2.0 publish run failed in the subpackages job: the loader prefers the installed @chdb/lib- subpackage over build/Release, so test:all exercised the published 26.5.2 addon — which predates the Arrow C Data Interface exports (ArrowRegisterColumns/…) that the Layer 3 arrow-input path requires. Remove the installed subpackages before test:all, exactly as the test workflow already does. That failure also exposed a release blocker the tests were right to catch: the subpackage version was still 26.5.2, which is already on the registry, so the publish step would have skipped and chdb@3.2.0 would have resolved the stale addon on user machines. Bump the subpackage line to 26.5.3 (a packaging revision — the bundled libchdb stays v26.5.1-rc.1) and pin optionalDependencies to match. Co-Authored-By: Claude Fable 5 --- .github/workflows/prebuild-publish.yml | 8 ++++++++ package.json | 8 ++++---- update_libchdb.sh | 20 +++++++++++--------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/prebuild-publish.yml b/.github/workflows/prebuild-publish.yml index 91cba61..69aff10 100644 --- a/.github/workflows/prebuild-publish.yml +++ b/.github/workflows/prebuild-publish.yml @@ -48,6 +48,14 @@ jobs: - run: npm install --ignore-scripts - run: npm run libchdb - run: npm run build + - name: Exercise the freshly built addon (not the published prebuilt) + # The loader prefers the installed @chdb/lib- subpackage over + # a local build (see dist/loader.js). npm install pulls the PREVIOUS + # published subpackage via optionalDependencies, whose addon lags the + # in-repo native source — so without this, test:all exercises the old + # binary instead of the one this run is about to package and publish. + shell: bash + run: rm -rf node_modules/@chdb/lib-* - run: npm run test:all - name: Derive subpackage version from update_libchdb.sh run: | diff --git a/package.json b/package.json index 9ecfdca..56b2ed7 100644 --- a/package.json +++ b/package.json @@ -93,10 +93,10 @@ "node-gyp-build": "^4.6.0" }, "optionalDependencies": { - "@chdb/lib-darwin-arm64": "26.5.2", - "@chdb/lib-darwin-x64": "26.5.2", - "@chdb/lib-linux-arm64-gnu": "26.5.2", - "@chdb/lib-linux-x64-gnu": "26.5.2" + "@chdb/lib-darwin-arm64": "26.5.3", + "@chdb/lib-darwin-x64": "26.5.3", + "@chdb/lib-linux-arm64-gnu": "26.5.3", + "@chdb/lib-linux-x64-gnu": "26.5.3" }, "peerDependencies": { "@clickhouse/client": ">=1.23.0", diff --git a/update_libchdb.sh b/update_libchdb.sh index c7d6f0e..0c98c6b 100755 --- a/update_libchdb.sh +++ b/update_libchdb.sh @@ -16,15 +16,17 @@ set -e LATEST_RELEASE=v26.5.1-rc.1 # Version published for the @chdb/lib- native subpackages on npm. -# DECOUPLED from LATEST_RELEASE on purpose: chdb-core has no 26.5.2 release, but -# the previously published subpackage versions (26.5.0, 26.5.1-rc.1) shipped a -# non-relocatable Linux binary (chdb-io/chdb-node#50). npm forbids republishing -# over an existing version, so the relocatability fix needs a NEW version — a -# formal packaging revision — while the bundled libchdb stays LATEST_RELEASE -# above (the only build carrying the #73/#15 C-ABI the binding requires). The -# publish + cleanroom workflows read CHDB_LIB_VERSION from here, and the main -# package's optionalDependencies pin this exact value. -LIBCHDB_NPM_VERSION=26.5.2 +# DECOUPLED from LATEST_RELEASE on purpose: chdb-core has no 26.5.x releases +# past 26.5.1-rc.1, but the subpackage also ships the N-API addon, so any +# change to the addon's export surface needs a NEW subpackage version — npm +# forbids republishing over an existing one. 26.5.2 was the relocatability +# packaging revision (chdb-io/chdb-node#50); 26.5.3 adds the Arrow C Data +# Interface exports (ArrowRegisterColumns/…) the Layer 3 arrow-input path +# requires. The bundled libchdb stays LATEST_RELEASE above (the only build +# carrying the #73/#15 C-ABI the binding requires). The publish + cleanroom +# workflows read CHDB_LIB_VERSION from here, and the main package's +# optionalDependencies pin this exact value. +LIBCHDB_NPM_VERSION=26.5.3 # Download the correct version based on the platform case "$(uname -s)" in From ac4c15da1b4d2306576a6187db10b0d63b4a652c Mon Sep 17 00:00:00 2001 From: Shawn Chen Date: Mon, 13 Jul 2026 17:33:38 +1200 Subject: [PATCH 2/2] test(pack): cover Arrow C Data Interface input in the installed-package suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The verify job installs the just-published package from the registry on every platform, but its suite only proved the native addon loads and queries — it never touched the Arrow registration natives. A stale @chdb/lib-* subpackage (versioned independently of this package) passes every existing case and still lacks ArrowRegisterColumns, which is exactly the gap the failed v3.2.0 publish run fell into. Register a small columnar table through the default export and read it back via arrowstream() so verify exercises the addon's export surface end to end. Co-Authored-By: Claude Fable 5 --- test/pack/installed.test.mjs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/pack/installed.test.mjs b/test/pack/installed.test.mjs index 39925a4..3c1afdc 100644 --- a/test/pack/installed.test.mjs +++ b/test/pack/installed.test.mjs @@ -13,6 +13,9 @@ import { describe, it, expect } from 'vitest' import { query, queryAsync, Session, version } from 'chdb' +// The Layer 3 fluent surface (registerArrowTable / selectFrom / chTable) is +// reached through the default export in ESM — see the index.mjs comment. +import chdb from 'chdb' // Run cases sequentially. The suite mixes the standalone default connection // (`version()`, `query()`, `queryAsync()`) with a `Session` that binds its @@ -37,6 +40,30 @@ describe.sequential('installed chdb package', () => { expect(r.text().trim().split('\n')).toHaveLength(3) }) + it('round-trips Arrow C Data Interface input (native ArrowRegisterColumns)', async () => { + // Guards the addon's export surface, not just its loadability: the + // installed binary comes from the @chdb/lib-* subpackage, which is + // versioned independently of this package — a stale subpackage loads + // and queries fine but lacks the Arrow registration natives. + const t = chdb.registerArrowTable('installed_arrow', [ + { name: 'id', type: 'Int32', data: new Int32Array([1, 2, 3]) }, + { name: 'tag', type: 'String', data: ['a', 'b', 'c'] }, + ]) + try { + const rows = await chdb.selectFrom(chdb.chTable.arrowstream('installed_arrow').as('t')) + .select(['id', 'tag']) + .orderBy('id') + .execute() + expect(rows).toEqual([ + { id: 1, tag: 'a' }, + { id: 2, tag: 'b' }, + { id: 3, tag: 'c' }, + ]) + } finally { + t.close() + } + }) + it('creates a Session and round-trips an insert + query + stream', async () => { const s = new Session() try {