Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
COMMIT=$(shell git rev-parse HEAD)
VERSION=$(shell cat VERSION)
DATE=$(shell date +'%FT%TZ%z')
VERSION_MAJOR=$(shell cut -d. -f1 VERSION)
VERSION_MINOR=$(shell cut -d. -f2 VERSION)
VERSION_PATCH=$(shell cut -d. -f3 VERSION | cut -d- -f1)

INSTALL_LIB_DIR = /usr/local/lib
INSTALL_INCLUDE_DIR = /usr/local/include
Expand Down Expand Up @@ -150,13 +153,17 @@ $(TARGET_CLI): sqlite-vec.h $(LIBS_DIR)/sqlite-vec.a $(LIBS_DIR)/shell.a $(LIBS_


sqlite-vec.h: sqlite-vec.h.tmpl VERSION
VERSION=$(shell cat VERSION) \
VERSION=$(VERSION) \
DATE=$(shell date -r VERSION +'%FT%TZ%z') \
SOURCE=$(shell git log -n 1 --pretty=format:%H -- VERSION) \
VERSION_MAJOR=$$(echo $$VERSION | cut -d. -f1) \
VERSION_MINOR=$$(echo $$VERSION | cut -d. -f2) \
VERSION_PATCH=$$(echo $$VERSION | cut -d. -f3 | cut -d- -f1) \
VERSION_MAJOR=$(VERSION_MAJOR) \
VERSION_MINOR=$(VERSION_MINOR) \
VERSION_PATCH=$(VERSION_PATCH) \
envsubst < $< > $@
grep -Eq '^#define SQLITE_VEC_VERSION "[^"]+"' $@
grep -Eq '^#define SQLITE_VEC_VERSION_MAJOR [0-9]+' $@
grep -Eq '^#define SQLITE_VEC_VERSION_MINOR [0-9]+' $@
grep -Eq '^#define SQLITE_VEC_VERSION_PATCH [0-9]+' $@

clean:
rm -rf dist
Expand All @@ -174,7 +181,7 @@ format: $(FORMAT_FILES)
clang-format -i $(FORMAT_FILES)
black tests/test-loadable.py

lint: SHELL:=/bin/bash
lint: SHELL:=$(shell command -v bash || echo /bin/bash)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The lint target picks a bash path via command -v bash || echo /bin/bash. If bash exists but isn't on PATH (or if command -v prints nothing), this will fall back to /bin/bash and fail with a confusing "No such file" error on platforms like FreeBSD where bash is typically in /usr/local/bin. Consider making the target fail fast with a clear error when bash can't be located, rather than defaulting to /bin/bash.

Suggested change
lint: SHELL:=$(shell command -v bash || echo /bin/bash)
lint: SHELL:=$(or $(shell command -v bash 2>/dev/null),$(error bash is required for the lint target; please install bash and ensure it is on PATH))

Copilot uses AI. Check for mistakes.
lint:
diff -u <(cat $(FORMAT_FILES)) <(clang-format $(FORMAT_FILES))

Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail xtrace
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

set -euo pipefail xtrace does not enable xtrace; it sets the positional parameters to the literal string xtrace (and can break argument handling if this script ever starts using "$@"/"$1"). Use a proper xtrace flag (e.g., include -x in the set options, or enable xtrace in a separate set -x command).

Suggested change
set -euo pipefail xtrace
set -euxo pipefail

Copilot uses AI. Check for mistakes.

Expand Down
2 changes: 1 addition & 1 deletion scripts/vendor.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
mkdir -p vendor
curl -o sqlite-amalgamation.zip https://www.sqlite.org/2024/sqlite-amalgamation-3450300.zip
unzip sqlite-amalgamation.zip
Expand Down
Loading