Skip to content

Commit 6d8d6b9

Browse files
committed
feat: add macOS x86_64 build step for sqlite3 shell to support architecture compatibility
1 parent 53fc0dc commit 6d8d6b9

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,22 @@ jobs:
275275
if: matrix.name == 'macos'
276276
run: brew link sqlite --force
277277

278+
- name: macos x86_64 build x86_64 sqlite3 shell
279+
# The macos-15 runner is arm64; Homebrew's sqlite3 is arm64-only. To
280+
# exercise `.load ./dist/adam.dylib` against an x86_64 dylib (this
281+
# matrix entry's artifact) we need an x86_64 sqlite3 binary —
282+
# Rosetta translates whole processes, not individual dlopen calls.
283+
if: matrix.name == 'macos' && matrix.arch == 'x86_64'
284+
run: |
285+
curl -sLO https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
286+
unzip -q sqlite-amalgamation-*.zip
287+
cd sqlite-amalgamation-*
288+
cc -arch x86_64 -O2 -DSQLITE_ENABLE_LOAD_EXTENSION \
289+
shell.c sqlite3.c -o "$GITHUB_WORKSPACE/sqlite3_x86_64"
290+
cd ..
291+
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-*
292+
echo "SQLITE3=$GITHUB_WORKSPACE/sqlite3_x86_64" >> "$GITHUB_ENV"
293+
278294
- name: linux install dependencies
279295
if: startsWith(matrix.name, 'linux-cpu') || startsWith(matrix.name, 'linux-gpu')
280296
run: sudo apt-get update && sudo apt-get install -y libssl-dev

0 commit comments

Comments
 (0)