Skip to content

Commit c9791a4

Browse files
committed
Enable testing of Python limited API builds
1 parent 26ce4ff commit c9791a4

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

.github/workflows/build-all-rapids-repos.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,19 @@ jobs:
4343
build_command: |
4444
sccache -z;
4545
sccache --show-adv-stats;
46-
clone-all -j$(nproc) -v -q --clone-upstream --single-branch --shallow-submodules;
46+
# Need Python 3.11 for the buffer protocol in the limited API
47+
export PYTHON_VERSION="3.11"
48+
clone-all -j$(nproc) -v -q --clone-upstream --single-branch --shallow-submodules --no-update-env;
49+
rapids-generate-scripts
50+
. rapids-make-${PYTHON_PACKAGE_MANAGER}-env
51+
# The latest version of this branch includes both my patches (required
52+
# for RAPIDS Cython usage to work) and upstream patches required for
53+
# Cython itself to work under the limited API.
54+
export NO_CYTHON_COMPILE=true
55+
python -m pip install git+https://github.com/cython/cython.git@limited-api-preview
56+
# Need to install my branch of scikit-build-core for the way I'm specifying CMAKE_CXX_FLAGS via CMAKE_ARGS to work
57+
python -m pip install git+https://github.com/vyasr/scikit-build-core.git@fix/cmake_args_quoted_spaces
58+
4759
build-all \
4860
-v \
4961
-j$(nproc --ignore=1) \

features/src/rapids-build-utils/opt/rapids-build-utils/manifest.yaml

+11-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- name: rmm
2525
sub_dir: python/rmm
2626
depends: [rmm]
27-
args: {install: *rapids_build_backend_args}
27+
args: {install: *rapids_build_backend_args, cmake: -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'"}
2828

2929
- name: ucxx
3030
path: ucxx
@@ -82,11 +82,11 @@ repos:
8282
- name: pylibcudf
8383
sub_dir: python/pylibcudf
8484
depends: [cudf]
85-
args: {install: *rapids_build_backend_args}
85+
args: {cmake: -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
8686
- name: cudf
8787
sub_dir: python/cudf
8888
depends: [cudf]
89-
args: {install: *rapids_build_backend_args}
89+
args: {cmake: -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
9090
- name: dask_cudf
9191
sub_dir: python/dask_cudf
9292
args: {install: *rapids_build_backend_args}
@@ -115,11 +115,11 @@ repos:
115115
- name: pylibraft
116116
sub_dir: python/pylibraft
117117
depends: [raft]
118-
args: {cmake: -DFIND_RAFT_CPP=ON, install: *rapids_build_backend_args}
118+
args: {cmake: -DFIND_RAFT_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
119119
- name: raft-dask
120120
sub_dir: python/raft-dask
121121
depends: [ucxx, raft]
122-
args: {cmake: -DFIND_RAFT_CPP=ON, install: *rapids_build_backend_args}
122+
args: {cmake: -DFIND_RAFT_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
123123

124124
- name: cuvs
125125
path: cuvs
@@ -135,7 +135,7 @@ repos:
135135
- name: cuvs
136136
sub_dir: python/cuvs
137137
depends: [cuvs]
138-
args: {cmake: -DFIND_CUVS_CPP=ON, install: *rapids_build_backend_args}
138+
args: {cmake: -DFIND_CUVS_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
139139

140140
- name: cumlprims_mg
141141
path: cumlprims_mg
@@ -158,7 +158,7 @@ repos:
158158
- name: cuml
159159
sub_dir: python/cuml
160160
depends: [cuml]
161-
args: {cmake: -DFIND_CUML_CPP=ON, install: *rapids_build_backend_args}
161+
args: {cmake: -DFIND_CUML_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
162162

163163
- name: cugraph-ops
164164
path: cugraph-ops
@@ -220,11 +220,11 @@ repos:
220220
- name: pylibcugraph
221221
sub_dir: python/pylibcugraph
222222
depends: [cugraph]
223-
args: {cmake: -DFIND_CUGRAPH_CPP=ON, install: *rapids_build_backend_args}
223+
args: {cmake: -DFIND_CUGRAPH_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
224224
- name: cugraph
225225
sub_dir: python/cugraph
226226
depends: [cugraph]
227-
args: {cmake: -DFIND_CUGRAPH_CPP=ON, install: *rapids_build_backend_args}
227+
args: {cmake: -DFIND_CUGRAPH_CPP=ON -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}
228228
- name: nx-cugraph
229229
sub_dir: python/nx-cugraph
230230
args: {install: *rapids_build_backend_args}
@@ -263,11 +263,12 @@ repos:
263263
# it doesn't have a build dir of its own. That means we can't list it as
264264
# a cpp repo after cuspatial (above), and we have to manually point CMake
265265
# to the cuspatial build dir here.
266+
# Limited API compilation of cuproje currently fails due to https://github.com/cython/cython/issues/6405
266267
args:
267268
cmake: |
268269
-DFIND_CUPROJ_CPP=ON
269270
-Dcuproj_ROOT="${HOME}/cuspatial/cpp/build/${PYTHON_PACKAGE_MANAGER}/cuda-${CUDA_VERSION}/latest"
270271
- name: cuspatial
271272
sub_dir: python/cuspatial
272273
depends: [cuspatial]
273-
args: {install: *rapids_build_backend_args}
274+
args: {cmake: -DCMAKE_CXX_FLAGS="'-DPy_LIMITED_API=0x030B0000 -DCYTHON_LIMITED_API=1'", install: *rapids_build_backend_args}

0 commit comments

Comments
 (0)