From 23b808a6cb4ba1fea86e241cb3c5fdbfa62ada4e Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:09:10 +0200 Subject: [PATCH 01/32] feat(workflow): add musl build for alpine container --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3e353c..2c3ffa9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,7 @@ permissions: jobs: build: runs-on: ${{ matrix.os }} + container: ${{ matrix.container && matrix.container || '' }} name: ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'wasm' && matrix.name != 'apple-xcframework' && ' + test' || ''}} timeout-minutes: 20 strategy: @@ -49,6 +50,9 @@ jobs: - os: macos-latest name: apple-xcframework make: xcframework + - os: ubuntu-latest + name: musl + container: alpine:latest defaults: run: From 85f4b166533b185a5071e19c7e579a2f26d0bf05 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:13:12 +0200 Subject: [PATCH 02/32] feat(workflow): add musl arm64 builds --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c3ffa9..b8ffd9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,6 +51,11 @@ jobs: name: apple-xcframework make: xcframework - os: ubuntu-latest + arch: x86_64 + name: musl + container: alpine:latest + - os: LinuxARM64 + arch: arm64 name: musl container: alpine:latest From 121d4a55f0efa221618686afb112b2002e2f2a9d Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:17:27 +0200 Subject: [PATCH 03/32] fix(workflow): update ARM architecture OS to ubuntu-24.04-arm in build matrix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b8ffd9d..0ddb873 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,7 +54,7 @@ jobs: arch: x86_64 name: musl container: alpine:latest - - os: LinuxARM64 + - os: ubuntu-24.04-arm arch: arm64 name: musl container: alpine:latest From af552e0da7054869b72fee24ed20268bb128298a Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:36:14 +0200 Subject: [PATCH 04/32] fix(workflow): adjust build steps for musl target in CI workflow --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ddb873..f1b41ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,6 +90,12 @@ jobs: run: sudo apt install wabt - name: build sqlite-sync + if: matrix.name == 'musl' + run: make extension ${{ matrix.make && matrix.make || ''}} + shell: sh + + - name: build sqlite-sync + if: matrix.name != 'musl' run: make extension ${{ matrix.make && matrix.make || ''}} - name: windows install sqlite3 From 46ff873cc5e5c8ebd3b74f7d4d300873cc00dde7 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:41:28 +0200 Subject: [PATCH 05/32] fix(workflow): adjust shell usage for musl builds in CI workflow --- .github/workflows/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1b41ae..ce04fb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: defaults: run: - shell: bash + shell: ${{ matrix.name == 'musl' && 'sh' || 'bash' }} env: CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }} @@ -90,12 +90,6 @@ jobs: run: sudo apt install wabt - name: build sqlite-sync - if: matrix.name == 'musl' - run: make extension ${{ matrix.make && matrix.make || ''}} - shell: sh - - - name: build sqlite-sync - if: matrix.name != 'musl' run: make extension ${{ matrix.make && matrix.make || ''}} - name: windows install sqlite3 From f39022e4b9c6e02eba2107361970cf60eed7a916 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:46:21 +0200 Subject: [PATCH 06/32] feat(workflow): add install build dependencies for musl --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce04fb7..a710019 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,6 +70,17 @@ jobs: steps: + - name: Alpine system info + if: matrix.name == 'musl' + run: | + echo "=== Alpine Linux Information ===" + cat /etc/alpine-release + echo "Kernel: $(uname -r)" + echo "Architecture: $(uname -m)" + echo "Shell: $SHELL" + echo "Available shells:" + cat /etc/shells + - uses: actions/checkout@v4.2.2 - uses: msys2/setup-msys2@v2.27.0 @@ -79,6 +90,24 @@ jobs: install: >- mingw-w64-x86_64-cc make + + - name: Install build dependencies + if: matrix.name == 'musl' + run: | + # Update package index and install essential build tools + apk update + apk add --no-cache \ + git \ + gcc \ + g++ \ + make \ + cmake \ + musl-dev \ + linux-headers \ + pkgconfig \ + autoconf \ + automake \ + libtool - name: windows build curl if: matrix.os == 'windows-latest' From 42eeb1e6cc3e3a48d6b5109a45d8ef824e25ad4d Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:47:54 +0200 Subject: [PATCH 07/32] feat(workflow): add curl to build dependencies for musl --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a710019..37315a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -102,6 +102,7 @@ jobs: g++ \ make \ cmake \ + curl \ musl-dev \ linux-headers \ pkgconfig \ From 1d3d0cd91910de7b613506a2d935e80a9ccfb869 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 10:55:17 +0200 Subject: [PATCH 08/32] feat(workflow): add openssl-dev to build dependencies for musl --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37315a5..82bc6d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,6 +103,7 @@ jobs: make \ cmake \ curl \ + openssl-dev \ musl-dev \ linux-headers \ pkgconfig \ From baa87634744ab48420fa1a60328dcb89e60bcf3c Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:01:12 +0200 Subject: [PATCH 09/32] feat(workflow): enable musl test --- .github/workflows/main.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82bc6d0..4433d18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,16 +52,16 @@ jobs: make: xcframework - os: ubuntu-latest arch: x86_64 - name: musl + name: linux-musl container: alpine:latest - os: ubuntu-24.04-arm arch: arm64 - name: musl + name: linux-musl container: alpine:latest defaults: run: - shell: ${{ matrix.name == 'musl' && 'sh' || 'bash' }} + shell: ${{ matrix.name == 'linux-musl' && 'sh' || 'bash' }} env: CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }} @@ -70,17 +70,6 @@ jobs: steps: - - name: Alpine system info - if: matrix.name == 'musl' - run: | - echo "=== Alpine Linux Information ===" - cat /etc/alpine-release - echo "Kernel: $(uname -r)" - echo "Architecture: $(uname -m)" - echo "Shell: $SHELL" - echo "Available shells:" - cat /etc/shells - - uses: actions/checkout@v4.2.2 - uses: msys2/setup-msys2@v2.27.0 @@ -92,9 +81,8 @@ jobs: make - name: Install build dependencies - if: matrix.name == 'musl' + if: matrix.name == 'linux-musl' run: | - # Update package index and install essential build tools apk update apk add --no-cache \ git \ @@ -175,7 +163,7 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: test sqlite-sync - if: matrix.name == 'linux' || matrix.name == 'windows' + if: contains(matrix.name, 'linux') || matrix.name == 'windows' run: make test - name: test sqlite-sync + coverage From 784ef3867d813cc69aa5268a8c2c5a3ad8980d06 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:04:03 +0200 Subject: [PATCH 10/32] feat(workflow): add git clone step for musl arm64 builds --- .github/workflows/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4433d18..5982d1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,6 +71,7 @@ jobs: steps: - uses: actions/checkout@v4.2.2 + if: matrix.name != 'linux-musl' && matrix.arch != 'arm64' - uses: msys2/setup-msys2@v2.27.0 if: matrix.os == 'windows-latest' @@ -79,6 +80,17 @@ jobs: install: >- mingw-w64-x86_64-cc make + + - name: Musl arm64 git clone + if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' + run: | + git clone https://github.com/${{ github.repository }}.git . + git checkout ${{ github.sha }} + + echo "Repository cloned successfully" + echo "Current commit: $(git rev-parse HEAD)" + echo "Files:" + ls -la - name: Install build dependencies if: matrix.name == 'linux-musl' From 7fce8772e83a38c82561bdd6780f725d88fc4e82 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:05:17 +0200 Subject: [PATCH 11/32] feat(workflow): add sqlite to build dependencies for musl --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5982d1f..f8e6e4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,6 +103,7 @@ jobs: make \ cmake \ curl \ + sqlite \ openssl-dev \ musl-dev \ linux-headers \ From 607b57ab763f2bf00cc4b60cf1c192368828182c Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:11:46 +0200 Subject: [PATCH 12/32] fix(workflow): update condition for checkout step and git clone for musl arm64 after git install --- .github/workflows/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8e6e4f..3b911ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,7 +71,7 @@ jobs: steps: - uses: actions/checkout@v4.2.2 - if: matrix.name != 'linux-musl' && matrix.arch != 'arm64' + if: matrix.name != 'linux-musl' || matrix.arch != 'arm64' - uses: msys2/setup-msys2@v2.27.0 if: matrix.os == 'windows-latest' @@ -80,17 +80,6 @@ jobs: install: >- mingw-w64-x86_64-cc make - - - name: Musl arm64 git clone - if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' - run: | - git clone https://github.com/${{ github.repository }}.git . - git checkout ${{ github.sha }} - - echo "Repository cloned successfully" - echo "Current commit: $(git rev-parse HEAD)" - echo "Files:" - ls -la - name: Install build dependencies if: matrix.name == 'linux-musl' @@ -112,6 +101,17 @@ jobs: automake \ libtool + - name: Musl arm64 git clone + if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' + run: | + git clone https://github.com/${{ github.repository }}.git . + git checkout ${{ github.sha }} + + echo "Repository cloned successfully" + echo "Current commit: $(git rev-parse HEAD)" + echo "Files:" + ls -la + - name: windows build curl if: matrix.os == 'windows-latest' run: make curl/windows/libcurl.a From 6e2b564bae5a26f1c6860a0db68f800e507741cf Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:14:32 +0200 Subject: [PATCH 13/32] fix(workflow): add safe.directory configuration for musl arm64 git clone --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b911ea..e8f9a5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,6 +104,7 @@ jobs: - name: Musl arm64 git clone if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | + git config --global --add safe.directory ${{ github.workspace }} git clone https://github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} From 248d938b85a2bac93ecab93b045aa21f9ee91d4b Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:15:50 +0200 Subject: [PATCH 14/32] fix(workflow): add diagnostic commands for gcc and make in musl arm64 build step --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8f9a5f..3efb40e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,6 +101,11 @@ jobs: automake \ libtool + which gcc + gcc --version + which make + make --version + - name: Musl arm64 git clone if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | From d36c577024a293434f84cb4f3a4a497e29de0369 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:19:53 +0200 Subject: [PATCH 15/32] fix(workflow): remove diagnostic commands for gcc and make from musl arm64 build step --- .github/workflows/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3efb40e..e8f9a5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -101,11 +101,6 @@ jobs: automake \ libtool - which gcc - gcc --version - which make - make --version - - name: Musl arm64 git clone if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | From 483c656102551fcc3cdc4ff1a71cab6361a0c473 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:29:23 +0200 Subject: [PATCH 16/32] fix(workflow): update safe.directory configuration for musl arm64 git clone --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8f9a5f..2116829 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,7 +104,7 @@ jobs: - name: Musl arm64 git clone if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | - git config --global --add safe.directory ${{ github.workspace }} + git config --global --add safe.directory '*' git clone https://github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} From f26d950456240874cec7238387f712d521d6b6ae Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:35:31 +0200 Subject: [PATCH 17/32] fix(workflow): rename musl arm64 git clone step and remove unnecessary echo commands --- .github/workflows/main.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2116829..9821064 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,9 +88,7 @@ jobs: apk add --no-cache \ git \ gcc \ - g++ \ make \ - cmake \ curl \ sqlite \ openssl-dev \ @@ -101,17 +99,12 @@ jobs: automake \ libtool - - name: Musl arm64 git clone + - name: linux-musl arm64 checkout if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | git config --global --add safe.directory '*' git clone https://github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} - - echo "Repository cloned successfully" - echo "Current commit: $(git rev-parse HEAD)" - echo "Files:" - ls -la - name: windows build curl if: matrix.os == 'windows-latest' From 129172ef2fbdb9bb021c651d2ee011a7f44b4148 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:42:48 +0200 Subject: [PATCH 18/32] fix(workflow): remove unnecessary build dependencies for linux-musl arm64 --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9821064..3e6cc83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,10 +94,6 @@ jobs: openssl-dev \ musl-dev \ linux-headers \ - pkgconfig \ - autoconf \ - automake \ - libtool - name: linux-musl arm64 checkout if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' From 0abba643a3ace1e273802bc1cffa90ef6f4dec0a Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:55:36 +0200 Subject: [PATCH 19/32] fix(workflow): streamline installation of build dependencies for linux-musl --- .github/workflows/main.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e6cc83..3eb8c6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,23 +77,11 @@ jobs: if: matrix.os == 'windows-latest' with: msystem: mingw64 - install: >- - mingw-w64-x86_64-cc - make + install: mingw-w64-x86_64-cc make - - name: Install build dependencies + - name: linux-musl install dependencies if: matrix.name == 'linux-musl' - run: | - apk update - apk add --no-cache \ - git \ - gcc \ - make \ - curl \ - sqlite \ - openssl-dev \ - musl-dev \ - linux-headers \ + run: apk update && apk add --no-cache git gcc make curl sqlite openssl-dev musl-dev linux-headers - name: linux-musl arm64 checkout if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' From aa54c07cf27ae48a67eff357a5b19ab204f9ce1b Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 11:59:42 +0200 Subject: [PATCH 20/32] fix(workflow): move linux-musl configurations --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3eb8c6d..bf8831c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,14 @@ jobs: - os: LinuxARM64 arch: arm64 name: linux + - os: ubuntu-latest + arch: x86_64 + name: linux-musl + container: alpine:latest + - os: ubuntu-24.04-arm + arch: arm64 + name: linux-musl + container: alpine:latest - os: macos-latest name: macos - os: windows-latest @@ -50,14 +58,6 @@ jobs: - os: macos-latest name: apple-xcframework make: xcframework - - os: ubuntu-latest - arch: x86_64 - name: linux-musl - container: alpine:latest - - os: ubuntu-24.04-arm - arch: arm64 - name: linux-musl - container: alpine:latest defaults: run: From 309f44e113c615f0a04fcc132f54c677ef788558 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:04:16 +0200 Subject: [PATCH 21/32] fix(workflow): update linux-musl job configurations for arm64 and x86_64 --- .github/workflows/main.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf8831c..db66a8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,6 @@ jobs: - os: ubuntu-24.04-arm arch: arm64 name: linux-musl - container: alpine:latest - os: macos-latest name: macos - os: windows-latest @@ -61,7 +60,7 @@ jobs: defaults: run: - shell: ${{ matrix.name == 'linux-musl' && 'sh' || 'bash' }} + shell: ${{ matrix.name == 'linux-musl' && matrix.arch == 'x86_64' && 'sh' || 'bash' }} env: CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }} @@ -71,7 +70,6 @@ jobs: steps: - uses: actions/checkout@v4.2.2 - if: matrix.name != 'linux-musl' || matrix.arch != 'arm64' - uses: msys2/setup-msys2@v2.27.0 if: matrix.os == 'windows-latest' @@ -79,16 +77,13 @@ jobs: msystem: mingw64 install: mingw-w64-x86_64-cc make - - name: linux-musl install dependencies - if: matrix.name == 'linux-musl' - run: apk update && apk add --no-cache git gcc make curl sqlite openssl-dev musl-dev linux-headers - - - name: linux-musl arm64 checkout + - name: linux-musl x86_64 install dependencies + if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64' + run: apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers + + - name: linux-musl arm64 install dependencies if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' - run: | - git config --global --add safe.directory '*' - git clone https://github.com/${{ github.repository }}.git . - git checkout ${{ github.sha }} + run: sudo apt-get update && sudo apt-get install -y gcc make curl sqlite3 libssl-dev musl-dev musl-tools linux-headers-generic - name: windows build curl if: matrix.os == 'windows-latest' From b040a7ba11bfce262b6b8dc06db0520d7ed80f88 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:05:45 +0200 Subject: [PATCH 22/32] fix(workflow): add musl-gcc as compiler for linux-musl arm64 job --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db66a8e..e6722bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,7 @@ jobs: - os: ubuntu-24.04-arm arch: arm64 name: linux-musl + make: CC=musl-gcc - os: macos-latest name: macos - os: windows-latest From c6e11875acecb6e79a611789a4cc73eb94974262 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:06:47 +0200 Subject: [PATCH 23/32] fix(workflow): update shell command for linux-musl job to use alpine condition --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6722bf..5445b42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: defaults: run: - shell: ${{ matrix.name == 'linux-musl' && matrix.arch == 'x86_64' && 'sh' || 'bash' }} + shell: ${{ contains(matrix.container, 'alpine') && 'sh' || 'bash' }} env: CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }} From dfec3305d12e02befcd13f717b0c6250e95d861e Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:14:29 +0200 Subject: [PATCH 24/32] fix(workflow): enhance linux-musl arm64 job to build and install OpenSSL with musl-gcc --- .github/workflows/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5445b42..960c4fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: - os: ubuntu-24.04-arm arch: arm64 name: linux-musl - make: CC=musl-gcc + make: CC=musl-gcc CURL_CONFIG="--with-openssl=/usr/local/musl" - os: macos-latest name: macos - os: windows-latest @@ -84,7 +84,18 @@ jobs: - name: linux-musl arm64 install dependencies if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' - run: sudo apt-get update && sudo apt-get install -y gcc make curl sqlite3 libssl-dev musl-dev musl-tools linux-headers-generic + run: | + sudo apt-get update + sudo apt-get install -y gcc make curl sqlite3 musl-dev musl-tools linux-headers-generic + + # Build OpenSSL for musl + wget https://www.openssl.org/source/openssl-3.0.15.tar.gz + tar -xzf openssl-3.0.15.tar.gz + cd openssl-3.0.15 + CC=musl-gcc ./Configure linux-aarch64 --prefix=/usr/local/musl --openssldir=/usr/local/musl/ssl no-shared + make -j$(nproc) + sudo make install + cd .. - name: windows build curl if: matrix.os == 'windows-latest' From f89111d7327032368306a56f2106dd62e6feeb53 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:18:38 +0200 Subject: [PATCH 25/32] fix(workflow): update arm64 dependencies for linux-musl job to include linux-libc-dev and wget --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 960c4fc..f921304 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | sudo apt-get update - sudo apt-get install -y gcc make curl sqlite3 musl-dev musl-tools linux-headers-generic + sudo apt-get install -y gcc make curl sqlite3 musl-dev musl-tools linux-libc-dev wget # Build OpenSSL for musl wget https://www.openssl.org/source/openssl-3.0.15.tar.gz From 67beb6b4a64be4306ead04664c37afe236707490 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:27:30 +0200 Subject: [PATCH 26/32] fix(workflow): add CPPFLAGS for musl-gcc configuration in OpenSSL build step --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f921304..50d5662 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,7 +92,7 @@ jobs: wget https://www.openssl.org/source/openssl-3.0.15.tar.gz tar -xzf openssl-3.0.15.tar.gz cd openssl-3.0.15 - CC=musl-gcc ./Configure linux-aarch64 --prefix=/usr/local/musl --openssldir=/usr/local/musl/ssl no-shared + CC=musl-gcc CPPFLAGS="-I/usr/include" ./Configure linux-aarch64 --prefix=/usr/local/musl --openssldir=/usr/local/musl/ssl no-shared make -j$(nproc) sudo make install cd .. From 5d38bd4a95be9a8589b6b0935e5d43b4a274ea03 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:31:08 +0200 Subject: [PATCH 27/32] fix(workflow): update linux-musl arm64 job to use Docker for building and testing --- .github/workflows/main.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50d5662..50250bb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,6 @@ jobs: - os: ubuntu-24.04-arm arch: arm64 name: linux-musl - make: CC=musl-gcc CURL_CONFIG="--with-openssl=/usr/local/musl" - os: macos-latest name: macos - os: windows-latest @@ -82,20 +81,23 @@ jobs: if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64' run: apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers - - name: linux-musl arm64 install dependencies + - name: linux-musl arm64 build in docker if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | - sudo apt-get update - sudo apt-get install -y gcc make curl sqlite3 musl-dev musl-tools linux-libc-dev wget - - # Build OpenSSL for musl - wget https://www.openssl.org/source/openssl-3.0.15.tar.gz - tar -xzf openssl-3.0.15.tar.gz - cd openssl-3.0.15 - CC=musl-gcc CPPFLAGS="-I/usr/include" ./Configure linux-aarch64 --prefix=/usr/local/musl --openssldir=/usr/local/musl/ssl no-shared - make -j$(nproc) - sudo make install - cd .. + docker run --rm \ + --platform linux/arm64 \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace \ + -e CONNECTION_STRING="${{ env.CONNECTION_STRING }}" \ + -e APIKEY="${{ env.APIKEY }}" \ + -e WEBLITE="${{ env.WEBLITE }}" \ + alpine:latest \ + sh -c ' + apk update && apk add --no-cache git gcc make curl sqlite openssl-dev musl-dev linux-headers + git config --global --add safe.directory "*" + make extension + make test + ' - name: windows build curl if: matrix.os == 'windows-latest' @@ -107,6 +109,7 @@ jobs: run: sudo apt install wabt - name: build sqlite-sync + if: matrix.name != 'linux-musl' || matrix.arch != 'arm64' run: make extension ${{ matrix.make && matrix.make || ''}} - name: windows install sqlite3 @@ -161,7 +164,7 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: test sqlite-sync - if: contains(matrix.name, 'linux') || matrix.name == 'windows' + if: (contains(matrix.name, 'linux') || matrix.name == 'windows') && !(matrix.name == 'linux-musl' && matrix.arch == 'arm64') run: make test - name: test sqlite-sync + coverage From 9f9fccf5f64e5580fe067b357f17c2fef7cbc265 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:43:32 +0200 Subject: [PATCH 28/32] fix(workflow): update OS version for linux-musl arm64 job to use ubuntu-22.04-arm --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50250bb..74f4aa0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,14 +21,14 @@ jobs: - os: ubuntu-latest arch: x86_64 name: linux - - os: LinuxARM64 + - os: ubuntu-22.04-arm arch: arm64 name: linux - os: ubuntu-latest arch: x86_64 name: linux-musl container: alpine:latest - - os: ubuntu-24.04-arm + - os: ubuntu-22.04-arm arch: arm64 name: linux-musl - os: macos-latest @@ -93,8 +93,7 @@ jobs: -e WEBLITE="${{ env.WEBLITE }}" \ alpine:latest \ sh -c ' - apk update && apk add --no-cache git gcc make curl sqlite openssl-dev musl-dev linux-headers - git config --global --add safe.directory "*" + apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers make extension make test ' From 6d24c5dea4679434629c160cc1ac62c90d11bfed Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 12:49:28 +0200 Subject: [PATCH 29/32] fix(workflow): add error handling in linux-musl arm64 build step --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74f4aa0..7e46b84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,6 +93,7 @@ jobs: -e WEBLITE="${{ env.WEBLITE }}" \ alpine:latest \ sh -c ' + set -e apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers make extension make test From 9b74fc168e1e97ff1f700a61d26fc6e0370d7ea4 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 13:06:21 +0200 Subject: [PATCH 30/32] fix(workflow): refactor linux-musl arm64 build to use Docker for dependency installation and execution --- .github/workflows/main.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e46b84..841e3c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,10 +81,10 @@ jobs: if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64' run: apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers - - name: linux-musl arm64 build in docker + - name: linux-musl arm64 setup container if: matrix.name == 'linux-musl' && matrix.arch == 'arm64' run: | - docker run --rm \ + docker run -d --name alpine \ --platform linux/arm64 \ -v ${{ github.workspace }}:/workspace \ -w /workspace \ @@ -92,12 +92,8 @@ jobs: -e APIKEY="${{ env.APIKEY }}" \ -e WEBLITE="${{ env.WEBLITE }}" \ alpine:latest \ - sh -c ' - set -e - apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers - make extension - make test - ' + tail -f /dev/null + docker exec alpine sh -c "apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers" - name: windows build curl if: matrix.os == 'windows-latest' @@ -109,8 +105,7 @@ jobs: run: sudo apt install wabt - name: build sqlite-sync - if: matrix.name != 'linux-musl' || matrix.arch != 'arm64' - run: make extension ${{ matrix.make && matrix.make || ''}} + run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}} - name: windows install sqlite3 if: matrix.os == 'windows-latest' @@ -164,8 +159,8 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: test sqlite-sync - if: (contains(matrix.name, 'linux') || matrix.name == 'windows') && !(matrix.name == 'linux-musl' && matrix.arch == 'arm64') - run: make test + if: contains(matrix.name, 'linux') || matrix.name == 'windows' + run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test - name: test sqlite-sync + coverage if: matrix.name == 'macos' From 049ce928224676399812f6f441257c9379bc3d17 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 13:15:26 +0200 Subject: [PATCH 31/32] bump version to 0.8.22 --- src/cloudsync.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloudsync.h b/src/cloudsync.h index 4be26c0..23d34d0 100644 --- a/src/cloudsync.h +++ b/src/cloudsync.h @@ -16,7 +16,7 @@ #include "sqlite3.h" #endif -#define CLOUDSYNC_VERSION "0.8.21" +#define CLOUDSYNC_VERSION "0.8.22" int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi); From 305e1b0587f7be6aa921f75840e556d4b4b3fd19 Mon Sep 17 00:00:00 2001 From: Gioele Cantoni Date: Thu, 7 Aug 2025 13:42:17 +0200 Subject: [PATCH 32/32] fix(workflow): update OS versions in CI configuration and improve coverage handling in Makefile --- .github/workflows/main.yml | 51 ++++++++++++++++++-------------------- Makefile | 7 +++--- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 841e3c2..83fabce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,43 +18,44 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest + - os: ubuntu-22.04 arch: x86_64 name: linux - os: ubuntu-22.04-arm arch: arm64 name: linux - - os: ubuntu-latest + - os: ubuntu-22.04 arch: x86_64 name: linux-musl container: alpine:latest - os: ubuntu-22.04-arm arch: arm64 name: linux-musl - - os: macos-latest + - os: macos-15 name: macos - - os: windows-latest + make: COVERAGE=ON + - os: windows-2022 arch: x86_64 name: windows - - os: ubuntu-latest + - os: ubuntu-22.04 arch: arm64-v8a name: android make: PLATFORM=android ARCH=arm64-v8a - - os: ubuntu-latest + - os: ubuntu-22.04 arch: x86_64 name: android make: PLATFORM=android ARCH=x86_64 sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip - - os: macos-latest + - os: macos-15 name: ios make: PLATFORM=ios - - os: macos-latest + - os: macos-15 name: ios-sim make: PLATFORM=ios-sim - - os: ubuntu-latest + - os: ubuntu-22.04 name: wasm make: PLATFORM=wasm - - os: macos-latest + - os: macos-15 name: apple-xcframework make: xcframework @@ -72,10 +73,18 @@ jobs: - uses: actions/checkout@v4.2.2 - uses: msys2/setup-msys2@v2.27.0 - if: matrix.os == 'windows-latest' + if: matrix.name == 'windows' with: msystem: mingw64 install: mingw-w64-x86_64-cc make + + - name: windows install dependencies + if: matrix.name == 'windows' + run: choco install sqlite -y + + - name: macos install dependencies + if: matrix.name == 'macos' + run: brew link sqlite --force && brew install lcov - name: linux-musl x86_64 install dependencies if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64' @@ -96,7 +105,7 @@ jobs: docker exec alpine sh -c "apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers" - name: windows build curl - if: matrix.os == 'windows-latest' + if: matrix.name == 'windows' run: make curl/windows/libcurl.a shell: msys2 {0} @@ -107,14 +116,6 @@ jobs: - name: build sqlite-sync run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}} - - name: windows install sqlite3 - if: matrix.os == 'windows-latest' - run: choco install sqlite -y - - - name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION - if: matrix.name == 'macos' - run: brew link sqlite --force - - name: android setup test environment if: matrix.name == 'android' && matrix.arch != 'arm64-v8a' run: | @@ -159,12 +160,8 @@ jobs: adb shell "sh /data/local/tmp/commands.sh" - name: test sqlite-sync - if: contains(matrix.name, 'linux') || matrix.name == 'windows' - run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test - - - name: test sqlite-sync + coverage - if: matrix.name == 'macos' - run: brew install lcov && make test COVERAGE=true + if: contains(matrix.name, 'linux') || matrix.name == 'windows' || matrix.name == 'macos' + run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}} - uses: actions/upload-pages-artifact@v3.0.1 if: matrix.name == 'macos' @@ -179,7 +176,7 @@ jobs: if-no-files-found: error release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: release needs: build if: github.ref == 'refs/heads/main' diff --git a/Makefile b/Makefile index de71fe1..c3ba6a2 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ CC = gcc CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(SQLITE_DIR) -I$(CURL_DIR)/include T_CFLAGS = $(CFLAGS) -DSQLITE_CORE -DCLOUDSYNC_UNITTEST -DCLOUDSYNC_OMIT_NETWORK -DCLOUDSYNC_OMIT_PRINT_RESULT LDFLAGS = -L./$(CURL_DIR)/$(PLATFORM) -lcurl -COVERAGE = false # Directories SRC_DIR = src @@ -128,7 +127,7 @@ else # linux STRIP = strip --strip-unneeded $@ endif -ifneq ($(COVERAGE),false) +ifdef COVERAGE ifneq (,$(filter $(platform),linux windows)) T_LDFLAGS += -lgcov endif @@ -207,7 +206,7 @@ $(BUILD_TEST)/%.o: %.c test: $(TARGET) $(TEST_TARGET) $(SQLITE3) ":memory:" -cmd ".bail on" ".load ./$<" "SELECT cloudsync_version();" set -e; for t in $(TEST_TARGET); do ./$$t; done -ifneq ($(COVERAGE),false) +ifdef COVERAGE mkdir -p $(COV_DIR) lcov --capture --directory . --output-file $(COV_DIR)/coverage.info $(subst src, --include src,${COV_FILES}) genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR) @@ -386,7 +385,7 @@ help: @echo "Targets:" @echo " all - Build the extension (default)" @echo " clean - Remove built files" - @echo " test [COVERAGE=true] - Test the extension with optional coverage output" + @echo " test [COVERAGE=ON] - Test the extension with optional coverage output" @echo " help - Display this help message" .PHONY: all clean test extension help xcframework