Skip to content

Commit 7c69533

Browse files
author
Dylan Storey
committed
Fix vendor SQLite header path for CI builds
The Makefile referenced vendor/sqlite which doesn't exist in git. Changed to bindings/python/vendor/sqlite which contains the committed sqlite3.h and sqlite3ext.h headers. This ensures CI builds use the vendored headers for sqlite3_api pointer redirection instead of falling back to system headers. Bump to v0.1.0-beta.3.
1 parent efdfd6c commit 7c69533

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

.github/workflows/ci-full.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Build extension (macOS)
3939
if: runner.os == 'macOS'
40-
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
40+
run: make extension
4141

4242
- name: Run unit tests (Linux)
4343
if: runner.os == 'Linux'
@@ -89,7 +89,7 @@ jobs:
8989

9090
- name: Build extension (macOS)
9191
if: runner.os == 'macOS'
92-
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
92+
run: make extension
9393

9494
- name: Run Rust tests
9595
working-directory: bindings/rust
@@ -141,9 +141,7 @@ jobs:
141141
echo "$(brew --prefix python@3.11)/libexec/bin" >> $GITHUB_PATH
142142
143143
- name: Build extension
144-
run: |
145-
HOMEBREW_PREFIX=$(brew --prefix)
146-
make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
144+
run: make extension
147145

148146
- name: Install Python package
149147
run: |

Makefile

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,27 @@ SQLITE ?= sqlite3
88
# Override with: make PYTHON=python3.12 test-python
99
PYTHON ?= python3.11
1010

11-
# Platform-specific paths (for test runner linking only, not extension builds)
12-
# macOS with MacPorts: make EXTRA_LIBS=-L/opt/local/lib
13-
# macOS with Homebrew: make SQLITE=$(brew --prefix)/bin/sqlite3
11+
# Platform-specific paths for test builds (CUnit headers/libs)
12+
# macOS with MacPorts: make EXTRA_LIBS=-L/opt/local/lib EXTRA_INCLUDES=-I/opt/local/include
13+
# macOS with Homebrew: make EXTRA_INCLUDES=-I$(brew --prefix)/include EXTRA_LIBS=-L$(brew --prefix)/lib
1414
EXTRA_LIBS ?=
15+
EXTRA_INCLUDES ?=
1516

1617
# Vendored SQLite headers for consistent extension builds
17-
VENDOR_SQLITE_DIR = vendor/sqlite
18+
VENDOR_SQLITE_DIR = bindings/python/vendor/sqlite
19+
20+
# Base flags for extension builds (vendor headers only, no system includes)
21+
EXTENSION_BASE_CFLAGS = -Wall -Wextra -I$(VENDOR_SQLITE_DIR) -I./src/include
1822

1923
# Build mode: debug (default) or release
2024
# Use: make extension RELEASE=1
2125
ifdef RELEASE
22-
CFLAGS = -Wall -Wextra -O2 -I$(VENDOR_SQLITE_DIR) -I./src/include
26+
CFLAGS = -Wall -Wextra -O2 -I$(VENDOR_SQLITE_DIR) -I./src/include $(EXTRA_INCLUDES)
27+
EXTENSION_CFLAGS_BASE = -Wall -Wextra -O2 -I$(VENDOR_SQLITE_DIR) -I./src/include
2328
else
2429
# Add -DGRAPHQLITE_PERF_TIMING for detailed query timing instrumentation
25-
CFLAGS = -Wall -Wextra -g -I$(VENDOR_SQLITE_DIR) -I./src/include -DGRAPHQLITE_DEBUG
30+
CFLAGS = -Wall -Wextra -g -I$(VENDOR_SQLITE_DIR) -I./src/include -DGRAPHQLITE_DEBUG $(EXTRA_INCLUDES)
31+
EXTENSION_CFLAGS_BASE = -Wall -Wextra -g -I$(VENDOR_SQLITE_DIR) -I./src/include -DGRAPHQLITE_DEBUG
2632
endif
2733
LDFLAGS = $(EXTRA_LIBS) -lcunit -lsqlite3
2834

@@ -206,9 +212,9 @@ endif
206212
$(BUILD_DIR)/main.o: $(SRC_DIR)/main.c | dirs
207213
$(CC) $(CFLAGS) -c $< -o $@
208214

209-
# Extension object (uses vendored SQLite headers for ABI consistency)
215+
# Extension object (uses vendored SQLite headers for ABI consistency - no EXTRA_INCLUDES)
210216
$(BUILD_DIR)/extension.o: $(SRC_DIR)/extension.c | dirs
211-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
217+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
212218

213219

214220
# Help target
@@ -293,21 +299,21 @@ $(BUILD_EXECUTOR_DIR)/%.o: $(EXECUTOR_DIR)/%.c | dirs
293299
$(BUILD_EXECUTOR_DIR)/%.cov.o: $(EXECUTOR_DIR)/%.c | dirs
294300
$(CC) $(CFLAGS) $(COVERAGE_FLAGS) -c $< -o $@
295301

296-
# PIC object builds for shared library (uses vendored SQLite headers via CFLAGS)
302+
# PIC object builds for shared library (uses vendored SQLite headers only - no EXTRA_INCLUDES)
297303
$(BUILD_PARSER_DIR)/%.pic.o: $(PARSER_DIR)/%.c $(GRAMMAR_HDR) | dirs
298-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -I$(BUILD_PARSER_DIR) -c $< -o $@
304+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -I$(BUILD_PARSER_DIR) -c $< -o $@
299305

300306
$(BUILD_PARSER_DIR)/cypher_scanner.pic.o: $(SCANNER_SRC) | dirs
301-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -Wno-sign-compare -c $< -o $@
307+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -Wno-sign-compare -c $< -o $@
302308

303309
$(BUILD_PARSER_DIR)/cypher_gram.tab.pic.o: $(GRAMMAR_SRC) $(GRAMMAR_HDR) | dirs
304-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -Wno-unused-but-set-variable -I$(BUILD_PARSER_DIR) -c $< -o $@
310+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -Wno-unused-but-set-variable -I$(BUILD_PARSER_DIR) -c $< -o $@
305311

306312
$(BUILD_TRANSFORM_DIR)/%.pic.o: $(TRANSFORM_DIR)/%.c | dirs
307-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
313+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
308314

309315
$(BUILD_EXECUTOR_DIR)/%.pic.o: $(EXECUTOR_DIR)/%.c | dirs
310-
$(CC) $(CFLAGS) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
316+
$(CC) $(EXTENSION_CFLAGS_BASE) $(EXTENSION_CFLAGS) -fPIC -c $< -o $@
311317

312318
# Test objects
313319
$(BUILD_TEST_DIR)/%.o: $(TEST_DIR)/%.c $(GRAMMAR_HDR) | dirs

bindings/python/src/graphqlite/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .connection import Connection, connect, wrap
88
from .graph import Graph, graph, escape_string, sanitize_rel_type, CYPHER_RESERVED
99

10-
__version__ = "0.1.0b2"
10+
__version__ = "0.1.0b3"
1111
__all__ = [
1212
"Connection", "connect", "wrap", "load", "loadable_path",
1313
"Graph", "graph", "escape_string", "sanitize_rel_type", "CYPHER_RESERVED"

bindings/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "graphqlite"
3-
version = "0.1.0-beta.2"
3+
version = "0.1.0-beta.3"
44
edition = "2021"
55
description = "SQLite extension for graph queries using Cypher"
66
license = "MIT"

0 commit comments

Comments
 (0)