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
1 change: 1 addition & 0 deletions .github/baseline.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MACOSX_DEPLOYMENT_TARGET=11
39 changes: 35 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
format:
name: Rustfmt
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
Expand All @@ -31,6 +32,7 @@ jobs:
clippy:
name: Clippy
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -39,13 +41,18 @@ jobs:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Clippy
run: cargo clippy --all-targets -- -D warnings

test-linux:
name: Tests (Linux)
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 30
env:
CC: clang
Expand All @@ -54,8 +61,14 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- name: Install Clang 20
run: manylinux-install-clang -v 20.1.8.0
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Run tests
run: cargo test
- name: Run C/C++ compilation tests
Expand All @@ -67,6 +80,13 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Load baseline floors
shell: bash
run: |
set -a
source .github/baseline.env
set +a
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" >>"$GITHUB_ENV"
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
Expand All @@ -79,19 +99,25 @@ jobs:
rustdoc:
name: Rustdoc
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Check documentation
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps

msrv:
name: MSRV (1.91.0)
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -100,13 +126,18 @@ jobs:
toolchain: "1.91.0"
- uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Check MSRV
run: cargo check --all-targets

license-headers:
name: License headers
runs-on: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/consumer-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,45 @@ env:
jobs:
consumer-smoke-test:
name: find_package(LanceC) smoke test
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
os_label: linux
- runner: macos-14
os_label: macos
- os: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
- os: macos-14
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
- name: Load baseline floors
shell: bash
run: |
set -a
source .github/baseline.env
set +a
{
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
} >>"$GITHUB_ENV"
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- name: Install protobuf-compiler (Linux)
if: matrix.os_label == 'linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
if: runner.os == 'Linux'
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Install Clang 20 (Linux)
if: runner.os == 'Linux'
run: |
manylinux-install-clang -v 20.1.8.0
- name: Install protobuf (macOS)
if: matrix.os_label == 'macos'
if: runner.os == 'macOS'
run: brew install protobuf
- name: Configure + build + install lance-c
run: |
Expand Down
57 changes: 38 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,53 @@ env:
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
os_label: linux
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
os_label: linux
- os: ubuntu-24.04
container: quay.io/pypa/manylinux_2_28_x86_64
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
container: quay.io/pypa/manylinux_2_28_aarch64
target: aarch64-unknown-linux-gnu
# x86_64-apple-darwin temporarily disabled: GitHub is deprecating
# macos-13 runners and jobs queue 24h+ before timing out. Restore
# this row once a macos-* Intel runner is reliably available again.
- target: aarch64-apple-darwin
runner: macos-14
os_label: macos
- os: macos-14
target: aarch64-apple-darwin
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
- name: Load baseline floors
shell: bash
run: |
set -a
source .github/baseline.env
set +a
{
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
} >>"$GITHUB_ENV"
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install protobuf (Linux)
if: matrix.os_label == 'linux'
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
if: runner.os == 'Linux'
run: |
ARCH=$(uname -m)
case "${ARCH}" in x86_64) PA="linux-x86_64" ;; aarch64) PA="linux-aarch_64" ;; esac
curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-${PA}.zip" -o /tmp/protoc.zip
unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' && rm /tmp/protoc.zip
- name: Install Clang 20 (Linux)
if: runner.os == 'Linux'
run: |
manylinux-install-clang -v 20.1.8.0
- name: Install protobuf (macOS)
if: matrix.os_label == 'macos'
if: runner.os == 'macOS'
run: brew install protobuf
- name: Resolve version
id: ver
Expand All @@ -74,8 +87,13 @@ jobs:
TARGET=${{ matrix.target }}
ARCHIVE="lance-c-v${VERSION}-${TARGET}.tar.xz"
tar -C stage -cJf "${ARCHIVE}" .
shasum -a 256 "${ARCHIVE}" > "${ARCHIVE}.sha256"
shasum -a 512 "${ARCHIVE}" > "${ARCHIVE}.sha512"
if command -v shasum > /dev/null 2>&1; then
shasum -a 256 "${ARCHIVE}" > "${ARCHIVE}.sha256"
shasum -a 512 "${ARCHIVE}" > "${ARCHIVE}.sha512"
else
sha256sum "${ARCHIVE}" > "${ARCHIVE}.sha256"
sha512sum "${ARCHIVE}" > "${ARCHIVE}.sha512"
fi
echo "archive=${ARCHIVE}" >>"$GITHUB_OUTPUT"
- name: Upload as workflow artifact
uses: actions/upload-artifact@v4
Expand All @@ -92,6 +110,7 @@ jobs:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 15
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
Expand Down
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,38 @@ cmake_minimum_required(VERSION 3.22)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(cargo-version)
include(baseline)
read_cargo_version("${CMAKE_CURRENT_LIST_DIR}/Cargo.toml" LANCE_C_VERSION)

lance_c_load_baseline_env("${CMAKE_CURRENT_LIST_DIR}/.github/baseline.env")

if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOSX_DEPLOYMENT_TARGET}" CACHE STRING "Minimum macOS deployment target" FORCE)
endif()

project(LanceC
VERSION ${LANCE_C_VERSION}
DESCRIPTION "C/C++ bindings for the Lance columnar data format"
HOMEPAGE_URL "https://github.com/lance-format/lance-c"
LANGUAGES C CXX
)

if(NOT DEFINED CMAKE_C_STANDARD OR CMAKE_C_STANDARD LESS 11)
set(CMAKE_C_STANDARD 11)
endif()
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 20)
set(CMAKE_CXX_STANDARD 20)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

include(GNUInstallDirs)

# ─── Options ─────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -42,6 +65,9 @@ if(NOT LANCE_C_USE_PREBUILT)
CRATE_TYPES staticlib cdylib
PROFILE release
)
if(APPLE)
corrosion_set_env_vars(lance_c "MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
endif()

# Imported targets and install rules are added in subsequent tasks.
Expand Down
Loading
Loading