Skip to content

Statically link DuckDB ICU and JSON extensions - #85

Merged
itssimon merged 7 commits into
mainfrom
static-duckdb-extensions
Oct 23, 2026
Merged

itssimon merged 7 commits into
mainfrom
static-duckdb-extensions

Conversation

@itssimon

@itssimon itssimon commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Statically links DuckDB's ICU and JSON extensions so that time zone aware SQL works reliably and offline.

Problem

The crates.io duckdb package omits the ICU extension. DuckDB downloads it from extensions.duckdb.org on first use and loads it in the middle of binding a query. This triggers a DuckDB bug where function binding picks the wrong function, so queries like date_trunc('day', timestamp AT TIME ZONE 'UTC') failed in roughly 8 of 10 runs with random binder errors. Without ICU, timestamp::DATE and now() - INTERVAL 1 DAY also fail, which the skill worked around. The JSON extension was also downloaded at runtime.

Changes

  • Use duckdb-rs from its v1.10505.0 git tag with the bundled-cmake, icu and json features (the crates.io package omits the DuckDB sources needed to build ICU)
  • Release workflow: build arm64 targets on native runners (DuckDB's CMake build runs a helper binary, which fails when cross-compiling), and use a short target directory on Windows (an object path otherwise exceeds the MSVC 260 character limit)
  • Skill: remove the ICU workarounds (AT TIME ZONE in the date example, epoch_ns arithmetic for time bounds) and document that SQL date functions and output use the system time zone
  • Renovate: match duckdb by dependency name so the grouping rule still applies to the git dependency
  • AGENTS.md: document the CMake build requirement and how to update duckdb

Verification

  • All six release targets built on CI with the release workflow's settings, with ICU and JSON statically linked and a date/cast/interval/JSON smoke query passing 20/20 runs on each
  • All SQL examples in the skill pass against the new build, and nothing is downloaded to ~/.duckdb

Cost

Download sizes grow by 3.4 to 4.4 MB (+20 to 24%) per platform, e.g. macOS arm64 16.6 MB -> 20.2 MB. The x64 Windows build job takes about 30 minutes instead of 21.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.67%. Comparing base (2850f18) to head (3de7068).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  Coverage   91.67%   91.67%           
=======================================
  Files          13       13           
  Lines        2523     2523           
=======================================
  Hits         2313     2313           
  Misses        210      210           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@itssimon
itssimon merged commit 03a79e7 into main Oct 23, 2026
7 checks passed
@itssimon
itssimon deleted the static-duckdb-extensions branch October 23, 2026 08:27
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