Skip to content

Commit b687644

Browse files
authored
Merge branch 'main' into test/added-sqlean-extensions
2 parents 83abe2a + b5dab26 commit b687644

1,536 files changed

Lines changed: 75057 additions & 84246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/extensions-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
- uses: hecrj/setup-rust-action@v2
6969
- name: Checkout repository
7070
uses: actions/checkout@v3
71+
- name: install libs
72+
run: |
73+
sudo apt install libblas-dev liblapack-dev
7174
- name: build libsql and ffi bindings
7275
run: |
7376
cargo xtask build-bundled

.github/workflows/golang-bindings.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ jobs:
6868
path: "go-libsql"
6969

7070
- name: Copy sql-experimental library to go-libsql
71-
run: cp target/release/libsql_experimental.a go-libsql/lib/darwin_amd64/
72-
&& cp target/release/libsql_experimental.a go-libsql/lib/darwin_arm64/
71+
run: cp target/release/libsql_experimental.a go-libsql/lib/darwin_arm64/
7372
&& cp target/release/libsql_experimental.a go-libsql/lib/linux_amd64/
7473
&& cp target/release/libsql_experimental.a go-libsql/lib/linux_arm64/
7574
&& cp bindings/c/include/libsql.h go-libsql/lib/include/

.github/workflows/libsql-server-release.yml

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Copyright 2022-2024, axodotdev
1+
# This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
2+
#
3+
# Copyright 2025 Astral Software Inc.
24
# SPDX-License-Identifier: MIT or Apache-2.0
35
#
46
# CI that:
57
#
68
# * checks for a Git Tag that looks like a release
7-
# * builds artifacts with cargo-dist (archives, installers, hashes)
9+
# * builds artifacts with dist (archives, installers, hashes)
810
# * uploads those artifacts to temporary workflow zip
911
# * on success, uploads the artifacts to a GitHub Release
1012
#
@@ -22,10 +24,10 @@ permissions:
2224
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2325
#
2426
# If PACKAGE_NAME is specified, then the announcement will be for that
25-
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
27+
# package (erroring out if it doesn't have the given version or isn't dist-able).
2628
#
2729
# If PACKAGE_NAME isn't specified, then the announcement will be for all
28-
# (cargo-dist-able) packages in the workspace with that version (this mode is
30+
# (dist-able) packages in the workspace with that version (this mode is
2931
# intended for workspaces with only one dist-able package, or with all dist-able
3032
# packages versioned/released in lockstep).
3133
#
@@ -43,9 +45,9 @@ on:
4345
- 'libsql-server**[0-9]+.[0-9]+.[0-9]+*'
4446

