Skip to content

Upgrade df version #1961

Upgrade df version

Upgrade df version #1961

Workflow file for this run

name: Ensure parseable builds on all release targets
on:
pull_request:
paths-ignore:
- docs/**
- helm/**
- assets/**
- "**.md"
jobs:
# Default build without Kafka
build-default:
name: Build Default ${{matrix.target}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux builds - x86_64 native, aarch64 cross-compile
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use_cross: false
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use_cross: true
# macOS builds - both native on macos-latest (M1)
- os: macos-latest
target: x86_64-apple-darwin
use_cross: false
- os: macos-latest
target: aarch64-apple-darwin
use_cross: false
# Windows build
- os: windows-latest
target: x86_64-pc-windows-msvc
use_cross: false
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install GCC 11 on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-11 g++-11
- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.target }}-default-${{ hashFiles('**/Cargo.lock') }}
- name: Build with cross
if: matrix.use_cross
run: cross build --target ${{ matrix.target }} --release
- name: Build native
if: ${{ !matrix.use_cross }}
env:
CC: ${{ runner.os == 'Linux' && 'gcc-11' || '' }}
CXX: ${{ runner.os == 'Linux' && 'g++-11' || '' }}
run: cargo build --target ${{ matrix.target }} --release
# Kafka build for supported platforms
build-kafka:
name: Build Kafka ${{matrix.target}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64 - native build
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use_cross: false
# Linux aarch64 - cross-compile
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use_cross: true
# macOS aarch64 - native on M1
- os: macos-latest
target: aarch64-apple-darwin
use_cross: false
steps:
- uses: actions/checkout@v4
# Linux-specific dependencies for native x86_64 build
- name: Install Linux dependencies (x86_64)
if: runner.os == 'Linux' && matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y \
gcc-11 \
g++-11 \
build-essential \
pkg-config \
cmake \
clang \
zlib1g-dev \
libzstd-dev \
liblz4-dev \
libssl-dev \
libsasl2-dev \
python3
# Linux dependencies for aarch64 cross-compilation
- name: Install Linux dependencies (aarch64 cross)
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y \
gcc-11 \
g++-11 \
build-essential \
pkg-config \
cmake \
clang \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu
# macOS-specific dependencies
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install \
llvm \
pkg-config \
zstd \
lz4 \
[email protected] \
cyrus-sasl \
python3
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{ hashFiles('**/Cargo.lock') }}
- name: Find and fix librdkafka CMakeLists.txt for Linux
if: runner.os == 'Linux' && !matrix.use_cross
run: |
cargo fetch
# Find the rdkafka-sys package directory
RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
# Find the librdkafka CMakeLists.txt file
CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
if [ -f "$CMAKE_FILE" ]; then
echo "Found CMakeLists.txt at: $CMAKE_FILE"
# Make a backup of the original file
cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
# Replace the minimum required version
sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
echo "Modified CMakeLists.txt - before and after comparison:"
diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
else
echo "Could not find librdkafka CMakeLists.txt file!"
exit 1
fi
- name: Find and fix librdkafka CMakeLists.txt for macOS
if: runner.os == 'macOS'
run: |
cargo fetch
# Find the rdkafka-sys package directory
RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
# Find the librdkafka CMakeLists.txt file
CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
if [ -f "$CMAKE_FILE" ]; then
echo "Found CMakeLists.txt at: $CMAKE_FILE"
# Make a backup of the original file
cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
# Replace the minimum required version - macOS requires '' after -i
sed -i '' 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
echo "Modified CMakeLists.txt - before and after comparison:"
diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
else
echo "Could not find librdkafka CMakeLists.txt file!"
exit 1
fi
- name: Build with Kafka (cross)
if: matrix.use_cross
run: cross build --target ${{ matrix.target }} --features kafka --release
- name: Build with Kafka (native)
if: ${{ !matrix.use_cross }}
env:
CC: ${{ runner.os == 'Linux' && 'gcc-11' || '' }}
CXX: ${{ runner.os == 'Linux' && 'g++-11' || '' }}
LIBRDKAFKA_SSL_VENDORED: 1
run: cargo build --target ${{ matrix.target }} --features kafka --release