From d9c671793b799498afb410ccb4a3884e590ab8fb Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Wed, 12 Aug 2026 22:44:31 +0530 Subject: [PATCH 1/4] ci: build per-platform C-ABI static libraries and push to Go driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add build-c-abi-libs.yml with two jobs: 1. build: a native-runner matrix (darwin arm64/amd64, linux amd64/arm64, windows amd64) that builds libdatabricks_sql_kernel.a with the same flags as the Go driver's kernel-lib.sh (--release --locked --no-default-features --features tls-rustls), checksums each archive, and uploads them as workflow artifacts plus release assets on a v* tag. 2. publish-to-driver: gathers all platform archives and PUSHES them into the public databricks-sql-go repo — placing each into its nested internal/backend/kernel/kernellib/ module, refreshing the committed header, moving KERNEL_REV to the tag commit, and opening a sync PR. Push (not pull) keeps the only cross-repo credential — a token with PR-write on the PUBLIC driver (DRIVER_PR_TOKEN, stored in this private repo) — out of the public repo, so no credential that could read this repo's SOURCE ever lives in the public driver. Only the compiled archive crosses the boundary. A kernel opt-in 'go get' build then links a committed archive with no Rust toolchain and no make kernel-lib step. Native runners avoid error-prone cross-compilation of a Rust staticlib with C++ transitive deps. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore --- .github/workflows/build-c-abi-libs.yml | 318 +++++++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 .github/workflows/build-c-abi-libs.yml diff --git a/.github/workflows/build-c-abi-libs.yml b/.github/workflows/build-c-abi-libs.yml new file mode 100644 index 00000000..fc98b37a --- /dev/null +++ b/.github/workflows/build-c-abi-libs.yml @@ -0,0 +1,318 @@ +# Copyright (c) 2026 Databricks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Builds the C-ABI static library (libdatabricks_sql_kernel.a) for every +# supported OS/arch on a NATIVE runner, checksums each one, and uploads them as +# workflow artifacts + release assets. This is the producer half of the Go +# driver's committed-per-platform distribution (see databricks-sql-go PR: the +# nested `internal/backend/kernel/kernellib/` modules). +# +# After building, a `publish-to-driver` job PUSHES the compiled archives into the +# public Go driver repo and opens a sync PR there (PUSH model). This keeps the +# only cross-repo credential — a token with PR-write on the PUBLIC driver — inside +# this PRIVATE kernel repo, so no credential that could read this repo's SOURCE +# ever lives in the public driver. Only the compiled .a crosses the boundary +# (public-safe by design), never the source. A kernel opt-in `go get` build then +# links a committed archive with no Rust toolchain and no `make kernel-lib` step. +# +# Why native runners (not cross-compilation): `cargo build` here uses the host +# target (no `--target`), matching how the kernel is built and tested elsewhere. +# Each archive is produced on its real OS/arch so the emitted machine code, the +# system C++ runtime it expects, and the object-file format are all correct — +# cross-toolchains are error-prone for a Rust staticlib with C++ transitive deps +# (BoringSSL etc.). One job per platform, one archive out. +# +# Triggered by: +# 1. Pushing a `v*` git tag — the canonical release path (same trigger as +# cargo-publish.yml, so a kernel release produces both the crate and the +# C-ABI archives in lockstep). +# 2. Manual `workflow_dispatch` — for ad-hoc archive builds / re-runs. +# +# Build flags mirror the Go driver's build/kernel-lib.sh source build exactly: +# cargo build --release --locked --no-default-features --features tls-rustls +# so the CI-produced archive is byte-for-byte the same shape the driver expects +# (pure-Rust TLS, no default features). + +name: Build C-ABI Libraries + +on: + push: + tags: + - "v*" + workflow_dispatch: + inputs: + upload_release: + description: "Attach archives to the GitHub release for the triggering tag" + required: false + default: "false" + +concurrency: + # One archive-build run per ref; a newer push supersedes an in-flight build. + group: ${{ github.repository }}-build-c-abi-libs-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + # OIDC token exchange for the .github/actions/setup-jfrog composite (cargo + # dependency proxy). See go/hardened-gha. + id-token: write + +defaults: + run: + shell: bash + +jobs: + build: + name: "C-ABI ${{ matrix.platform }}" + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + include: + # `platform` is the Go GOOS_GOARCH tag the driver's nested modules key + # off (internal/backend/kernel/kernellib/). `runs-on` picks a + # NATIVE runner for that OS/arch so no cross-toolchain is involved. + - platform: darwin_arm64 + runs-on: macos-14 # Apple Silicon + archive: libdatabricks_sql_kernel.a + - platform: darwin_amd64 + runs-on: macos-13 # Intel + archive: libdatabricks_sql_kernel.a + - platform: linux_amd64 + runs-on: ubuntu-latest + archive: libdatabricks_sql_kernel.a + - platform: linux_arm64 + runs-on: ubuntu-24.04-arm # native ARM runner (no cross) + archive: libdatabricks_sql_kernel.a + - platform: windows_amd64 + runs-on: windows-latest + archive: databricks_sql_kernel.lib # MSVC toolchain names it .lib + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 1 + + - name: Configure JFrog Artifactory access (cargo proxy) + uses: ./.github/actions/setup-jfrog + with: + cargo: "true" + + - name: Set up Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + + # Build the staticlib with the SAME flags as the Go driver's + # build/kernel-lib.sh source build. No `--target`: host-native build on a + # matching native runner. The root Cargo.toml already declares + # crate-type = ["lib", "cdylib", "staticlib"], so `staticlib` emits the .a + # (or .lib on MSVC) under target/release/. + - name: Build C-ABI static library + run: | + cargo build --release --locked --no-default-features --features tls-rustls + + # macOS only: the archive itself has no install_name (that is a dylib + # concept), so nothing to rewrite for the STATIC lib. This step is a + # placeholder marker documenting that the static path needs no + # relocatability fix-up — unlike the dynamic .dylib path, which would need + # `install_name_tool -id @rpath/...`. Kept as an explicit no-op so a future + # dynamic variant has an obvious home. + - name: (static) no install_name fix-up needed + if: startsWith(matrix.platform, 'darwin') + run: echo "static .a carries no install_name; nothing to relocate" + + # Stage the produced archive under a per-platform directory that mirrors + # the driver's nested-module layout, plus a SHA-256 the driver verifies + # before committing/using it. + - name: Stage archive + checksum + run: | + set -euo pipefail + OUT="dist/${{ matrix.platform }}" + mkdir -p "$OUT" + SRC="target/release/${{ matrix.archive }}" + if [ ! -f "$SRC" ]; then + echo "::error::expected archive not found at $SRC" + ls -la target/release/ || true + exit 1 + fi + cp "$SRC" "$OUT/${{ matrix.archive }}" + # Also emit the C header alongside so the driver can commit a matching + # header at the same revision. The header is generated into include/. + if [ -f include/databricks_kernel.h ]; then + cp include/databricks_kernel.h "$OUT/databricks_kernel.h" + fi + # Portable SHA-256 (shasum on macOS, sha256sum on Linux; certutil Win). + cd "$OUT" + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "${{ matrix.archive }}" > "${{ matrix.archive }}.sha256" + elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 "${{ matrix.archive }}" > "${{ matrix.archive }}.sha256" + else + certutil -hashfile "${{ matrix.archive }}" SHA256 | sed -n 2p > "${{ matrix.archive }}.sha256" + fi + echo "staged:"; ls -la + echo "size: $(wc -c < "${{ matrix.archive }}") bytes" + + - name: Upload archive artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: kernel-c-abi-${{ matrix.platform }} + path: dist/${{ matrix.platform }}/ + if-no-files-found: error + retention-days: 14 + + # On a tag build (or when explicitly requested), attach the archive to the + # GitHub release for that tag, so the Go driver's sync workflow can pull a + # signed, immutable asset by tag rather than a transient CI artifact. + - name: Attach to GitHub release + if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.upload_release == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + TAG="${GITHUB_REF_NAME}" + cd "dist/${{ matrix.platform }}" + # Namespace the asset by platform so all five archives coexist on one + # release without name clashes. + ASSET="libdatabricks_sql_kernel-${{ matrix.platform }}.a" + cp "${{ matrix.archive }}" "$ASSET" + gh release upload "$TAG" \ + "$ASSET" "${{ matrix.archive }}.sha256" \ + --repo "$GITHUB_REPOSITORY" --clobber + + # ── Push the freshly-built archives into the PUBLIC Go driver repo ────────── + # + # PUSH model (not pull): this PRIVATE kernel repo pushes the compiled archives + # to the public databricks-sql-go repo and opens a PR there. The only + # credential involved is DRIVER_PR_TOKEN, which needs write/PR scope on the + # PUBLIC driver repo ONLY — no credential that can read this private kernel's + # SOURCE ever leaves this repo. (The alternative, having the public driver pull + # from here, would require giving the public repo a token with Contents:read on + # this private repo — i.e. source-read access sitting in a public repo. The + # push direction avoids that entirely.) + # + # What crosses the boundary is only the compiled .a (public-safe by design), + # never the source. + publish-to-driver: + name: Publish archives to Go driver + needs: build + # Only on a real release tag (skip ad-hoc dispatch runs unless explicitly + # asked to attach a release, which implies a deliberate publish). + if: startsWith(github.ref, 'refs/tags/v') + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + env: + DRIVER_REPO: databricks/databricks-sql-go + KERNEL_TAG: ${{ github.ref_name }} + steps: + - name: Download all platform archives + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + pattern: kernel-c-abi-* + path: archives + # Each artifact keeps its own subdir (archives/kernel-c-abi-/). + merge-multiple: false + + # Check out the PUBLIC driver repo using a token scoped to that repo only. + # DRIVER_PR_TOKEN is a fine-grained PAT / GitHub App token with + # Contents:write + Pull requests:write on databricks-sql-go, stored as a + # secret in THIS kernel repo. It has NO access to this kernel repo's source. + - name: Check out Go driver + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: ${{ env.DRIVER_REPO }} + token: ${{ secrets.DRIVER_PR_TOKEN }} + path: driver + fetch-depth: 1 + + - name: Place archives into nested modules + verify checksums + run: | + set -euo pipefail + cd driver + shopt -s nullglob + placed=0 + for dir in ../archives/kernel-c-abi-*; do + plat="$(basename "$dir" | sed 's/^kernel-c-abi-//')" + dest="internal/backend/kernel/kernellib/$plat" + if [ ! -d "$dest" ]; then + echo "::warning::driver has no nested module for $plat ($dest); skipping" + continue + fi + # The build job may name the archive .a (unix) or .lib (windows); + # normalize to the module's build-time name libdatabricks_sql_kernel.a. + src="$(ls "$dir"/libdatabricks_sql_kernel.a "$dir"/databricks_sql_kernel.lib 2>/dev/null | head -1 || true)" + sha="$(ls "$dir"/*.sha256 2>/dev/null | head -1 || true)" + if [ -z "$src" ]; then + echo "::error::no archive found in $dir"; exit 1 + fi + if [ -n "$sha" ]; then + want="$(awk '{print $1}' "$sha")" + got="$(sha256sum "$src" | awk '{print $1}')" + [ "$want" = "$got" ] || { echo "::error::checksum mismatch for $plat"; exit 1; } + echo "$plat checksum OK ($got)" + fi + cp "$src" "$dest/libdatabricks_sql_kernel.a" + placed=$((placed+1)) + done + echo "placed $placed platform archive(s)" + # Refresh the committed C header (platform-independent) from any artifact. + hdr="$(ls ../archives/kernel-c-abi-*/databricks_kernel.h 2>/dev/null | head -1 || true)" + if [ -n "$hdr" ]; then + cp "$hdr" internal/backend/kernel/include/databricks_kernel.h + echo "header refreshed" + fi + + - name: Update KERNEL_REV pin + run: | + set -euo pipefail + cd driver + # ${{ github.sha }} is this kernel repo's commit for the release tag. + echo "${{ github.sha }}" > KERNEL_REV + echo "KERNEL_REV -> ${{ github.sha }}" + + - name: Open sync PR on the driver + env: + GH_TOKEN: ${{ secrets.DRIVER_PR_TOKEN }} + run: | + set -euo pipefail + cd driver + branch="sync/kernel-${KERNEL_TAG}" + git config user.name "databricks-ci" + git config user.email "ci@databricks.com" + git checkout -b "$branch" + git add -A + if git diff --cached --quiet; then + echo "no changes — driver already at ${KERNEL_TAG}"; exit 0 + fi + { + printf 'kernel: sync committed C-ABI libs to %s\n\n' "$KERNEL_TAG" + printf 'Pushed by the kernel repo build-c-abi-libs workflow: rebuilt the\n' + printf 'per-platform libdatabricks_sql_kernel.a archives on native runners,\n' + printf 'verified checksums, and updated the committed nested-module binaries\n' + printf '+ KERNEL_REV.\n\n' + printf 'Co-authored-by: Isaac\n' + } > /tmp/commit_msg.txt + { + printf 'Automated push of committed per-platform kernel archives to `%s`.\n\n' "$KERNEL_TAG" + printf 'Built on native runners in the kernel repo, checksum-verified, and\n' + printf 'placed into the nested modules. `KERNEL_REV` moved to the tag commit.\n\n' + printf 'Per-platform link + E2E verification runs in each platform CI on this PR.\n\n' + printf 'This pull request and its description were written by Isaac.\n' + } > /tmp/pr_body.txt + git commit -F /tmp/commit_msg.txt + git push -u origin "$branch" --force + gh pr create --repo "$DRIVER_REPO" \ + --title "kernel: sync committed C-ABI libs to ${KERNEL_TAG}" \ + --body-file /tmp/pr_body.txt \ + --base main --head "$branch" || echo "PR may already exist" From 370ff9c67cc80297526ce12580873478abcaa340 Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Fri, 21 Aug 2026 18:46:53 +0530 Subject: [PATCH 2/4] ci: make C-ABI build artifact-only (drop push-to-driver) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the all-platform native-runner matrix that builds libdatabricks_sql_kernel.a for darwin arm64/amd64, linux amd64/arm64, and windows amd64, checksums each, and uploads them as workflow artifacts + release assets on a v* tag. Remove the publish-to-driver job: this workflow no longer pushes into any other repo. Getting the archives into databricks-sql-kernel-bindings (one nested Go module per platform, lib//) is a deliberate maintainer step — download the kernel-c-abi- artifact/asset and commit it — not automated cross-repo pushing. This removes the need for a cross-repo token. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore --- .github/workflows/build-c-abi-libs.yml | 154 +++---------------------- 1 file changed, 16 insertions(+), 138 deletions(-) diff --git a/.github/workflows/build-c-abi-libs.yml b/.github/workflows/build-c-abi-libs.yml index fc98b37a..1fa80aef 100644 --- a/.github/workflows/build-c-abi-libs.yml +++ b/.github/workflows/build-c-abi-libs.yml @@ -13,18 +13,23 @@ # limitations under the License. # Builds the C-ABI static library (libdatabricks_sql_kernel.a) for every -# supported OS/arch on a NATIVE runner, checksums each one, and uploads them as -# workflow artifacts + release assets. This is the producer half of the Go -# driver's committed-per-platform distribution (see databricks-sql-go PR: the -# nested `internal/backend/kernel/kernellib/` modules). +# supported OS/arch on a NATIVE runner, checksums each one, and publishes them as +# workflow artifacts + release assets. # -# After building, a `publish-to-driver` job PUSHES the compiled archives into the -# public Go driver repo and opens a sync PR there (PUSH model). This keeps the -# only cross-repo credential — a token with PR-write on the PUBLIC driver — inside -# this PRIVATE kernel repo, so no credential that could read this repo's SOURCE -# ever lives in the public driver. Only the compiled .a crosses the boundary -# (public-safe by design), never the source. A kernel opt-in `go get` build then -# links a committed archive with no Rust toolchain and no `make kernel-lib` step. +# This is the producer for the per-platform Go bindings distributed by +# github.com/databricks/databricks-sql-kernel-bindings — that repo holds one +# nested Go module per platform (lib/_/libdatabricks_sql_kernel.a), and +# the Go driver (databricks-sql-go) requires the matching module so a kernel +# opt-in `go get` build links a prebuilt archive with no Rust toolchain and no +# `make kernel-lib` step. +# +# ARTIFACT-ONLY (no automated push): this workflow only BUILDS + uploads the +# archives (as CI artifacts and, on a tag, GitHub release assets). It does NOT +# push into any other repo. Getting the archives into the bindings repo is a +# separate, deliberate step (download the artifacts/assets and commit them into +# lib//), done by a maintainer — not automated here. Each artifact is +# named `kernel-c-abi-` and contains `libdatabricks_sql_kernel.a` (or +# `databricks_sql_kernel.lib` on Windows), its `.sha256`, and the C header. # # Why native runners (not cross-compilation): `cargo build` here uses the host # target (no `--target`), matching how the kernel is built and tested elsewhere. @@ -189,130 +194,3 @@ jobs: gh release upload "$TAG" \ "$ASSET" "${{ matrix.archive }}.sha256" \ --repo "$GITHUB_REPOSITORY" --clobber - - # ── Push the freshly-built archives into the PUBLIC Go driver repo ────────── - # - # PUSH model (not pull): this PRIVATE kernel repo pushes the compiled archives - # to the public databricks-sql-go repo and opens a PR there. The only - # credential involved is DRIVER_PR_TOKEN, which needs write/PR scope on the - # PUBLIC driver repo ONLY — no credential that can read this private kernel's - # SOURCE ever leaves this repo. (The alternative, having the public driver pull - # from here, would require giving the public repo a token with Contents:read on - # this private repo — i.e. source-read access sitting in a public repo. The - # push direction avoids that entirely.) - # - # What crosses the boundary is only the compiled .a (public-safe by design), - # never the source. - publish-to-driver: - name: Publish archives to Go driver - needs: build - # Only on a real release tag (skip ad-hoc dispatch runs unless explicitly - # asked to attach a release, which implies a deliberate publish). - if: startsWith(github.ref, 'refs/tags/v') - runs-on: - group: databricks-protected-runner-group - labels: linux-ubuntu-latest - env: - DRIVER_REPO: databricks/databricks-sql-go - KERNEL_TAG: ${{ github.ref_name }} - steps: - - name: Download all platform archives - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - pattern: kernel-c-abi-* - path: archives - # Each artifact keeps its own subdir (archives/kernel-c-abi-/). - merge-multiple: false - - # Check out the PUBLIC driver repo using a token scoped to that repo only. - # DRIVER_PR_TOKEN is a fine-grained PAT / GitHub App token with - # Contents:write + Pull requests:write on databricks-sql-go, stored as a - # secret in THIS kernel repo. It has NO access to this kernel repo's source. - - name: Check out Go driver - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: ${{ env.DRIVER_REPO }} - token: ${{ secrets.DRIVER_PR_TOKEN }} - path: driver - fetch-depth: 1 - - - name: Place archives into nested modules + verify checksums - run: | - set -euo pipefail - cd driver - shopt -s nullglob - placed=0 - for dir in ../archives/kernel-c-abi-*; do - plat="$(basename "$dir" | sed 's/^kernel-c-abi-//')" - dest="internal/backend/kernel/kernellib/$plat" - if [ ! -d "$dest" ]; then - echo "::warning::driver has no nested module for $plat ($dest); skipping" - continue - fi - # The build job may name the archive .a (unix) or .lib (windows); - # normalize to the module's build-time name libdatabricks_sql_kernel.a. - src="$(ls "$dir"/libdatabricks_sql_kernel.a "$dir"/databricks_sql_kernel.lib 2>/dev/null | head -1 || true)" - sha="$(ls "$dir"/*.sha256 2>/dev/null | head -1 || true)" - if [ -z "$src" ]; then - echo "::error::no archive found in $dir"; exit 1 - fi - if [ -n "$sha" ]; then - want="$(awk '{print $1}' "$sha")" - got="$(sha256sum "$src" | awk '{print $1}')" - [ "$want" = "$got" ] || { echo "::error::checksum mismatch for $plat"; exit 1; } - echo "$plat checksum OK ($got)" - fi - cp "$src" "$dest/libdatabricks_sql_kernel.a" - placed=$((placed+1)) - done - echo "placed $placed platform archive(s)" - # Refresh the committed C header (platform-independent) from any artifact. - hdr="$(ls ../archives/kernel-c-abi-*/databricks_kernel.h 2>/dev/null | head -1 || true)" - if [ -n "$hdr" ]; then - cp "$hdr" internal/backend/kernel/include/databricks_kernel.h - echo "header refreshed" - fi - - - name: Update KERNEL_REV pin - run: | - set -euo pipefail - cd driver - # ${{ github.sha }} is this kernel repo's commit for the release tag. - echo "${{ github.sha }}" > KERNEL_REV - echo "KERNEL_REV -> ${{ github.sha }}" - - - name: Open sync PR on the driver - env: - GH_TOKEN: ${{ secrets.DRIVER_PR_TOKEN }} - run: | - set -euo pipefail - cd driver - branch="sync/kernel-${KERNEL_TAG}" - git config user.name "databricks-ci" - git config user.email "ci@databricks.com" - git checkout -b "$branch" - git add -A - if git diff --cached --quiet; then - echo "no changes — driver already at ${KERNEL_TAG}"; exit 0 - fi - { - printf 'kernel: sync committed C-ABI libs to %s\n\n' "$KERNEL_TAG" - printf 'Pushed by the kernel repo build-c-abi-libs workflow: rebuilt the\n' - printf 'per-platform libdatabricks_sql_kernel.a archives on native runners,\n' - printf 'verified checksums, and updated the committed nested-module binaries\n' - printf '+ KERNEL_REV.\n\n' - printf 'Co-authored-by: Isaac\n' - } > /tmp/commit_msg.txt - { - printf 'Automated push of committed per-platform kernel archives to `%s`.\n\n' "$KERNEL_TAG" - printf 'Built on native runners in the kernel repo, checksum-verified, and\n' - printf 'placed into the nested modules. `KERNEL_REV` moved to the tag commit.\n\n' - printf 'Per-platform link + E2E verification runs in each platform CI on this PR.\n\n' - printf 'This pull request and its description were written by Isaac.\n' - } > /tmp/pr_body.txt - git commit -F /tmp/commit_msg.txt - git push -u origin "$branch" --force - gh pr create --repo "$DRIVER_REPO" \ - --title "kernel: sync committed C-ABI libs to ${KERNEL_TAG}" \ - --body-file /tmp/pr_body.txt \ - --base main --head "$branch" || echo "PR may already exist" From de8c2c98b66fccd8706f0880679f39b8025e501f Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Fri, 21 Aug 2026 19:15:01 +0530 Subject: [PATCH 3/4] ci: correct C-ABI build workflow (explicit targets, windows-gnu, split release job) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix six correctness issues found on review: 1. Explicit --target per matrix entry (never host-inferred); staging reads the archive from target//release/ accordingly. 2. Windows builds x86_64-pc-windows-GNU (MinGW), not the msvc default. cgo links a GNU .a, never an MSVC .lib (see the driver's cgo_windows.go). All five targets now emit a uniformly named libdatabricks_sql_kernel.a. 3. Release upload uses that uniform .a name (no more mislabeling a .lib as .a). 4. Release upload moved to a separate release-assets job that holds contents:write and runs once; the build job stays contents:read + id-token (top-level default is contents:read — least privilege). 5. Header copy hard-fails if include/databricks_kernel.h is missing (was a silent skip); confirmed the header is committed, not generated. 6. Dropped the fragile certutil SHA path for an openssl fallback. workflow_dispatch input is now a real boolean (type: boolean + inputs.*). Header documents the one unverifiable pre-merge assumption: this is the first workflow here to request GitHub-hosted macos/windows/arm runners — confirm the org allows those labels (fail-fast:false isolates any disallowed leg). Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore --- .github/workflows/build-c-abi-libs.yml | 242 +++++++++++++++---------- 1 file changed, 145 insertions(+), 97 deletions(-) diff --git a/.github/workflows/build-c-abi-libs.yml b/.github/workflows/build-c-abi-libs.yml index 1fa80aef..9bf2efc4 100644 --- a/.github/workflows/build-c-abi-libs.yml +++ b/.github/workflows/build-c-abi-libs.yml @@ -12,42 +12,51 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Builds the C-ABI static library (libdatabricks_sql_kernel.a) for every -# supported OS/arch on a NATIVE runner, checksums each one, and publishes them as -# workflow artifacts + release assets. +# Builds the kernel C-ABI static library for every supported OS/arch on a NATIVE +# runner, checksums each one, and publishes them as workflow artifacts (and, on a +# tag, GitHub release assets). # -# This is the producer for the per-platform Go bindings distributed by +# These archives are the per-platform Go bindings distributed by # github.com/databricks/databricks-sql-kernel-bindings — that repo holds one # nested Go module per platform (lib/_/libdatabricks_sql_kernel.a), and # the Go driver (databricks-sql-go) requires the matching module so a kernel # opt-in `go get` build links a prebuilt archive with no Rust toolchain and no # `make kernel-lib` step. # -# ARTIFACT-ONLY (no automated push): this workflow only BUILDS + uploads the -# archives (as CI artifacts and, on a tag, GitHub release assets). It does NOT -# push into any other repo. Getting the archives into the bindings repo is a -# separate, deliberate step (download the artifacts/assets and commit them into -# lib//), done by a maintainer — not automated here. Each artifact is -# named `kernel-c-abi-` and contains `libdatabricks_sql_kernel.a` (or -# `databricks_sql_kernel.lib` on Windows), its `.sha256`, and the C header. +# ARTIFACT-ONLY (no automated push): this workflow only BUILDS + uploads. Getting +# the archives into the bindings repo is a deliberate maintainer step (download +# the kernel-c-abi- artifact and commit it into lib//). No +# cross-repo token is used here. # -# Why native runners (not cross-compilation): `cargo build` here uses the host -# target (no `--target`), matching how the kernel is built and tested elsewhere. -# Each archive is produced on its real OS/arch so the emitted machine code, the -# system C++ runtime it expects, and the object-file format are all correct — -# cross-toolchains are error-prone for a Rust staticlib with C++ transitive deps -# (BoringSSL etc.). One job per platform, one archive out. +# ── Toolchain correctness (why each target is what it is) ────────────────────── +# The Go driver links the kernel through cgo. On every platform cgo uses a +# GNU-family C toolchain (gcc/clang), which links a GNU-style static archive +# (libNAME.a) — NEVER an MSVC import library (.lib). Therefore: +# * We always build with an EXPLICIT `--target` (never host-inferred), so the +# output triple is unambiguous and the emitted archive matches what the +# driver's cgo LDFLAGS expect. +# * Windows is built for the **x86_64-pc-windows-GNU** target (MinGW), NOT the +# msvc default of a windows-latest runner. msvc emits `databricks_sql_kernel.lib`, +# which cgo/MinGW on Windows cannot consume; the gnu target emits +# `libdatabricks_sql_kernel.a`, which it can. See the driver's cgo_windows.go. +# Net: ALL platforms produce a uniformly named `libdatabricks_sql_kernel.a`. # -# Triggered by: -# 1. Pushing a `v*` git tag — the canonical release path (same trigger as -# cargo-publish.yml, so a kernel release produces both the crate and the -# C-ABI archives in lockstep). -# 2. Manual `workflow_dispatch` — for ad-hoc archive builds / re-runs. +# Build flags mirror the driver's build/kernel-lib.sh exactly +# (`--release --locked --no-default-features --features tls-rustls`) so the +# CI-produced archive is the same shape the driver expects (pure-Rust TLS). # -# Build flags mirror the Go driver's build/kernel-lib.sh source build exactly: -# cargo build --release --locked --no-default-features --features tls-rustls -# so the CI-produced archive is byte-for-byte the same shape the driver expects -# (pure-Rust TLS, no default features). +# Triggered by a `v*` tag (release path) or manual workflow_dispatch. +# +# ── PRE-MERGE NOTE: runner availability (the one thing to confirm on first run) ─ +# Every OTHER workflow in this repo runs on `databricks-protected-runner-group` +# / `linux-ubuntu-latest`. This workflow is the first to request GitHub-hosted +# `macos-14`, `macos-13`, `ubuntu-latest`, `ubuntu-24.04-arm`, and +# `windows-latest` runners (per-platform native builds need them). Before relying +# on this in a release, confirm the org permits these GitHub-hosted runner +# labels (some orgs restrict runners to the protected group). If a label is not +# permitted, that matrix leg will fail to schedule — swap it for the org's +# equivalent macOS/Windows/ARM label in the matrix `runs-on` below; nothing else +# changes. `fail-fast: false` keeps a disallowed leg from taking down the others. name: Build C-ABI Libraries @@ -58,20 +67,20 @@ on: workflow_dispatch: inputs: upload_release: - description: "Attach archives to the GitHub release for the triggering tag" + description: "Attach archives to the GitHub release for the triggering tag (tag runs do this automatically)" required: false - default: "false" + type: boolean + default: false concurrency: # One archive-build run per ref; a newer push supersedes an in-flight build. - group: ${{ github.repository }}-build-c-abi-libs-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# Least privilege at the top level; the release job elevates contents:write for +# itself only. permissions: contents: read - # OIDC token exchange for the .github/actions/setup-jfrog composite (cargo - # dependency proxy). See go/hardened-gha. - id-token: write defaults: run: @@ -81,28 +90,35 @@ jobs: build: name: "C-ABI ${{ matrix.platform }}" runs-on: ${{ matrix.runs-on }} + permissions: + contents: read + # OIDC token exchange for the .github/actions/setup-jfrog composite (cargo + # dependency proxy). See go/hardened-gha. + id-token: write strategy: fail-fast: false matrix: include: - # `platform` is the Go GOOS_GOARCH tag the driver's nested modules key - # off (internal/backend/kernel/kernellib/). `runs-on` picks a - # NATIVE runner for that OS/arch so no cross-toolchain is involved. + # platform : the GOOS_GOARCH tag the bindings repo keys off + # (lib//); target : the explicit Rust triple we + # build (never host-inferred); runs-on : a native runner for + # that OS/arch (no cross-compilation). - platform: darwin_arm64 - runs-on: macos-14 # Apple Silicon - archive: libdatabricks_sql_kernel.a + runs-on: macos-14 # Apple Silicon + target: aarch64-apple-darwin - platform: darwin_amd64 - runs-on: macos-13 # Intel - archive: libdatabricks_sql_kernel.a + runs-on: macos-13 # Intel + target: x86_64-apple-darwin - platform: linux_amd64 runs-on: ubuntu-latest - archive: libdatabricks_sql_kernel.a + target: x86_64-unknown-linux-gnu - platform: linux_arm64 - runs-on: ubuntu-24.04-arm # native ARM runner (no cross) - archive: libdatabricks_sql_kernel.a + runs-on: ubuntu-24.04-arm # native ARM runner + target: aarch64-unknown-linux-gnu - platform: windows_amd64 runs-on: windows-latest - archive: databricks_sql_kernel.lib # MSVC toolchain names it .lib + # GNU (MinGW), NOT msvc — cgo links .a, not .lib. See header. + target: x86_64-pc-windows-gnu steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -114,59 +130,62 @@ jobs: with: cargo: "true" + # Install the toolchain WITH the explicit target for this matrix entry. - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + target: ${{ matrix.target }} - # Build the staticlib with the SAME flags as the Go driver's - # build/kernel-lib.sh source build. No `--target`: host-native build on a - # matching native runner. The root Cargo.toml already declares - # crate-type = ["lib", "cdylib", "staticlib"], so `staticlib` emits the .a - # (or .lib on MSVC) under target/release/. + # Build the staticlib for the EXPLICIT target. The root Cargo.toml declares + # crate-type = [..., "staticlib"], and the lib name is databricks_sql_kernel, + # so every gnu/unix target emits `libdatabricks_sql_kernel.a`. With an + # explicit --target the output lands under target//release/, so the + # staging step reads from there (NOT target/release/). - name: Build C-ABI static library run: | - cargo build --release --locked --no-default-features --features tls-rustls + cargo build --release --locked --no-default-features --features tls-rustls --target ${{ matrix.target }} - # macOS only: the archive itself has no install_name (that is a dylib - # concept), so nothing to rewrite for the STATIC lib. This step is a - # placeholder marker documenting that the static path needs no - # relocatability fix-up — unlike the dynamic .dylib path, which would need - # `install_name_tool -id @rpath/...`. Kept as an explicit no-op so a future - # dynamic variant has an obvious home. - - name: (static) no install_name fix-up needed - if: startsWith(matrix.platform, 'darwin') - run: echo "static .a carries no install_name; nothing to relocate" - - # Stage the produced archive under a per-platform directory that mirrors - # the driver's nested-module layout, plus a SHA-256 the driver verifies - # before committing/using it. + # Stage the produced archive + a SHA-256 for verification, under a + # per-platform dir. Uniform archive name across all platforms: + # libdatabricks_sql_kernel.a (guaranteed by the gnu targets above). - name: Stage archive + checksum run: | set -euo pipefail + ARCHIVE="libdatabricks_sql_kernel.a" + SRC="target/${{ matrix.target }}/release/${ARCHIVE}" OUT="dist/${{ matrix.platform }}" mkdir -p "$OUT" - SRC="target/release/${{ matrix.archive }}" if [ ! -f "$SRC" ]; then - echo "::error::expected archive not found at $SRC" - ls -la target/release/ || true + echo "::error::expected static archive not found at ${SRC}" + echo "contents of target/${{ matrix.target }}/release:" + ls -la "target/${{ matrix.target }}/release" || true exit 1 fi - cp "$SRC" "$OUT/${{ matrix.archive }}" - # Also emit the C header alongside so the driver can commit a matching - # header at the same revision. The header is generated into include/. - if [ -f include/databricks_kernel.h ]; then - cp include/databricks_kernel.h "$OUT/databricks_kernel.h" - fi - # Portable SHA-256 (shasum on macOS, sha256sum on Linux; certutil Win). - cd "$OUT" - if command -v sha256sum >/dev/null 2>&1; then - sha256sum "${{ matrix.archive }}" > "${{ matrix.archive }}.sha256" - elif command -v shasum >/dev/null 2>&1; then - shasum -a 256 "${{ matrix.archive }}" > "${{ matrix.archive }}.sha256" - else - certutil -hashfile "${{ matrix.archive }}" SHA256 | sed -n 2p > "${{ matrix.archive }}.sha256" + cp "$SRC" "$OUT/${ARCHIVE}" + # Commit the matching C header so the bindings repo can pin a header at + # the same kernel revision. It is committed at include/databricks_kernel.h. + if [ ! -f include/databricks_kernel.h ]; then + echo "::error::include/databricks_kernel.h not found (expected committed header)" + exit 1 fi - echo "staged:"; ls -la - echo "size: $(wc -c < "${{ matrix.archive }}") bytes" + cp include/databricks_kernel.h "$OUT/databricks_kernel.h" + # SHA-256 over the archive. sha256sum exists on the Linux runners; + # shasum on macOS. Windows jobs run under Git-bash (shell: bash) which + # ships neither reliably, so fall back to Go-less openssl, which the + # runners have. + ( cd "$OUT" + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "${ARCHIVE}" > "${ARCHIVE}.sha256" + elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 "${ARCHIVE}" > "${ARCHIVE}.sha256" + else + openssl dgst -sha256 -r "${ARCHIVE}" > "${ARCHIVE}.sha256" + fi + echo "staged $(pwd):" + ls -la + echo "archive size: $(wc -c < "${ARCHIVE}") bytes" + cat "${ARCHIVE}.sha256" + ) - name: Upload archive artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -176,21 +195,50 @@ jobs: if-no-files-found: error retention-days: 14 - # On a tag build (or when explicitly requested), attach the archive to the - # GitHub release for that tag, so the Go driver's sync workflow can pull a - # signed, immutable asset by tag rather than a transient CI artifact. - - name: Attach to GitHub release - if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.upload_release == 'true' - env: - GH_TOKEN: ${{ github.token }} + # Attach every platform's archive to the GitHub release for the triggering tag. + # Separate job so it runs ONCE (not per-matrix-entry), needs all builds first, + # and is the only place that holds contents:write. + release-assets: + name: Attach archives to release + needs: build + if: startsWith(github.ref, 'refs/tags/v') || inputs.upload_release + runs-on: + group: databricks-protected-runner-group + labels: linux-ubuntu-latest + permissions: + contents: write # gh release upload + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Download all platform archives + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + pattern: kernel-c-abi-* + path: archives + # keep each artifact in its own subdir: archives/kernel-c-abi-/ + merge-multiple: false + + - name: Upload assets to the release run: | set -euo pipefail - TAG="${GITHUB_REF_NAME}" - cd "dist/${{ matrix.platform }}" - # Namespace the asset by platform so all five archives coexist on one - # release without name clashes. - ASSET="libdatabricks_sql_kernel-${{ matrix.platform }}.a" - cp "${{ matrix.archive }}" "$ASSET" - gh release upload "$TAG" \ - "$ASSET" "${{ matrix.archive }}.sha256" \ - --repo "$GITHUB_REPOSITORY" --clobber + tag="${GITHUB_REF_NAME}" + shopt -s nullglob + uploaded=0 + for dir in archives/kernel-c-abi-*; do + platform="${dir##*/kernel-c-abi-}" + archive="$dir/libdatabricks_sql_kernel.a" + sha="$dir/libdatabricks_sql_kernel.a.sha256" + if [ ! -f "$archive" ]; then + echo "::error::missing archive for ${platform} at ${archive}" + exit 1 + fi + # Namespace the asset by platform so all archives coexist on one + # release. Keep the .a extension — every platform's archive IS a .a. + asset="libdatabricks_sql_kernel-${platform}.a" + cp "$archive" "$asset" + cp "$sha" "${asset}.sha256" + gh release upload "$tag" "$asset" "${asset}.sha256" \ + --repo "$GITHUB_REPOSITORY" --clobber + uploaded=$((uploaded + 1)) + done + echo "uploaded ${uploaded} platform archive(s) to release ${tag}" From 06d73eccc20291c213c163d3f7451a91fc7bf549 Mon Sep 17 00:00:00 2001 From: Madhavendra Rathore Date: Sat, 22 Aug 2026 18:35:45 +0530 Subject: [PATCH 4/4] ci: use databricks-protected-runner-group; only linux+windows can run today MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct a wrong assumption after checking databricks-odbc: the databricks org enforces an IP allow list, so GitHub-hosted runners CANNOT be used at all (actions/checkout 403s before auth). The prior matrix used GitHub-hosted macos-*/ubuntu-*/windows-latest labels — every leg would have failed. Verified reality (databricks-odbc + this repo): the protected group has exactly two labels — linux-ubuntu-latest and windows-server-latest. No macOS label (self-hosted macOS ~Oct 2026; ODBC's macos.yml is dormant for this) and no arm64/Graviton label. So: - linux_amd64 -> group/linux-ubuntu-latest (runs now) - windows_amd64 -> group/windows-server-latest (runs now) - darwin_arm64 / darwin_amd64 / linux_arm64: commented out in the matrix until those labels exist (one-line uncomment each). darwin_arm64's real .a is already committed to the bindings repo separately (built on a mac). Windows still targets x86_64-pc-windows-gnu (Go cgo needs a MinGW .a, unlike ODBC's msvc C++ build) — but whether windows-server-latest has MinGW gcc is UNVERIFIED and flagged in the header; first Windows run confirms. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore --- .github/workflows/build-c-abi-libs.yml | 102 ++++++++++++++----------- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-c-abi-libs.yml b/.github/workflows/build-c-abi-libs.yml index 9bf2efc4..cf3371e1 100644 --- a/.github/workflows/build-c-abi-libs.yml +++ b/.github/workflows/build-c-abi-libs.yml @@ -28,35 +28,43 @@ # the kernel-c-abi- artifact and commit it into lib//). No # cross-repo token is used here. # -# ── Toolchain correctness (why each target is what it is) ────────────────────── -# The Go driver links the kernel through cgo. On every platform cgo uses a -# GNU-family C toolchain (gcc/clang), which links a GNU-style static archive -# (libNAME.a) — NEVER an MSVC import library (.lib). Therefore: -# * We always build with an EXPLICIT `--target` (never host-inferred), so the -# output triple is unambiguous and the emitted archive matches what the -# driver's cgo LDFLAGS expect. -# * Windows is built for the **x86_64-pc-windows-GNU** target (MinGW), NOT the -# msvc default of a windows-latest runner. msvc emits `databricks_sql_kernel.lib`, -# which cgo/MinGW on Windows cannot consume; the gnu target emits -# `libdatabricks_sql_kernel.a`, which it can. See the driver's cgo_windows.go. -# Net: ALL platforms produce a uniformly named `libdatabricks_sql_kernel.a`. +# ── Runner reality in the `databricks` org (verified against databricks-odbc) ── +# The `databricks` org enforces an IP allow list, so GitHub-hosted runners CANNOT +# be used at all — they get arbitrary Azure IPs and fail `actions/checkout` with +# 403 before auth even runs (see databricks-odbc/.github/workflows/macos.yml). +# Every job here therefore runs on `databricks-protected-runner-group`. Only two +# labels exist in that group today, confirmed across databricks-odbc + this repo: +# * linux-ubuntu-latest (linux/amd64) +# * windows-server-latest (windows/amd64) — used by databricks-odbc/pr.yml +# There is NO macOS label (self-hosted macOS is expected ~Oct 2026; ODBC's +# macos.yml is dormant for the same reason) and NO arm64/Graviton label. So: +# * linux_amd64 — builds here, now. +# * windows_amd64 — builds here, now (see the Windows toolchain note below). +# * darwin_arm64 / darwin_amd64 / linux_arm64 — cannot run until the protected +# group gains macOS and arm64 labels; they are listed in the matrix but +# COMMENTED OUT so they neither fail nor post empty required checks. Uncomment +# each once its label exists (one-line change). # -# Build flags mirror the driver's build/kernel-lib.sh exactly -# (`--release --locked --no-default-features --features tls-rustls`) so the -# CI-produced archive is the same shape the driver expects (pure-Rust TLS). +# ── Windows toolchain (UNVERIFIED — flagged, not assumed) ────────────────────── +# The Go driver links the kernel through Go cgo, which on Windows uses MinGW/gcc +# and links a GNU archive (libNAME.a), NOT an MSVC import lib (.lib). So this +# workflow builds Windows for x86_64-pc-windows-GNU. NOTE the divergence from +# databricks-odbc, which builds Windows as x86_64-pc-windows-MSVC — that is +# correct for ODBC (a C++ consumer linking with MSVC) but wrong for Go cgo. +# Whether the `windows-server-latest` protected runner has a working MinGW gcc +# for the gnu target is UNVERIFIED; the first Windows run will confirm. If MinGW +# is unavailable there, options are: install it in-job, or reconsider whether the +# Windows kernel target ships at all (the driver's cgo_windows.go notes Windows +# "is not yet exercised"). Do not assume this leg is green until CI proves it. # -# Triggered by a `v*` tag (release path) or manual workflow_dispatch. +# ── Build flags ──────────────────────────────────────────────────────────────── +# Explicit `--target` per leg (never host-inferred), so the output triple is +# unambiguous and lands at target//release/libdatabricks_sql_kernel.a +# (uniform name across gnu/darwin targets). Flags mirror the driver's +# build/kernel-lib.sh exactly (`--release --locked --no-default-features +# --features tls-rustls`, pure-Rust TLS). # -# ── PRE-MERGE NOTE: runner availability (the one thing to confirm on first run) ─ -# Every OTHER workflow in this repo runs on `databricks-protected-runner-group` -# / `linux-ubuntu-latest`. This workflow is the first to request GitHub-hosted -# `macos-14`, `macos-13`, `ubuntu-latest`, `ubuntu-24.04-arm`, and -# `windows-latest` runners (per-platform native builds need them). Before relying -# on this in a release, confirm the org permits these GitHub-hosted runner -# labels (some orgs restrict runners to the protected group). If a label is not -# permitted, that matrix leg will fail to schedule — swap it for the org's -# equivalent macOS/Windows/ARM label in the matrix `runs-on` below; nothing else -# changes. `fail-fast: false` keeps a disallowed leg from taking down the others. +# Triggered by a `v*` tag (release path) or manual workflow_dispatch. name: Build C-ABI Libraries @@ -89,7 +97,9 @@ defaults: jobs: build: name: "C-ABI ${{ matrix.platform }}" - runs-on: ${{ matrix.runs-on }} + runs-on: + group: databricks-protected-runner-group + labels: [ "${{ matrix.runner_label }}" ] permissions: contents: read # OIDC token exchange for the .github/actions/setup-jfrog composite (cargo @@ -99,26 +109,30 @@ jobs: fail-fast: false matrix: include: - # platform : the GOOS_GOARCH tag the bindings repo keys off - # (lib//); target : the explicit Rust triple we - # build (never host-inferred); runs-on : a native runner for - # that OS/arch (no cross-compilation). - - platform: darwin_arm64 - runs-on: macos-14 # Apple Silicon - target: aarch64-apple-darwin - - platform: darwin_amd64 - runs-on: macos-13 # Intel - target: x86_64-apple-darwin + # platform : the GOOS_GOARCH tag the bindings repo keys off (lib//). + # target : the explicit Rust triple we build (never host-inferred). + # runner_label : the label within databricks-protected-runner-group. + # + # Only linux_amd64 and windows_amd64 run today — those are the only + # labels the protected group has (verified against databricks-odbc). The + # macOS and arm64 legs are COMMENTED OUT because no such label exists yet + # (self-hosted macOS ~Oct 2026; no Graviton label). Uncomment each once + # its label lands in the protected group — one line, nothing else changes. - platform: linux_amd64 - runs-on: ubuntu-latest + runner_label: linux-ubuntu-latest target: x86_64-unknown-linux-gnu - - platform: linux_arm64 - runs-on: ubuntu-24.04-arm # native ARM runner - target: aarch64-unknown-linux-gnu - platform: windows_amd64 - runs-on: windows-latest - # GNU (MinGW), NOT msvc — cgo links .a, not .lib. See header. - target: x86_64-pc-windows-gnu + runner_label: windows-server-latest + target: x86_64-pc-windows-gnu # MinGW .a for Go cgo — see header (UNVERIFIED) + # - platform: darwin_arm64 + # runner_label: + # target: aarch64-apple-darwin + # - platform: darwin_amd64 + # runner_label: + # target: x86_64-apple-darwin + # - platform: linux_arm64 + # runner_label: + # target: aarch64-unknown-linux-gnu steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1