4547
jobs:
46-
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
48+
# Run 'dist plan' (or host) to determine what tasks we need to do
4749
plan:
48-
runs-on: "ubuntu-20.04"
50+
runs-on: "ubuntu-22.04"
4951
outputs:
5052
val: ${{ steps.plan.outputs.manifest }}
5153
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
@@ -57,25 +59,25 @@ jobs:
5759
- uses: actions/checkout@v4
5860
with:
5961
submodules: recursive
60-
- name: Install cargo-dist
62+
- name: Install dist
6163
# we specify bash to get pipefail; it guards against the `curl` command
6264
# failing. otherwise `sh` won't catch that `curl` returned non-0
6365
shell: bash
64-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
65-
- name: Cache cargo-dist
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/cargo-dist/releases/download/v0.28.3/cargo-dist-installer.sh | sh"
67+
- name: Cache dist
6668
uses: actions/upload-artifact@v4
6769
with:
6870
name: cargo-dist-cache
69-
path: ~/.cargo/bin/cargo-dist
71+
path: ~/.cargo/bin/dist
7072
# sure would be cool if github gave us proper conditionals...
7173
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7274
# functionality based on whether this is a pull_request, and whether it's from a fork.
7375
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7476
# but also really annoying to build CI around when it needs secrets to work right.)
7577
- id: plan
7678
run: |
77-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
78-
echo "cargo dist ran successfully"
79+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80+
echo "dist ran successfully"
7981
cat plan-dist-manifest.json
8082
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8183
- name: "Upload dist-manifest.json"
@@ -93,18 +95,19 @@ jobs:
9395
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
9496
strategy:
9597
fail-fast: false
96-
# Target platforms/runners are computed by cargo-dist in create-release.
98+
# Target platforms/runners are computed by dist in create-release.
9799
# Each member of the matrix has the following arguments:
98100
#
99101
# - runner: the github runner
100-
# - dist-args: cli flags to pass to cargo dist
101-
# - install-dist: expression to run to install cargo-dist on the runner
102+
# - dist-args: cli flags to pass to dist
103+
# - install-dist: expression to run to install dist on the runner
102104
#
103105
# Typically there will be:
104106
# - 1 "global" task that builds universal installers
105107
# - N "local" tasks that build each platform's binaries and platform-specific installers
106108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
107109
runs-on: ${{ matrix.runner }}
110+
container: ${{ matrix.container && matrix.container.image || null }}
108111
env:
109112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110113
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -115,10 +118,17 @@ jobs:
115118
- uses: actions/checkout@v4
116119
with:
117120
submodules: recursive
121+
- name: Install Rust non-interactively if not already installed
122+
if: ${{ matrix.container }}
123+
run: |
124+
if ! command -v cargo > /dev/null 2>&1; then
125+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
127+
fi
118128
- name: "Prepare env vars"
119129
run: "echo \"RUSTFLAGS=--cfg tokio_unstable\" >> $GITHUB_ENV"
120-
- name: Install cargo-dist
121-
run: ${{ matrix.install_dist }}
130+
- name: Install dist
131+
run: ${{ matrix.install_dist.run }}
122132
# Get the dist-manifest
123133
- name: Fetch local artifacts
124134
uses: actions/download-artifact@v4
@@ -132,8 +142,8 @@ jobs:
132142
- name: Build artifacts
133143
run: |
134144
# Actually do builds and make zips and whatnot
135-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
136-
echo "cargo dist ran successfully"
145+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146+
echo "dist ran successfully"
137147
- id: cargo-dist
138148
name: Post-build
139149
# We force bash here just because github makes it really hard to get values up
@@ -143,7 +153,7 @@ jobs:
143153
run: |
144154
# Parse out what we just built and upload it to scratch storage
145155
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
146-
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
156+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
147157
echo "EOF" >> "$GITHUB_OUTPUT"
148158
149159
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -160,20 +170,20 @@ jobs:
160170
needs:
161171
- plan
162172
- build-local-artifacts
163-
runs-on: "ubuntu-20.04"
173+
runs-on: "ubuntu-22.04"
164174
env:
165175
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166176
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
167177
steps:
168178
- uses: actions/checkout@v4
169179
with:
170180
submodules: recursive
171-
- name: Install cached cargo-dist
181+
- name: Install cached dist
172182
uses: actions/download-artifact@v4
173183
with:
174184
name: cargo-dist-cache
175185
path: ~/.cargo/bin/
176-
- run: chmod +x ~/.cargo/bin/cargo-dist
186+
- run: chmod +x ~/.cargo/bin/dist
177187
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
178188
- name: Fetch local artifacts
179189
uses: actions/download-artifact@v4
@@ -184,8 +194,8 @@ jobs:
184194
- id: cargo-dist
185195
shell: bash
186196
run: |
187-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
188-
echo "cargo dist ran successfully"
197+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
198+
echo "dist ran successfully"
189199
190200
# Parse out what we just built and upload it to scratch storage
191201
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -210,19 +220,19 @@ jobs:
210220
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
211221
env:
212222
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213-
runs-on: "ubuntu-20.04"
223+
runs-on: "ubuntu-22.04"
214224
outputs:
215225
val: ${{ steps.host.outputs.manifest }}
216226
steps:
217227
- uses: actions/checkout@v4
218228
with:
219229
submodules: recursive
220-
- name: Install cached cargo-dist
230+
- name: Install cached dist
221231
uses: actions/download-artifact@v4
222232
with:
223233
name: cargo-dist-cache
224234
path: ~/.cargo/bin/
225-
- run: chmod +x ~/.cargo/bin/cargo-dist
235+
- run: chmod +x ~/.cargo/bin/dist
226236
# Fetch artifacts from scratch-storage
227237
- name: Fetch artifacts
228238
uses: actions/download-artifact@v4
@@ -233,7 +243,7 @@ jobs:
233243
- id: host
234244
shell: bash
235245
run: |
236-
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
246+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
237247
echo "artifacts uploaded and released successfully"
238248
cat dist-manifest.json
239249
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -270,7 +280,7 @@ jobs:
270280
needs:
271281
- plan
272282
- host
273-
runs-on: "ubuntu-20.04"
283+
runs-on: "ubuntu-22.04"
274284
env:
275285
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
276286
PLAN: ${{ needs.plan.outputs.val }}
@@ -301,6 +311,11 @@ jobs:
301311
name=$(echo "$filename" | sed "s/\.rb$//")
302312
version=$(echo "$release" | jq .app_version --raw-output)
303313
314+
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
315+
brew update
316+
# We avoid reformatting user-provided data such as the app description and homepage.
317+
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
318+
304319
git add "Formula/${filename}"
305320
git commit -m "${name} ${version}"
306321
done
@@ -315,7 +330,7 @@ jobs:
315330
# still allowing individual publish jobs to skip themselves (for prereleases).
316331
# "host" however must run to completion, no skipping allowed!
317332
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
318-
runs-on: "ubuntu-20.04"
333+
runs-on: "ubuntu-22.04"
319334
env:
320335
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
321336
steps:

.github/workflows/publish-server.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
125125
build-arm64:
126126
permissions: write-all
127-
runs-on: buildjet-8vcpu-ubuntu-2204-arm
127+
runs-on: ubuntu-24.04-arm
128128
env:
129129
platform: "linux/arm64"
130130
steps:

