diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 9bfad162e50..5e7d02bbedf 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -22,11 +22,29 @@ cd "${package_dir}" sccache --stop-server 2>/dev/null || true rapids-logger "Building '${package_name}' wheel" + +RAPIDS_PIP_WHEEL_ARGS=( + -w dist + -v + --no-deps + --disable-pip-version-check +) + +# Only use --build-constraint when build isolation is enabled. +# +# Passing '--build-constraint' and '--no-build-isolation` together results in an error from 'pip', +# but we want to keep environment variable PIP_CONSTRAINT set unconditionally. +# PIP_NO_BUILD_ISOLATION=0 means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/573 +if [[ "${PIP_NO_BUILD_ISOLATION:-}" != "0" ]]; then + RAPIDS_PIP_WHEEL_ARGS+=(--build-constraint="${PIP_CONSTRAINT}") +fi + +# unset PIP_CONSTRAINT (set by rapids-init-pip)... it doesn't affect builds as of pip 25.3, and +# results in an error from 'pip wheel' when set and --build-constraint is also passed +unset PIP_CONSTRAINT + rapids-telemetry-record build-${package_name}.log rapids-pip-retry wheel \ - -w dist \ - -v \ - --no-deps \ - --disable-pip-version-check \ + "${RAPIDS_PIP_WHEEL_ARGS[@]}" \ . rapids-telemetry-record sccache-stats-${package_name}.txt sccache --show-adv-stats diff --git a/ci/build_wheel_cudf.sh b/ci/build_wheel_cudf.sh index d76e9fc7d91..f5590da8903 100755 --- a/ci/build_wheel_cudf.sh +++ b/ci/build_wheel_cudf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,8 +13,8 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")" # Downloads libcudf and pylibcudf wheels from this current build, # then ensures 'cudf' wheel builds always use the 'libcudf' and 'pylibcudf' just built in the same CI run. # -# Using env variable PIP_CONSTRAINT (initialized by 'rapids-init-pip') is necessary to ensure the constraints -# are used when creating the isolated build environment. +# env variable 'PIP_CONSTRAINT' is set up by rapids-init-pip. It constrains all subsequent +# 'pip install', 'pip download', etc. calls (except those used in 'pip wheel', handled separately in build scripts) LIBCUDF_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp) PYLIBCUDF_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="pylibcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python) echo "libcudf-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUDF_WHEELHOUSE}/libcudf_*.whl)" >> "${PIP_CONSTRAINT}" diff --git a/ci/build_wheel_pylibcudf.sh b/ci/build_wheel_pylibcudf.sh index c90dae0ca43..c0fc56b125a 100755 --- a/ci/build_wheel_pylibcudf.sh +++ b/ci/build_wheel_pylibcudf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,8 +13,8 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")" # Downloads libcudf wheel from this current build, # then ensures 'pylibcudf' wheel builds always use the 'libcudf' just built in the same CI run. # -# Using env variable PIP_CONSTRAINT (initialized by 'rapids-init-pip') is necessary to ensure the constraints -# are used when creating the isolated build environment. +# env variable 'PIP_CONSTRAINT' is set up by rapids-init-pip. It constrains all subsequent +# 'pip install', 'pip download', etc. calls (except those used in 'pip wheel', handled separately in build scripts) LIBCUDF_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcudf_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp) echo "libcudf-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUDF_WHEELHOUSE}/libcudf_*.whl)" >> "${PIP_CONSTRAINT}"