From 6b94e5ca9f7221024406419fc6d434a81b9b57a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 29 Jun 2026 12:37:33 +0200 Subject: [PATCH 1/3] GH-50090: [Packaging] Make nvidia-cuda-toolkit not fail on Debian forky amd64 --- dev/tasks/linux-packages/apache-arrow/Rakefile | 14 ++++++++------ .../linux-packages/apache-arrow/debian/control.in | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dev/tasks/linux-packages/apache-arrow/Rakefile b/dev/tasks/linux-packages/apache-arrow/Rakefile index cdb771084529..fee88711553f 100644 --- a/dev/tasks/linux-packages/apache-arrow/Rakefile +++ b/dev/tasks/linux-packages/apache-arrow/Rakefile @@ -85,14 +85,16 @@ class ApacheArrowPackageTask < PackageTask end end - def apt_arm64_cuda_available_target?(target) - false - end - def apt_prepare_debian_control_cuda_architecture(control, target) - if apt_arm64_cuda_available_target?(target) - cuda_architecture = "any" + _distribution, code_name, _architecture = split_target(target) + if code_name == "forky" + # nvidia-cuda-toolkit was removed from Debian's repositories so we + # can't build CUDA related packages on Debian forky for now. + # https://tracker.debian.org/news/1758597/nvidia-cuda-toolkit-removed-from-testing/ + # See: GH-50090 + cuda_architecture = "i386" else + # We never build CUDA related packages for arm64 cuda_architecture = "i386 amd64" end control.gsub(/@CUDA_ARCHITECTURE@/, cuda_architecture) diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index 0a82fb04ebcb..ab882ad06da2 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -30,7 +30,9 @@ Build-Depends: meson, ninja-build, nlohmann-json-dev | nlohmann-json3-dev, - nvidia-cuda-toolkit [!arm64], +# It might be removed from for example Debian-testing. +# We fallback to base-files if it fails on amd64 or i386. + nvidia-cuda-toolkit [!arm64] | base-files, pkg-config, protobuf-compiler, protobuf-compiler-grpc, From b0df0cf4d399e4235ccf4daa82ea9edd49823ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 29 Jun 2026 13:10:04 +0200 Subject: [PATCH 2/3] Try using Build-Profiles --- dev/tasks/linux-packages/apache-arrow/Rakefile | 14 ++++++-------- .../linux-packages/apache-arrow/debian/control.in | 13 ++++++++++--- dev/tasks/linux-packages/apt/build.sh | 9 +++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/dev/tasks/linux-packages/apache-arrow/Rakefile b/dev/tasks/linux-packages/apache-arrow/Rakefile index fee88711553f..cdb771084529 100644 --- a/dev/tasks/linux-packages/apache-arrow/Rakefile +++ b/dev/tasks/linux-packages/apache-arrow/Rakefile @@ -85,16 +85,14 @@ class ApacheArrowPackageTask < PackageTask end end + def apt_arm64_cuda_available_target?(target) + false + end + def apt_prepare_debian_control_cuda_architecture(control, target) - _distribution, code_name, _architecture = split_target(target) - if code_name == "forky" - # nvidia-cuda-toolkit was removed from Debian's repositories so we - # can't build CUDA related packages on Debian forky for now. - # https://tracker.debian.org/news/1758597/nvidia-cuda-toolkit-removed-from-testing/ - # See: GH-50090 - cuda_architecture = "i386" + if apt_arm64_cuda_available_target?(target) + cuda_architecture = "any" else - # We never build CUDA related packages for arm64 cuda_architecture = "i386 amd64" end control.gsub(/@CUDA_ARCHITECTURE@/, cuda_architecture) diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index ab882ad06da2..3b0ccc75054a 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -30,9 +30,10 @@ Build-Depends: meson, ninja-build, nlohmann-json-dev | nlohmann-json3-dev, -# It might be removed from for example Debian-testing. -# We fallback to base-files if it fails on amd64 or i386. - nvidia-cuda-toolkit [!arm64] | base-files, +# nvidia-cuda-toolkit may be unavailable (e.g. removed from Debian forky). +# apt/build.sh enables the pkg.apache-arrow.nocuda profile in that case so +# this build dependency and the CUDA packages below are skipped. + nvidia-cuda-toolkit [!arm64] , pkg-config, protobuf-compiler, protobuf-compiler-grpc, @@ -84,6 +85,7 @@ Description: Apache Arrow is a data processing library for analysis Package: libarrow-cuda2500 Section: libs Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: @@ -192,6 +194,7 @@ Description: Apache Arrow is a data processing library for analysis Package: libarrow-cuda-dev Section: libdevel Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: same Depends: ${misc:Depends}, @@ -371,6 +374,7 @@ Description: Apache Arrow is a data processing library for analysis Package: libarrow-cuda-glib2500 Section: libs Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: @@ -385,6 +389,7 @@ Description: Apache Arrow is a data processing library for analysis Package: libarrow-cuda-glib-doc Section: doc Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: foreign Depends: ${misc:Depends} @@ -396,6 +401,7 @@ Description: Apache Arrow is a data processing library for analysis Package: gir1.2-arrow-cuda-25.0 Section: introspection Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: same Depends: ${gir:Depends}, @@ -409,6 +415,7 @@ Description: Apache Arrow is a data processing library for analysis Package: libarrow-cuda-glib-dev Section: libdevel Architecture: @CUDA_ARCHITECTURE@ +Build-Profiles: Multi-Arch: same Depends: ${misc:Depends}, diff --git a/dev/tasks/linux-packages/apt/build.sh b/dev/tasks/linux-packages/apt/build.sh index e0a6cdd12e93..d4c6f8fb1abd 100755 --- a/dev/tasks/linux-packages/apt/build.sh +++ b/dev/tasks/linux-packages/apt/build.sh @@ -119,6 +119,15 @@ fi : ${DEB_BUILD_OPTIONS:="parallel=$(nproc)"} # DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} noopt" export DEB_BUILD_OPTIONS +# nvidia-cuda-toolkit may be unavailable (e.g. it was removed from Debian +# forky). Disable the CUDA packages via the pkg.apache-arrow.nocuda build +# profile when it isn't installed. debian/rules disables ARROW_CUDA the +# same way. See GH-50090. +if ! dpkg -l nvidia-cuda-toolkit > /dev/null 2>&1; then + DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES:-} pkg.apache-arrow.nocuda" + export DEB_BUILD_PROFILES + debuild_options+=(-eDEB_BUILD_PROFILES) +fi df -h if [ "${DEBUG:-no}" = "yes" ]; then run debuild "${debuild_options[@]}" "${dpkg_buildpackage_options[@]}" From 2b43fe76c6ee6f2c9fbefebd79f6d9083d8544d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 30 Jun 2026 09:50:12 +0200 Subject: [PATCH 3/3] Remove build.sh conditional check for nvidia-cuda-toolkit and enforce it into debian-forky --- .../apache-arrow/apt/debian-forky/Dockerfile | 5 +++++ dev/tasks/linux-packages/apache-arrow/debian/control.in | 5 +++-- dev/tasks/linux-packages/apt/build.sh | 9 --------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile b/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile index 0f679f0388a6..0302516d7f75 100644 --- a/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile +++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-forky/Dockerfile @@ -88,3 +88,8 @@ RUN \ apt install -y -V ${quiet} nvidia-cuda-toolkit; \ fi && \ apt clean + +# nvidia-cuda-toolkit was removed from Debian forky amd64, so disable the +# CUDA packages via the pkg.apache-arrow.nocuda build profile.See GH-50090. +# Once nvidia-cuda-toolkit is re-added to Debian forky, this can be removed. +ENV DEB_BUILD_PROFILES=pkg.apache-arrow.nocuda diff --git a/dev/tasks/linux-packages/apache-arrow/debian/control.in b/dev/tasks/linux-packages/apache-arrow/debian/control.in index 3b0ccc75054a..5434a21252d8 100644 --- a/dev/tasks/linux-packages/apache-arrow/debian/control.in +++ b/dev/tasks/linux-packages/apache-arrow/debian/control.in @@ -31,8 +31,9 @@ Build-Depends: ninja-build, nlohmann-json-dev | nlohmann-json3-dev, # nvidia-cuda-toolkit may be unavailable (e.g. removed from Debian forky). -# apt/build.sh enables the pkg.apache-arrow.nocuda profile in that case so -# this build dependency and the CUDA packages below are skipped. +# The pkg.apache-arrow.nocuda build profile (set via DEB_BUILD_PROFILES, e.g. +# in the debian-forky Dockerfile) skips this build dependency and the CUDA +# packages below. nvidia-cuda-toolkit [!arm64] , pkg-config, protobuf-compiler, diff --git a/dev/tasks/linux-packages/apt/build.sh b/dev/tasks/linux-packages/apt/build.sh index d4c6f8fb1abd..e0a6cdd12e93 100755 --- a/dev/tasks/linux-packages/apt/build.sh +++ b/dev/tasks/linux-packages/apt/build.sh @@ -119,15 +119,6 @@ fi : ${DEB_BUILD_OPTIONS:="parallel=$(nproc)"} # DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} noopt" export DEB_BUILD_OPTIONS -# nvidia-cuda-toolkit may be unavailable (e.g. it was removed from Debian -# forky). Disable the CUDA packages via the pkg.apache-arrow.nocuda build -# profile when it isn't installed. debian/rules disables ARROW_CUDA the -# same way. See GH-50090. -if ! dpkg -l nvidia-cuda-toolkit > /dev/null 2>&1; then - DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES:-} pkg.apache-arrow.nocuda" - export DEB_BUILD_PROFILES - debuild_options+=(-eDEB_BUILD_PROFILES) -fi df -h if [ "${DEBUG:-no}" = "yes" ]; then run debuild "${debuild_options[@]}" "${dpkg_buildpackage_options[@]}"