.github/workflows/rust.yml

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
name: Run Checks
2525
env:
26+
RUST_BACKTRACE: 1
2627
RUSTFLAGS: -D warnings --cfg tokio_unstable
2728
steps:
2829
- uses: hecrj/setup-rust-action@v2
@@ -130,12 +131,97 @@ jobs:
130131
- name: Run tests
131132
run: cargo nextest run
132133

133-
- name: Run tests with custom pager
134-
env:
135-
LIBSQL_EXPERIMENTAL_PAGER: 1000
136-
run: cargo nextest run
137-
- name: clean build dir
138-
run: rm -rf libsql-ffi/bundled/SQLite3MultipleCiphers/build
134+
- name: Run libsql encryption tests
135+
run: cargo test --features encryption --color=always --test encryption test_encryption
136+
# test-custom-pager:
137+
# runs-on: ubuntu-latest
138+
# name: Run Tests
139+
# env:
140+
# RUSTFLAGS: -D warnings --cfg tokio_unstable
141+
# steps:
142+
# - uses: hecrj/setup-rust-action@v2
143+
144+
# # needed because we run out of disk space during tests
145+
# - name: Free Disk Space (Ubuntu)
146+
# uses: jlumbroso/free-disk-space@main
147+
# with:
148+
# # this might remove tools that are actually needed,
149+
# # when set to "true" but frees about 6 GB
150+
# tool-cache: true
151+
152+
# - name: Install deps
153+
# run: sudo apt update && sudo apt install -y libclang-dev
154+
155+
# - name: Install protoc
156+
# uses: taiki-e/install-action@v2
157+
# with:
158+
# tool: protoc@${{ env.PROTOC_VERSION }}
159+
160+
# - uses: taiki-e/install-action@v2
161+
# with:
162+
# tool: nextest
163+
164+
# - uses: actions/checkout@v3
165+
166+
# - name: Set up cargo cache
167+
# uses: actions/cache@v3
168+
# continue-on-error: false
169+
# with:
170+
# path: |
171+
# ~/.cargo/bin/
172+
# ~/.cargo/registry/index/
173+
# ~/.cargo/registry/cache/
174+
# ~/.cargo/git/db/
175+
# target/
176+
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
177+
# restore-keys: ${{ runner.os }}-cargo-
178+
# - name: Run tests with custom pager
179+
# env:
180+
# LIBSQL_EXPERIMENTAL_PAGER: 1000
181+
# run: cargo nextest run
182+
test-encryption:
183+
runs-on: ubuntu-latest
184+
name: Run Tests
185+
env:
186+
RUST_BACKTRACE: 1
187+
RUSTFLAGS: -D warnings --cfg tokio_unstable
188+
steps:
189+
- uses: hecrj/setup-rust-action@v2
190+
191+
# needed because we run out of disk space during tests
192+
- name: Free Disk Space (Ubuntu)
193+
uses: jlumbroso/free-disk-space@main
194+
with:
195+
# this might remove tools that are actually needed,
196+
# when set to "true" but frees about 6 GB
197+
tool-cache: true
198+
199+
- name: Install deps
200+
run: sudo apt update && sudo apt install -y libclang-dev
201+
202+
- name: Install protoc
203+
uses: taiki-e/install-action@v2
204+
with:
205+
tool: protoc@${{ env.PROTOC_VERSION }}
206+
207+
- uses: taiki-e/install-action@v2
208+
with:
209+
tool: nextest
210+
211+
- uses: actions/checkout@v3
212+
213+
- name: Set up cargo cache
214+
uses: actions/cache@v3
215+
continue-on-error: false
216+
with:
217+
path: |
218+
~/.cargo/bin/
219+
~/.cargo/registry/index/
220+
~/.cargo/registry/cache/
221+
~/.cargo/git/db/
222+
target/
223+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
224+
restore-keys: ${{ runner.os }}-cargo-
139225
- name: embedded replica encryption tests
140226
run: cargo xtask test-encryption
141227
windows:

.github/workflows/server-pr-images.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,6 @@ jobs:
6969
cache-from: type=gha
7070
cache-to: type=gha,mode=max
7171

72-
- name: Build and push Docker image with durable-wal
73-
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
74-
with:
75-
context: .
76-
push: true
77-
tags: ${{ steps.meta.outputs.tags }}-durable-wal-${{ steps.get-short-sha.outputs.sha }}
78-
labels: ${{ steps.meta.outputs.labels }}
79-
cache-from: type=gha
80-
cache-to: type=gha,mode=max
81-
build-args: |
82-
BUILD_DEBUG=true
83-
ENABLE_FEATURES=durable-wal
84-
8572
- name: Echo image name
8673
run: |
8774
echo "Pushed: ${{ steps.meta.outputs.tags }}-${{ steps.get-short-sha.outputs.sha }}"
88-
echo "Pushed: ${{ steps.meta.outputs.tags }}-durable-wal-${{ steps.get-short-sha.outputs.sha }}"

0 commit comments

Comments
 (0)