From 850a0447262cfb6baaf4bb6955df5c95eef23271 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 90609127eba1..a11ae178c040 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -208,6 +208,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 }