Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/autofmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
gh pr checkout ${{ github.event.issue.number }} --repo "$GITHUB_REPOSITORY"

- name: Install Rust (rustfmt)
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

Expand Down
105 changes: 67 additions & 38 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,39 @@ jobs:
# which invokes `protoc` at build time. Required for the ADBC test path.
run: sudo apt-get install -y protobuf-compiler

- name: Install png writer system libraries
# The png writer renders via wgpu/Vello, which needs a Vulkan
# adapter. ubuntu-latest has no GPU, so install Mesa's lavapipe software
# device. If no adapter is found anyway, the writer test skips its render
# assertion gracefully rather than failing.
# Text layout goes through parley/fontique, which links the system
# fontconfig on Linux to enumerate fonts, so its development files
# (fontconfig.pc plus headers) must be present at build time.
run: sudo apt-get install -y mesa-vulkan-drivers libfontconfig1-dev
- name: Install renderer system libraries
# Two separate needs, conflated easily:
#
# * mesa-vulkan-drivers is for the *raster* writers and the plot
# viewer, which render through wgpu and need a Vulkan adapter.
# ubuntu-latest has no GPU, so this installs Mesa's lavapipe software
# device. Without an adapter those tests skip their render assertion
# rather than fail.
# * fontconfig is for *every* renderer-backed feature including svg,
# pdf and hep: text layout goes through parley/fontique, which
# enumerates fonts through the system fontconfig whatever draws.
#
# Only the fontconfig *runtime* library is installed, deliberately:
# ggsql enables fontique's `fontconfig-dlopen`, so the `-dev` package
# is not needed at build time, and leaving it out makes every CI run a
# regression test for that. fonts-dejavu-core gives fontconfig
# something to find.
run: sudo apt-get install -y mesa-vulkan-drivers libfontconfig1 fonts-dejavu-core

- name: Install Rust
# 1.86 is the MSRV (declared as `rust-version` in /Cargo.toml, see
# /CLAUDE.md); this sets it as the default toolchain so plain `cargo`
# uses it. fmt, clippy and the library build run on 1.86 to guarantee
# the shipped crate builds there.
uses: dtolnay/rust-toolchain@1.86.0
# Stable is the default toolchain. It is *not* the MSRV: `rust-version`
# in /Cargo.toml is 1.86 (CRAN's), which is what points clippy's
# MSRV-aware lints at 1.86 — so running clippy here still guards it.
# The default cannot be 1.86 itself, because the default writers pull
# `parley`, which declares 1.88, and the `adbc` test path needs 1.88
# for real.
Comment on lines +63 to +68

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a claude.md at the workflow level? I feel like this comment about MSRVs is scattered throughout workflows and it might be better to have a single place to explain how we dance to CRAN's tunes

uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Install Rust (test toolchain)
# The experimental `adbc` feature's test path pulls `adbc_datafusion` →
# `datafusion` ≥53.1.0, which requires rustc ≥1.88. Steps that compile
# tests/dev-dependencies use this newer toolchain via `cargo +stable`.
# Installing it here does not change the default — plain `cargo` stays
# on 1.86.
run: rustup toolchain install stable --profile minimal
- name: Install Rust (CRAN toolchain)
# For the MSRV check below only. Does not change the default.
run: rustup toolchain install 1.86 --profile minimal

- name: Caching
uses: Swatinem/rust-cache@v2
Expand All @@ -81,42 +88,64 @@ jobs:
run: cargo clippy -- -D warnings

- name: Install wasm-pack
# `cargo install` runs at the repo root, where 1.86 is the default;
# `+stable` builds the tool on the newer toolchain. The actual wasm build
# below runs in ggsql-wasm/, whose nested rust-toolchain.toml selects stable.
run: cargo +stable install wasm-pack
# The wasm build itself runs in ggsql-wasm/, whose nested
# rust-toolchain.toml selects stable.
run: cargo install wasm-pack

- name: Build library (MSRV 1.86)
- name: Build library
run: cargo build

- name: Build all targets
# --all-targets compiles dev-dependencies (datafusion), so it needs ≥1.88.
run: cargo +stable build --all-targets
run: cargo build --all-targets

- name: Check the library builds on CRAN's toolchain (MSRV 1.86)
# The R package vendors ggsql and CRAN builds it on 1.86, so the code
# has to keep compiling there. `--ignore-rust-version` is needed only
# because `parley` *declares* 1.88 while compiling fine on 1.86 — do
# not delete the flag; delete this job and the MSRV silently rots.
#
# Library only, not --all-targets: the `adbc` dev-dependency path pulls
# datafusion, which uses let-chains and genuinely requires 1.88.
run: cargo +1.86 check --ignore-rust-version -p ggsql

- name: Run tree-sitter tests
working-directory: tree-sitter-ggsql
run: tree-sitter test

- name: Run Rust tests
run: cargo +stable test --lib --bins
run: cargo test --lib --bins

- name: Install dbc CLI and SQLite ADBC driver
run: |
curl -LsSf https://dbc.columnar.tech/install.sh | sh
"$HOME/.local/bin/dbc" install sqlite

