From 280939b5c9aabf2ff4207a687c4290a724947d08 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:21:10 +0800 Subject: [PATCH] [Build] Support to use loosen version when failed to install python packages (#14013) Why I did it [Build] Support to use loosen version when failed to install python packages It is to fix the issue #14012 How I did it Try to use the installation command without constraint How to verify it --- src/sonic-build-hooks/scripts/buildinfo_base.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 712c43baa3..4c94eaf0aa 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -183,6 +183,11 @@ run_pip_command() $REAL_COMMAND "${parameters[@]}" local result=$? + if [ "$result" != 0 ]; then + echo "Failed to run the command with constraint, try to install with the original command" 1>&2 + $REAL_COMMAND "$@" + result=$? + fi rm $tmp_version_file return $result }