diff --git a/packaging/post_build_script.sh b/packaging/post_build_script.sh index 5b7414b2f03..7aefa2649e6 100644 --- a/packaging/post_build_script.sh +++ b/packaging/post_build_script.sh @@ -1,5 +1,11 @@ #!/bin/bash -LD_LIBRARY_PATH="/usr/local/lib:$CUDA_HOME/lib64:$LD_LIBRARY_PATH" python packaging/wheel/relocate.py +set -euxo pipefail + +if [ -n "${CUDA_HOME:-}" ]; then + LD_LIBRARY_PATH="/usr/local/lib:${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}" +fi + +python packaging/wheel/relocate.py if [[ "$(uname)" == "Linux" && "$(uname -m)" != "aarch64" ]]; then extra_decoders_channel="--pre --index-url https://download.pytorch.org/whl/nightly/cpu" diff --git a/packaging/pre_build_script.sh b/packaging/pre_build_script.sh index 8f3fed3b4f2..fcacf4bf8a4 100644 --- a/packaging/pre_build_script.sh +++ b/packaging/pre_build_script.sh @@ -36,7 +36,7 @@ else conda install libwebp -y conda install libjpeg-turbo -c pytorch yum install -y freetype gnutls - pip install auditwheel + pip install "auditwheel<6.3.0" fi pip install numpy pyyaml future ninja diff --git a/packaging/wheel/relocate.py b/packaging/wheel/relocate.py index fb110abd873..4587f3798da 100644 --- a/packaging/wheel/relocate.py +++ b/packaging/wheel/relocate.py @@ -15,7 +15,10 @@ # Third party imports if sys.platform == "linux": - from auditwheel.lddtree import lddtree + try: + from auditwheel.lddtree import lddtree + except ImportError: + from auditwheel import lddtree ALLOWLIST = {