From 8468e296346099dfe389a47f268061ed3609e137 Mon Sep 17 00:00:00 2001 From: Malcolm Still Date: Sun, 23 Jun 2024 18:18:27 +0100 Subject: [PATCH] Fix fts5 (without vendoring) (#41) * In updating build.zig I have forgotten that we need FTS support - Let's add a test that we can successfully initialise database in GitHub Action (will fail initially) * Try again * Revendor zig-sqlite * Reremove vendored zig-sqlite * Use zig master again * Use latest zig-sqlite that allows enabling fts5 without vendoring * Update url * Also run tests on change to build.zig.zon --- .github/workflows/release.yaml | 4 ++-- .github/workflows/test.yaml | 14 ++++++++++++-- build.zig | 1 + build.zig.zon | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 942946f..7923c5e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v2 - uses: goto-bus-stop/setup-zig@v1 with: - version: 0.13.0 + version: master - run: echo -n $GITHUB_REF_NAME > src/.version - run: zig build - run: echo "zig-out/bin" >> $GITHUB_PATH @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v2 - uses: goto-bus-stop/setup-zig@v1 with: - version: 0.13.0 + version: master - run: echo -n $GITHUB_REF_NAME > src/.version - run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.target }}-${{ matrix.os }} - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eb4a8e6..e551fbc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,6 +5,7 @@ on: - src/** - lib/** - build.zig + - build.zig.zon - .github/workflows/test.yaml jobs: @@ -18,13 +19,22 @@ jobs: - uses: actions/checkout@v2 - uses: goto-bus-stop/setup-zig@v1 with: - version: 0.13.0 + version: master - run: zig build -Dtarget=${{ matrix.target }}-${{ matrix.os }} + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: goto-bus-stop/setup-zig@v1 + with: + version: master + - run: zig build + - run: zig-out/bin/clerk lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: goto-bus-stop/setup-zig@v1 with: - version: 0.13.0 + version: master - run: zig fmt --check src/*.zig diff --git a/build.zig b/build.zig index 5f23242..e3c1ab6 100644 --- a/build.zig +++ b/build.zig @@ -7,6 +7,7 @@ pub fn build(b: *std.Build) void { const sqlite = b.dependency("sqlite", .{ .target = target, .optimize = optimize, + .fts5 = true, }); const @"ansi-term" = b.dependency("ansi-term", .{ diff --git a/build.zig.zon b/build.zig.zon index b392ea1..8644b84 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,8 +3,8 @@ .version = "0.0.0", .dependencies = .{ .sqlite = .{ - .url = "https://github.com/vrischmann/zig-sqlite/archive/91e5fedd15c5ea3cb42ccceefb3d0f4bb9bad68f.tar.gz", - .hash = "1220ba277845cb3cece7a7a1f929b920c97e9085bb644471c5dc8c72571f1485c75f", + .url = "https://github.com/vrischmann/zig-sqlite/archive/878f8cf92b308dabe2dce9e24bd7849e005f7ab5.tar.gz", + .hash = "1220a3ff3c8e2a41fe0fe73e795e0eee4c3882edceef8ef16b0b250c7895709a9192", }, .@"ansi-term" = .{ // ansi-term not yet on zig-0.13.0