Skip to content

Commit 91cea55

Browse files
committed
chore(release): update to version 0.4.1 with memory leak fixes and comprehensive error path tests
1 parent 95cc6c8 commit 91cea55

3 files changed

Lines changed: 61 additions & 25 deletions

File tree

CHANGELOG-mceachen.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@
33
All notable changes specific to this community fork's releases will be documented here.
44
For upstream changes, see [CHANGELOG.md](CHANGELOG.md).
55

6+
## [0.4.1] - 2026-02-09
7+
8+
### Fixed
9+
10+
- **Remaining memory leaks from upstream PR #258** ([`c9be38c`](https://github.com/mceachen/sqlite-vec/commit/c9be38c))
11+
- `vec_eachFilter`: Fixed pzErrMsg leak when vector parsing fails with invalid input
12+
- `vec_slice`: Fixed vector cleanup leaks in INT8 and BIT cases on malloc failure
13+
- Changed early `return` to `goto done` to ensure cleanup functions are called
14+
- These leaks only occurred in error paths (invalid input, OOM) not covered by existing tests
15+
16+
### Added
17+
18+
- **Rust example updates for zerocopy 0.8** ([`53aeaeb`](https://github.com/mceachen/sqlite-vec/commit/53aeaeb))
19+
- Updated `examples/simple-rust/` to use zerocopy 0.8 API
20+
- Changed `AsBytes` trait to `IntoBytes` (renamed in zerocopy 0.8)
21+
- Updated documentation in `site/using/rust.md`
22+
- Incorporates [upstream PR #244](https://github.com/asg017/sqlite-vec/pull/244)
23+
24+
- **Comprehensive error path test coverage** ([`95cc6c8`](https://github.com/mceachen/sqlite-vec/commit/95cc6c8))
25+
- New `tests/test-error-paths.py` with 30 tests targeting error-handling code paths
26+
- Tests exercise error conditions that previously went untested (invalid inputs, NULL values, mismatched types/dimensions)
27+
- Covers `vec_each`, `vec_slice`, `vec_distance_*`, `vec_add`, `vec_sub`, vec0 INSERT/KNN operations
28+
- Repeated error operations test (50 iterations) to stress-test cleanup paths
29+
- Ensures sanitizers (ASan/LSan) will catch any reintroduced memory leaks in error paths
30+
31+
### Context
32+
33+
This release completes the integration of upstream PR #258's memory leak fixes. Previous releases (0.3.2, 0.3.3) addressed most issues, but three error paths remained unfixed:
34+
- Error message allocation in `vec_each` with invalid vectors
35+
- Malloc failure handling in `vec_slice` for INT8/BIT vectors
36+
37+
These paths were not detected by sanitizers because they were never executed by the test suite. The new error path tests ensure these code paths are now covered.
38+
639
## [0.4.0] - 2026-02-07
740

841
### Added

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.0
1+
0.4.1

scripts/prepare-release.sh

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
#!/usr/bin/env bash
22
#
3-
# Prepare a release branch with version bumps.
3+
# Prepare a release branch using VERSION file as source of truth.
44
#
5-
# Usage: ./scripts/prepare-release.sh <patch|minor|major>
6-
# DRY_RUN=1 ./scripts/prepare-release.sh patch # test without commit/push
5+
# Usage: ./scripts/prepare-release.sh
6+
# DRY_RUN=1 ./scripts/prepare-release.sh # test without commit/push
77
#
88
# This script:
9-
# 1. Reads current version from VERSION file
10-
# 2. Calculates new version using semver bump
9+
# 1. Reads version from VERSION file (must be bumped manually beforehand)
10+
# 2. Validates VERSION looks like valid semver
1111
# 3. Creates a release branch
12-
# 4. Updates VERSION, sqlite-vec.h, and package.json
12+
# 4. Syncs VERSION to sqlite-vec.h and package.json
1313
# 5. Commits and pushes the release branch
1414
#
1515
# Outputs (for GitHub Actions):
1616
# - Writes branch=<name> and version=<version> to $GITHUB_OUTPUT if set
1717
#
18-
# Why this exists (replacing scripts/publish-release.sh):
18+
# Developer workflow:
19+
# 1. Manually bump VERSION file (e.g., 0.4.0 → 0.4.1)
20+
# 2. Update CHANGELOG-mceachen.md with changes
21+
# 3. Commit: git commit -am "release: prepare v0.4.1"
22+
# 4. Trigger npm-release.yaml workflow
23+
# 5. Workflow runs this script, builds, publishes, merges to main
1924
#
20-
# The original publish-release.sh pushed version bumps to main BEFORE CI
21-
# builds completed. If builds failed, main was left in an inconsistent state
22-
# with a version tag pointing to broken artifacts.
25+
# Why VERSION is source of truth:
2326
#
24-
# This script is part of a safer release flow:
27+
# - Clear and transparent: "The version is whatever VERSION says"
28+
# - Prepare releases: Update CHANGELOG for new version before workflow runs
29+
# - Git history: Version bumps are explicit, visible commits
30+
# - Standard practice: Similar to Go modules, Rust crates, etc.
2531
#
26-
# 1. RELEASE BRANCH ISOLATION: Version bumps happen on a release/vX.Y.Z
32+
# Why this release flow exists:
33+
#
34+
# 1. RELEASE BRANCH ISOLATION: VERSION sync happens on a release/vX.Y.Z
2735
# branch. Main is untouched until everything succeeds.
2836
#
2937
# 2. CORRECT VERSION IN BINARIES: All platform builds check out the release
@@ -45,22 +53,17 @@
4553
#
4654
set -euo pipefail
4755

48-
BUMP_TYPE="${1:-patch}"
56+
# Get version from VERSION file (source of truth)
57+
VERSION=$(cat VERSION | tr -d '[:space:]')
58+
echo "Releasing version: $VERSION"
4959

50-
if [[ ! "$BUMP_TYPE" =~ ^(patch|minor|major)$ ]]; then
51-
echo "Usage: $0 <patch|minor|major>" >&2
60+
# Validate VERSION looks like semver (basic check)
61+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
62+
echo "ERROR: VERSION file contains invalid semver: '$VERSION'" >&2
63+
echo "Expected format: X.Y.Z or X.Y.Z-prerelease" >&2
5264
exit 1
5365
fi
5466

55-
# Get current version from VERSION file (source of truth)
56-
CURRENT=$(cat VERSION | tr -d '[:space:]')
57-
echo "Current version: $CURRENT"
58-
59-
# Calculate new version (strip prerelease suffix, then bump)
60-
BASE_VERSION=$(echo "$CURRENT" | sed 's/-.*//')
61-
NEW_VERSION=$(npx -y semver -i "$BUMP_TYPE" "$BASE_VERSION")
62-
echo "New version: $NEW_VERSION"
63-
6467
# Create release branch
6568
BRANCH="release/v${NEW_VERSION}"
6669
git checkout -b "$BRANCH"

0 commit comments

Comments
 (0)