Skip to content

Commit b0df0cf

Browse files
committed
Try using Build-Profiles
1 parent 6b94e5c commit b0df0cf

3 files changed

Lines changed: 25 additions & 11 deletions

File tree

dev/tasks/linux-packages/apache-arrow/Rakefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,14 @@ class ApacheArrowPackageTask < PackageTask
8585
end
8686
end
8787

88+
def apt_arm64_cuda_available_target?(target)
89+
false
90+
end
91+
8892
def apt_prepare_debian_control_cuda_architecture(control, target)
89-
_distribution, code_name, _architecture = split_target(target)
90-
if code_name == "forky"
91-
# nvidia-cuda-toolkit was removed from Debian's repositories so we
92-
# can't build CUDA related packages on Debian forky for now.
93-
# https://tracker.debian.org/news/1758597/nvidia-cuda-toolkit-removed-from-testing/
94-
# See: GH-50090
95-
cuda_architecture = "i386"
93+
if apt_arm64_cuda_available_target?(target)
94+
cuda_architecture = "any"
9695
else
97-
# We never build CUDA related packages for arm64
9896
cuda_architecture = "i386 amd64"
9997
end
10098
control.gsub(/@CUDA_ARCHITECTURE@/, cuda_architecture)

dev/tasks/linux-packages/apache-arrow/debian/control.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Build-Depends:
3030
meson,
3131
ninja-build,
3232
nlohmann-json-dev | nlohmann-json3-dev,
33-
# It might be removed from for example Debian-testing.
34-
# We fallback to base-files if it fails on amd64 or i386.
35-
nvidia-cuda-toolkit [!arm64] | base-files,
33+
# nvidia-cuda-toolkit may be unavailable (e.g. removed from Debian forky).
34+
# apt/build.sh enables the pkg.apache-arrow.nocuda profile in that case so
35+
# this build dependency and the CUDA packages below are skipped.
36+
nvidia-cuda-toolkit [!arm64] <!pkg.apache-arrow.nocuda>,
3637
pkg-config,
3738
protobuf-compiler,
3839
protobuf-compiler-grpc,
@@ -84,6 +85,7 @@ Description: Apache Arrow is a data processing library for analysis
8485
Package: libarrow-cuda2500
8586
Section: libs
8687
Architecture: @CUDA_ARCHITECTURE@
88+
Build-Profiles: <!pkg.apache-arrow.nocuda>
8789
Multi-Arch: same
8890
Pre-Depends: ${misc:Pre-Depends}
8991
Depends:
@@ -192,6 +194,7 @@ Description: Apache Arrow is a data processing library for analysis
192194
Package: libarrow-cuda-dev
193195
Section: libdevel
194196
Architecture: @CUDA_ARCHITECTURE@
197+
Build-Profiles: <!pkg.apache-arrow.nocuda>
195198
Multi-Arch: same
196199
Depends:
197200
${misc:Depends},
@@ -371,6 +374,7 @@ Description: Apache Arrow is a data processing library for analysis
371374
Package: libarrow-cuda-glib2500
372375
Section: libs
373376
Architecture: @CUDA_ARCHITECTURE@
377+
Build-Profiles: <!pkg.apache-arrow.nocuda>
374378
Multi-Arch: same
375379
Pre-Depends: ${misc:Pre-Depends}
376380
Depends:
@@ -385,6 +389,7 @@ Description: Apache Arrow is a data processing library for analysis
385389
Package: libarrow-cuda-glib-doc
386390
Section: doc
387391
Architecture: @CUDA_ARCHITECTURE@
392+
Build-Profiles: <!pkg.apache-arrow.nocuda>
388393
Multi-Arch: foreign
389394
Depends:
390395
${misc:Depends}
@@ -396,6 +401,7 @@ Description: Apache Arrow is a data processing library for analysis
396401
Package: gir1.2-arrow-cuda-25.0
397402
Section: introspection
398403
Architecture: @CUDA_ARCHITECTURE@
404+
Build-Profiles: <!pkg.apache-arrow.nocuda>
399405
Multi-Arch: same
400406
Depends:
401407
${gir:Depends},
@@ -409,6 +415,7 @@ Description: Apache Arrow is a data processing library for analysis
409415
Package: libarrow-cuda-glib-dev
410416
Section: libdevel
411417
Architecture: @CUDA_ARCHITECTURE@
418+
Build-Profiles: <!pkg.apache-arrow.nocuda>
412419
Multi-Arch: same
413420
Depends:
414421
${misc:Depends},

dev/tasks/linux-packages/apt/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ fi
119119
: ${DEB_BUILD_OPTIONS:="parallel=$(nproc)"}
120120
# DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} noopt"
121121
export DEB_BUILD_OPTIONS
122+
# nvidia-cuda-toolkit may be unavailable (e.g. it was removed from Debian
123+
# forky). Disable the CUDA packages via the pkg.apache-arrow.nocuda build
124+
# profile when it isn't installed. debian/rules disables ARROW_CUDA the
125+
# same way. See GH-50090.
126+
if ! dpkg -l nvidia-cuda-toolkit > /dev/null 2>&1; then
127+
DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES:-} pkg.apache-arrow.nocuda"
128+
export DEB_BUILD_PROFILES
129+
debuild_options+=(-eDEB_BUILD_PROFILES)
130+
fi
122131
df -h
123132
if [ "${DEBUG:-no}" = "yes" ]; then
124133
run debuild "${debuild_options[@]}" "${dpkg_buildpackage_options[@]}"

0 commit comments

Comments
 (0)