- name: Run ADBC unit tests
run: cargo +stable test --features "adbc sqlite" --lib
run: cargo test --features "adbc sqlite" --lib

- name: Run ADBC SQLite equivalence tests
run: cargo +stable test --features "adbc sqlite" --lib -- --ignored equivalence

- name: Run png writer tests
# Non-default feature. The hephaestus crate it renders through needs
# rustc ≥1.88 (wgpu), so it builds on +stable and is excluded from the
# 1.86 library build. Default features (incl. duckdb) supply the
# in-memory reader the test uses.
run: cargo +stable test --features png --lib writer::hephaestus
run: cargo test --features "adbc sqlite" --lib -- --ignored equivalence

- name: Run GPU-free writer tests
# svg, pdf and hep are default features and need no adapter, so these
# are hard assertions on every runner. hep-read adds the document
# round trip. Fast, and its failure is unambiguous, so it runs first.
run: 'cargo test --features hep-read --lib writer::'

- name: Run raster writer tests
# Non-default features needing a GPU adapter. Skips its render
# assertions gracefully if lavapipe did not come up.
run: 'cargo test --features "png jpeg tiff webp" --lib writer::'

- name: Check the plot viewer builds
# Not a writer and it blocks on a window, so it is compiled, not run.
run: cargo check --features window

- name: Check the visual-test harness builds
# `required-features` keeps it out of every other build here, so
# nothing else would catch it failing to compile. Checked, not run:
# it renders the whole doc corpus and wants an adapter to do it.
run: cargo check -p ggsql-cli --features png --example visual_test

- name: Build WASM library
working-directory: ggsql-wasm/library
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,12 @@ jobs:
run: sudo apt-get install -y unixodbc-dev

- name: Install Rust
# 1.86 is the MSRV (see /CLAUDE.md); this is the default toolchain, and
# the Jupyter kernel build below runs on it.
uses: dtolnay/rust-toolchain@1.86.0

- name: Install Rust (wasm toolchain)
# The wasm build is exempt from the 1.86 MSRV (R doesn't use wasm); some
# wasm-only deps need a newer rustc. Installing stable here does not
# change the default — plain `cargo` stays on 1.86, and
# ggsql-wasm/rust-toolchain.toml selects stable for the wasm build.
run: rustup toolchain install stable --profile minimal
# Stable. The MSRV declared in /Cargo.toml is 1.86 — CRAN's, for the R
# package's vendored copy (see /CLAUDE.md) — and it is checked by its
# own step in build.yaml rather than by pinning here; clippy reads
# `rust-version`, not the toolchain. ggsql-wasm/rust-toolchain.toml
# selects stable for the wasm build regardless.
uses: dtolnay/rust-toolchain@stable

- name: Caching
uses: Swatinem/rust-cache@v2
Expand All @@ -59,12 +55,10 @@ jobs:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Install wasm-pack
# `cargo install` runs at the repo root (pinned to 1.86); `+stable`
# builds these tools on the newer toolchain instead.
run: cargo +stable install wasm-pack
run: cargo install wasm-pack

- name: Install wasm-opt
run: cargo +stable install wasm-opt
run: cargo install wasm-opt

- name: Setup quarto
uses: quarto-dev/quarto-actions/setup@v2
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release-jupyter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
# No feature flags: `raster-plots` is default, precisely so that a
# plain build matches the released wheel. It adds the png/jpeg/tiff
# writers, which need a GPU adapter at *run* time and fall back to
# SVG without one, so a wheel carrying them still works on a
# headless machine. No before-script-linux either: ggsql enables
# fontique's `fontconfig-dlopen`, so nothing here needs
# fontconfig-devel at build time — verified in this exact image,
# which does not ship it.
Comment on lines +58 to +65

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flagging that this comment feels like a scar

args: --release --out dist --auditwheel=skip
working-directory: ggsql-jupyter
manylinux: 2_28
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc

Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin

Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin

Expand Down Expand Up @@ -338,7 +338,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu

Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu

Expand Down Expand Up @@ -450,7 +450,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
uses: dtolnay/rust-toolchain@stable

- name: Get crates.io publish token
uses: rust-lang/crates-io-auth-action@v1
Expand Down Expand Up @@ -511,7 +511,7 @@ jobs:
run: npm install -g tree-sitter-cli

- name: Install Rust toolchain
# This job only builds wasm, which is exempt from the 1.86 MSRV (R
# This job only builds wasm, which is exempt from the MSRV (R
# doesn't use wasm) and needs a newer rustc, so the whole job runs on
# stable. ggsql-wasm/rust-toolchain.toml also selects stable for the build.
uses: dtolnay/rust-toolchain@stable
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ jobs:
cache-dependency-path: ggsql-vscode/package-lock.json

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
# Stable, matching every other job that builds a real binary — and the
# kernel released to PyPI. Not the MSRV: that 1.86 floor exists for the
# R package's vendored copy of the *library*, and build.yaml checks it
# directly. The kernel enables `raster-plots`, so it pulls wgpu and
# parley and cannot build on 1.86 at all.
uses: dtolnay/rust-toolchain@stable

# Use publish.yaml's cargo cache with `save-if: false`.
- name: Restore the cargo cache built by publish.yaml
Expand Down
Loading
Loading