From 63ced84d983d0777ccf9ea3b87c0e7e546568182 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 1756eb84db3c..b702a2dbc101 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -217,6 +217,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 }