Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,29 @@ jobs:
# a live workspace; `rust-e2e.yml` runs them separately.
run: cargo test --workspace

c-abi:
name: C ABI smoke test
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup-jfrog
with:
cargo: "true"

- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
toolchain: stable

- name: make c-abi-test
# Builds the cdylib and compiles + runs the hand-written C smoke
# tests in tests/c/ against the C ABI exported from src/c_abi/.
# Hermetic (no live warehouse) — proves ODBC / Go consumers can
# link and call the kernel. `cc` is preinstalled on the runner.
run: make c-abi-test

check-tls-rustls:
name: Build (tls-rustls feature)
runs-on:
Expand Down
7 changes: 5 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ categories = ["database"]
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

arrow-array = "57"
# `ffi` enables the Arrow C Data Interface (`FFI_ArrowArray` /
# `FFI_ArrowSchema`, `to_ffi`) used by the C ABI's result-stream export
# (`src/ffi/result.rs`) so ODBC / Go consumers can pull result batches
# across the boundary without re-encoding.
arrow-array = { version = "57", features = ["ffi"] }
arrow-buffer = "57"
arrow-cast = "57"
arrow-ord = "57"
Expand Down
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: all build test fmt lint clean check coverage coverage-check
.PHONY: all build test fmt lint clean check coverage coverage-check c-abi-test

all: build

Expand All @@ -31,7 +31,20 @@ fmt-check:
lint:
cargo clippy -- -D warnings

check: fmt-check lint test
# Compile the hand-written C smoke tests against the cdylib and run them.
# Proves the C ABI in `src/ffi/` links and behaves from a real C consumer
# (the ODBC / Go path). Hermetic — no live warehouse needed.
c-abi-test:
cargo build --lib
@mkdir -p target/c-abi
@for src in tests/c/*.c; do \
name=$$(basename $$src .c); \
echo "cc $$src"; \
cc -I include $$src -L target/debug -ldatabricks_sql_kernel -o target/c-abi/$$name || exit 1; \
LD_LIBRARY_PATH=target/debug DYLD_LIBRARY_PATH=target/debug ./target/c-abi/$$name || exit 1; \
done

check: fmt-check lint test c-abi-test

clean:
cargo clean
Expand Down
Loading
Loading