diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index a59b04248c..d4887e7c48 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -66,31 +66,30 @@ rapids-logger "Building '${package_name}' wheel" sccache --stop-server 2>/dev/null || true +build_env_dir="/tmp/${package_name}-wheel-build-env" +# `build` preserves this environment after a failed build for debugging. CI +# retries must start with an empty directory, as required by `--env-dir`. +rm -rf "${build_env_dir}" + RAPIDS_PIP_WHEEL_ARGS=( - -w dist - -v - --no-deps - --disable-pip-version-check + --wheel + --outdir dist + --verbose + # A fixed location keeps isolated-build include paths stable for sccache. + --env-dir "${build_env_dir}" + --dependency-constraints-txt "${PIP_CONSTRAINT}" ) # Add py-api setting for stable ABI builds if [[ "${stable_abi}" == "true" ]] && [[ -n "${RAPIDS_PY_API:-}" ]]; then - RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}") -fi - -# 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/5735) -if [[ "${PIP_NO_BUILD_ISOLATION:-}" != "0" ]]; then - RAPIDS_PIP_WHEEL_ARGS+=(--build-constraint="${PIP_CONSTRAINT}") + RAPIDS_PIP_WHEEL_ARGS+=(--config-setting="skbuild.wheel.py-api=${RAPIDS_PY_API}") 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 +# `build` receives the same generated constraints explicitly. Unset the +# environment variable so it does not constrain the frontend installation. unset PIP_CONSTRAINT -rapids-pip-retry wheel \ + +rapids-python-build-retry \ "${RAPIDS_PIP_WHEEL_ARGS[@]}" \ . diff --git a/ci/build_wheel_cuvs.sh b/ci/build_wheel_cuvs.sh index 2acbab8a2d..0732c2973d 100755 --- a/ci/build_wheel_cuvs.sh +++ b/ci/build_wheel_cuvs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -14,7 +14,8 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")" # then ensures 'cuvs' wheel builds always use the 'libcuvs' just built in the same CI run. # # 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) +# 'pip install', 'pip download', etc. calls (except the isolated wheel build, +# which is handled separately by ci/build_wheel.sh) LIBCUVS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuvs cuvs --cuda "$RAPIDS_CUDA_VERSION")") echo "libcuvs-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo "${LIBCUVS_WHEELHOUSE}"/libcuvs_*.whl)" >> "${PIP_CONSTRAINT}" diff --git a/ci/build_wheel_libcuvs.sh b/ci/build_wheel_libcuvs.sh index e012935749..bb521b988d 100755 --- a/ci/build_wheel_libcuvs.sh +++ b/ci/build_wheel_libcuvs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -25,10 +25,6 @@ rapids-pip-retry install \ --prefer-binary \ -r /tmp/requirements-build.txt -# build with '--no-build-isolation', for better sccache hit rate -# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) -export PIP_NO_BUILD_ISOLATION=0 - ci/build_wheel.sh libcuvs ${package_dir} ci/validate_wheel.sh ${package_dir} "${RAPIDS_WHEEL_BLD_OUTPUT_DIR}"