Skip to content

Commit

Permalink
Move building of python arrow modules from pyarrow to apache-arrow. (#…
Browse files Browse the repository at this point in the history
…30285)

A couple things here:
1. fix FTBFS state that apache-arrow was currently in.

  * need zstd-static because:

CMake Error at /usr/lib64/cmake/zstd/zstdTargets.cmake:107 (message):
         The imported target "zstd::libzstd_static" references the file
            "/usr/lib/libzstd.a" uses=cmake/configure
         but this file does not exist.  Possible reasons include:

2. cherry-pick a patch (from 2016) to rapidjson that allows a user of it
   (apache-arrow) to build with gcc-14.

3. Add environment variables to build so the python build modules
   have access.  I had hoped to localize these or use substitution
   in the environment block, but that is not supported.

   chainguard-dev/melange#1548
   chainguard-dev/melange#1402

4. drop unnecessary runtime dependency from libarrow to libarrow.

5. remove pyarrow.

6. bump the epoch on apache-arrow to 3 to be newer than pyarrow was.

7. provide multiple versions of the python modules, and make them
provide 'pyarrow' for backwards compat.
  • Loading branch information
smoser authored Oct 8, 2024
1 parent 8593090 commit f54907c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 59 deletions.
63 changes: 59 additions & 4 deletions apache-arrow.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
package:
name: apache-arrow
version: 17.0.0
epoch: 0
epoch: 2
description: "multi-language toolbox for accelerated data interchange and in-memory processing"
copyright:
- license: Apache-2.0

vars:
pypi-package: pyarrow

data:
- name: py-versions
items:
3.10: '310'
3.11: '311'
3.12: '312'
3.13: '300'

environment:
contents:
packages:
Expand All @@ -19,6 +30,7 @@ environment:
- bzip2-dev
- c-ares-dev
- cmake
- cython
- gflags-dev
- glog-dev
- grpc
Expand All @@ -33,6 +45,9 @@ environment:
- protobuf
- protobuf-dev
- protoc
- py3-supported-build-base-dev
- py3-supported-cython
- py3-supported-numpy
- rapidjson-dev
- re2-dev
- snappy-dev
Expand All @@ -44,6 +59,13 @@ environment:
- xsimd-dev
- zlib-dev
- zstd-dev
- zstd-static
environment:
# These PYARROW_* and CMAKE_PREFIX_PATH are used by the python build.
PYARROW_PARALLEL: "4"
PYARROW_WITH_PARQUET: "1"
PYARROW_WITH_ACERO: "1"
CMAKE_PREFIX_PATH: "/home/build/melange-out/apache-arrow/usr"

pipeline:
- uses: git-checkout
Expand Down Expand Up @@ -103,6 +125,42 @@ pipeline:
- uses: strip

subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: ${{vars.pypi-package}} installed for python${{range.key}}
dependencies:
provider-priority: ${{range.value}}
provides:
- py3-${{vars.pypi-package}}
- pyarrow
runtime:
- py${{range.key}}-numpy
pipeline:
- working-directory: /home/build/apache-arrow/python
pipeline:
- uses: py/pip-build-install
with:
python: python${{range.key}}
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
imports: |
import pyarrow
from pyarrow import acero
from pyarrow import parquet
- name: py3-supported-${{vars.pypi-package}}
description: meta package providing ${{vars.pypi-package}} for supported python versions.
dependencies:
runtime:
- py3.10-${{vars.pypi-package}}
- py3.11-${{vars.pypi-package}}
- py3.12-${{vars.pypi-package}}
- py3.13-${{vars.pypi-package}}

- name: ${{package.name}}-dev
description: "multi-language toolbox for accelerated data interchange and in-memory processing (development files)"
pipeline:
Expand All @@ -117,9 +175,6 @@ subpackages:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/lib
cp -a ${{targets.destdir}}/usr/lib/libarrow.so.* ${{targets.subpkgdir}}/usr/lib
dependencies:
runtime:
- libarrow
- name: "libarrow_acero"
description: "multi-language toolbox for accelerated data interchange and in-memory processing (libarrow_acero library)"
Expand Down
54 changes: 0 additions & 54 deletions pyarrow.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion rapidjson.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package:
name: rapidjson
version: 1.1.0
epoch: 2
epoch: 3
description: Fast JSON parser/generator for C++ with both SAX/DOM style API
copyright:
- license: BSD-2-Clause
Expand All @@ -23,6 +23,10 @@ pipeline:
expected-commit: f54b0e47a08782a6131cc3d60f94d038fa6e0a51
repository: https://github.com/miloyip/rapidjson
tag: v${{package.version}}
cherry-picks: |
# https://github.com/Tencent/rapidjson/issues/2277
master/862c39be371278a45a88d4d1d75164be57bb7e2d: fix build on gcc-14
master/3b2441b87f99ab65f37b141a7b548ebadb607b96: fix build on gcc-14
- uses: patch
with:
Expand Down

0 comments on commit f54907c

Please sign in to comment.