← All tasks
cppalibaba/zvec #468Not a task: not reproduced

v0.2.0 source build fails on Debian 12 / Ubuntu 22.04: bundled Arrow 21 requires CMake 3.26+ for Thrift

envgap__alibaba__zvec-468

01 / FAILURE SIGNATURE

As reported upstream

Require CMake 3.26 or later for building bundled Apache Thrift
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
5cd9178bf49360783248fd4bcd0d0a3377b46add
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

alibaba/zvec #468 · read the original issue
### Summary

Building **alibaba/zvec v0.2.0** from source fails on common Linux distros when the bundled **Apache Arrow 21.0.0** ExternalProject configures **bundled Apache Thrift**. Arrow requires **CMake ≥ 3.26**, but default packages on Debian 12 / Ubuntu 22.04 ship older CMake.

This blocks downstream consumers (e.g. [zvec-go](https://github.com/danieleugenewilliams/zvec-go) `make deps`, Go CGO bindings) that clone and cmake-build zvec v0.2.0.

### Environment

| Platform | CMake | g++ | Result |
|----------|-------|-----|--------|
| Docker `golang:1.26.3-bookworm` (Debian 12) | **3.25.1** (`apt install cmake`) | 12.2.0 | **FAIL** at Arrow configure |
| Docker `ubuntu:22.04` | **3.22.1** | 11.x | **FAIL** (CMake below 3.26) |
| Docker `ubuntu:24.04` | **3.28.3** | 13.x | **OK** for Arrow Thrift step (≥ 3.26) |
| Docker `golang:1.26.3-bookworm` + portable CMake 3.29.6 | 3.29.6 | 12.2.0 | **OK** — full `cmake --build` to 100% (~19 min, 2 parallel jobs) |

**Arrow Thrift step by distro `apt cmake`:**

| Image | `cmake --version` | Arrow Thrift step |
|-------|-------------------|-------------------|
| `golang:1.26.3-bookworm` | 3.25.1 | **FAIL** |
| `ubuntu:22.04` | 3.22.1 | **FAIL** |
| `ubuntu:24.04` | 3.28.3 | **OK** (≥ 3.26) |

Tag: **v0.2.0** (`1d5aeeed1df6e104443edf23891798f1ff0a8bf7`)

### Steps to reproduce

```bash
docker run --rm golang:1.26.3-bookworm bash -c '
  apt-get update -qq && apt-get install -y -qq cmake g++ make git &&
  git clone --depth 1 --branch v0.2.0 --recurse-submodules https://github.com/alibaba/zvec.git /tmp/zvec &&
  cmake -S /tmp/zvec -B /tmp/zb \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_SHARED_LIBS=OFF \
    -DBUILD_TOOLS=OFF \
    -DBUILD_PYTHON_BINDINGS=OFF &&
  cmake --build /tmp/zb --parallel 2
'
```

### Actual result

1. zvec top-level CMake configure — **OK**
2. Build progresses; **rocksdb** completes (~55%) — **OK**
3. `ARROW.BUILD` ExternalProject configure — **FAIL**:

```
CMake Error at cmake_modules/ThirdpartyToolchain.cmake:1739 (message):
  Require CMake 3.26 or later for building bundled Apache Thrift
```

Full log excerpt (`ARROW.BUILD-configure-err.log`):

```
CMake Error at cmake_modules/ThirdpartyToolchain.cmake:1739 (message):
  Require CMake 3.26 or later for building bundled Apache Thrift
Call Stack (most recent call first):
  cmake_modules/ThirdpartyToolchain.cmake:219 (build_thrift)
  cmake_modules/ThirdpartyToolchain.cmake:308 (build_dependency)
  cmake_modules/ThirdpartyToolchain.cmake:1808 (resolve_dependency)
  CMakeLists.txt:511 (include)
```

### Root cause

`thirdparty/arrow/CMakeLists.txt` builds Arrow with bundled dependencies:

```cmake
CONFIGURE_COMMAND ... -DARROW_DEPENDENCY_SOURCE=BUNDLED ...
  -DARROW_PARQUET=ON ...
```

Parquet pulls in **bundled Thrift**. In Arrow 21.0.0, `cpp/cmake_modules/ThirdpartyToolchain.cmake` enforces:

```cmake
if(CMAKE_VERSION VERSION_LESS 3.26)
  message(FATAL_ERROR "Require CMake 3.26 or later for building bundled Apache Thrift")
endif()
```

Default `cmake` on Debian 12 is **3.25.1**; Ubuntu 22.04 is **3.22.1** — both below the threshold.

### Expected result

Documented, reproducible source build on at least one common LTS (Debian 12 / Ubuntu 22.04 / 24.04) with distro packages, **or** an explicit minimum CMake version check at zvec configure time with a clear error message.

### Suggested fixes

1. **Document** `cmake >= 3.26` in build-from-source guide (and in repo README / CONTRIBUTING).
2. **Fail fast:** `cmake_minimum_required(VERSION 3.26)` (or a `message(FATAL_ERROR ...)`) in top-level `CMakeLists.txt` before the long thirdparty build.
3. **Arrow ExternalProject options** (if Parquet/Thrift can use system libs):
   - `-DARROW_DEPENDENCY_SOURCE=SYSTEM` + `libthrift-dev` on older distros, or
   - evaluate `-DARROW_WITH_THRIFT=OFF` if Parquet features zvec needs do not require Thrift.
4. **CI:** add a cmake-build job on `ubuntu-latest` / bookworm with default `apt cmake` to catch this class of regression.

### Workaround (consumers) — verified

On `golang:1.26.3-bookworm` (Debian 12), installing portable **CMake 3.29.6** before configure/build unblocks the failure:

```bash
wget -q https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.tar.gz
tar -xzf cmake-3.29.6-linux-x86_64.tar.gz -C /opt
export PATH=/opt/cmake-3.29.6-linux-x86_64/bin:$PATH

git clone --depth 1 --branch v0.2.0 --recurse-submodules https://github.com/alibaba/zvec.git /tmp/zvec
cmake -S /tmp/zvec -B /tmp/zb \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_SHARED_LIBS=OFF \
  -DBUILD_TOOLS=OFF \
  -DBUILD_PYTHON_BINDINGS=OFF
cmake --build /tmp/zb --parallel 2
```

**Result:** build completes to **100%** (~19 min, 2 parallel jobs). Last target: `Built target zvec_sqlengine`.

Alternative without portable CMake: use **Ubuntu 24.04** base image (`apt cmake` is 3.28.3).

Root cause analysis above holds: bundled Arrow 21 + `ARROW_DEPENDENCY_SOURCE=BUNDLED` + Parquet → Thrift requires CMake ≥ 3.26, but default packages on Debian 12 / Ubuntu 22.04 are below that.

### Related downstream reports

- [danieleugenewilliams/zvec-go#1](https://github.com/danieleugenewilliams/zvec-go/issues/1) — `make deps` fails (same Arrow step; consumer of zvec v0.2.0)

### Additional context: Windows MinGW

On Windows 11 with WinLibs GCC 16.1 + CMake 4.3.3, Arrow **configure** can succeed (with short build paths), but the Arrow **build** later fails in bundled `re2` (~42%). Separate from the Linux CMake issue; details in zvec-go#1.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]