From 252e410f3d8076560787062693c9dbb10cf1d09c Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 10:35:56 +1100 Subject: [PATCH 1/8] fix: Attempt to fix NIF cross-compile workflow --- .github/workflows/release.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01781a0..7922fa9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,8 @@ jobs: matrix: nif: ["2.15"] job: - - { target: aarch64-apple-darwin, os: macos-15 } - - { target: x86_64-apple-darwin, os: macos-15-intel } + - { target: aarch64-apple-darwin, os: macos-14 } + - { target: x86_64-apple-darwin, os: macos-15 } - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04 } @@ -69,15 +69,12 @@ jobs: - name: Build the project id: build-crate uses: philss/rustler-precompiled-action@v1.1.4 - env: - CARGO_BUILD_TARGET: ${{ matrix.job.target }} with: project-name: ecto_libsql project-version: ${{ env.PROJECT_VERSION }} target: ${{ matrix.job.target }} nif-version: ${{ matrix.nif }} use-cross: ${{ matrix.job.use-cross }} - cross-version: "from-source" project-dir: "native/ecto_libsql" - name: Artifact upload From 36695b11a467f91a09b878a2db238a01d785181e Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 10:41:27 +1100 Subject: [PATCH 2/8] ci: Allow test run of NIF build --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7922fa9..0774134 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,15 @@ on: tags: - "v*" workflow_dispatch: + inputs: + test_only: + description: "Test run (skip publishing release)" + required: false + default: "false" + type: choice + options: + - "false" + - "true" permissions: contents: write @@ -88,4 +97,4 @@ jobs: with: files: | ${{ steps.build-crate.outputs.file-path }} - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && inputs.test_only == 'false' From 234f0b2fe14789e9b6604b0e673390e654da8a81 Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 12:53:00 +1100 Subject: [PATCH 3/8] ci: Another attempt to fix NIF cross compile issues --- .github/workflows/release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0774134..5b7aa82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,12 +27,12 @@ jobs: matrix: nif: ["2.15"] job: - - { target: aarch64-apple-darwin, os: macos-14 } - - { target: x86_64-apple-darwin, os: macos-15 } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } - - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } - - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04 } - - { target: x86_64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } + - { target: aarch64-apple-darwin, os: macos-14, use-target: false } + - { target: x86_64-apple-darwin, os: macos-15, use-target: false } + - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true, use-target: true } + - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true, use-target: true } + - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04, use-target: true } + - { target: x86_64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true, use-target: true } steps: - name: Checkout code @@ -81,9 +81,9 @@ jobs: with: project-name: ecto_libsql project-version: ${{ env.PROJECT_VERSION }} - target: ${{ matrix.job.target }} + target: ${{ matrix.job.use-target == true && matrix.job.target || '' }} nif-version: ${{ matrix.nif }} - use-cross: ${{ matrix.job.use-cross }} + use-cross: ${{ matrix.job.use-cross || false }} project-dir: "native/ecto_libsql" - name: Artifact upload From 62184b89cb39f2da608643a6d7bc56fd3f8d9882 Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 13:00:20 +1100 Subject: [PATCH 4/8] ci: Another NIF build fix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b7aa82..0ee2e25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: project-version: ${{ env.PROJECT_VERSION }} target: ${{ matrix.job.use-target == true && matrix.job.target || '' }} nif-version: ${{ matrix.nif }} - use-cross: ${{ matrix.job.use-cross || false }} + use-cross: ${{ matrix.job.use-cross == true }} project-dir: "native/ecto_libsql" - name: Artifact upload From 9b430c6f49a95605c3428c23edec353f905f9d0e Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 14:25:46 +1100 Subject: [PATCH 5/8] ci: Fix NIF cross compilation properly this time I hope? --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ee2e25..0fa930f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,12 +27,12 @@ jobs: matrix: nif: ["2.15"] job: - - { target: aarch64-apple-darwin, os: macos-14, use-target: false } - - { target: x86_64-apple-darwin, os: macos-15, use-target: false } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true, use-target: true } - - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true, use-target: true } - - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04, use-target: true } - - { target: x86_64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true, use-target: true } + - { target: aarch64-apple-darwin, os: macos-14 } + - { target: x86_64-apple-darwin, os: macos-15 } + - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } + - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } + - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04 } + - { target: x86_64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } steps: - name: Checkout code @@ -81,10 +81,10 @@ jobs: with: project-name: ecto_libsql project-version: ${{ env.PROJECT_VERSION }} - target: ${{ matrix.job.use-target == true && matrix.job.target || '' }} + target: ${{ matrix.job.target }} nif-version: ${{ matrix.nif }} - use-cross: ${{ matrix.job.use-cross == true }} - project-dir: "native/ecto_libsql" + use-cross: ${{ matrix.job.use-cross && 'true' || '' }} + project-dir: "." - name: Artifact upload uses: actions/upload-artifact@v6 From a9c3e9fa2e06b77f4b66fed1982b6c6dadf7ff7f Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 15:57:59 +1100 Subject: [PATCH 6/8] ci: Fix cross compilation configuration --- {native/ecto_libsql/.cargo => .cargo}/config.toml | 0 Cross.toml | 7 +++++++ 2 files changed, 7 insertions(+) rename {native/ecto_libsql/.cargo => .cargo}/config.toml (100%) create mode 100644 Cross.toml diff --git a/native/ecto_libsql/.cargo/config.toml b/.cargo/config.toml similarity index 100% rename from native/ecto_libsql/.cargo/config.toml rename to .cargo/config.toml diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..8753ab9 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,7 @@ +# Cross-compilation configuration for the `cross` tool. +# See: https://hexdocs.pm/rustler_precompiled/precompilation_guide.html + +[build.env] +passthrough = [ + "RUSTLER_NIF_VERSION" +] From 7efeb162e3500539317e41037c72ca0b7536371a Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 16:10:27 +1100 Subject: [PATCH 7/8] ci: Fix publishing --- .github/workflows/release.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fa930f..a35d97f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,10 +29,22 @@ jobs: job: - { target: aarch64-apple-darwin, os: macos-14 } - { target: x86_64-apple-darwin, os: macos-15 } - - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } - - { target: aarch64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } + - { + target: aarch64-unknown-linux-gnu, + os: ubuntu-24.04, + use-cross: true, + } + - { + target: aarch64-unknown-linux-musl, + os: ubuntu-24.04, + use-cross: true, + } - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04 } - - { target: x86_64-unknown-linux-musl, os: ubuntu-24.04, use-cross: true } + - { + target: x86_64-unknown-linux-musl, + os: ubuntu-24.04, + use-cross: true, + } steps: - name: Checkout code @@ -47,27 +59,27 @@ jobs: echo "::error::Failed to extract version from mix.exs" exit 1 fi - + # Check if this is a tag push or workflow_dispatch if [[ "$GITHUB_REF" == refs/tags/* ]]; then # Extract git tag from GITHUB_REF_NAME (e.g., "v0.8.10") GIT_TAG="${GITHUB_REF_NAME}" - + # Validate that git tag matches mix.exs version # Git tag should be v, so strip the 'v' prefix for comparison TAG_VERSION="${GIT_TAG#v}" - + if [ "$VERSION" != "$TAG_VERSION" ]; then echo "::error::Version mismatch: mix.exs version is '$VERSION' but git tag is '$GIT_TAG' (without 'v': '$TAG_VERSION')" exit 1 fi - + echo "✓ Version validation passed: mix.exs version '$VERSION' matches git tag '$GIT_TAG'" else # workflow_dispatch or other non-tag trigger echo "ℹ Using version from mix.exs: '$VERSION' (not a tag push)" fi - + echo "PROJECT_VERSION=$VERSION" >> $GITHUB_ENV - name: Install Rust toolchain @@ -97,4 +109,4 @@ jobs: with: files: | ${{ steps.build-crate.outputs.file-path }} - if: startsWith(github.ref, 'refs/tags/') && inputs.test_only == 'false' + if: startsWith(github.ref, 'refs/tags/') && inputs.test_only != 'true' From 804d2304215feffb7e07d663b8e16efc9812537d Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Mon, 2 Feb 2026 16:15:09 +1100 Subject: [PATCH 8/8] ci: Use latest macOS GH Actions runner for all compiling --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a35d97f..a300507 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: matrix: nif: ["2.15"] job: - - { target: aarch64-apple-darwin, os: macos-14 } + - { target: aarch64-apple-darwin, os: macos-15 } - { target: x86_64-apple-darwin, os: macos-15 } - { target: aarch64-unknown-linux-gnu,