From ab185263fa43141ff325edb8dace25f99e685c3d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 29 Jun 2021 17:45:13 -0400 Subject: SL-15500: Install git-hooks (and requirements) and run policy check on the entire current (branch of the) viewer repo before starting any build. --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 3b0cf97731..e059af4ded 100755 --- a/build.sh +++ b/build.sh @@ -280,6 +280,12 @@ python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel} initialize_version # provided by buildscripts build.sh; sets version id +# install the git-hooks dependencies +pip_install -r "$git_hooks_checkout/requirements.txt" +# validate the branch we're about to build +python_cmd "$git_hooks_checkout/coding_policy_git.py" --all_files || \ + fatal "coding policy check failed" + # Now run the build succeeded=true last_built_variant= -- cgit v1.2.3 From 0276a325695f513df045ca5ffd97df478b23a95d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 29 Jun 2021 18:04:03 -0400 Subject: SL-15500: Use plain pip install, not pip_install shell function. pip_install doesn't know about the '-r requirements.txt' feature. --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index e059af4ded..24090dd747 100755 --- a/build.sh +++ b/build.sh @@ -281,7 +281,8 @@ python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel} initialize_version # provided by buildscripts build.sh; sets version id # install the git-hooks dependencies -pip_install -r "$git_hooks_checkout/requirements.txt" +pip install -r "$git_hooks_checkout/requirements.txt" || \ + fatal "pip install git-hooks failed" # validate the branch we're about to build python_cmd "$git_hooks_checkout/coding_policy_git.py" --all_files || \ fatal "coding policy check failed" -- cgit v1.2.3 From d2de2f9d252be32b262b929fe7565729417d789b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 30 Jun 2021 08:11:30 -0400 Subject: SL-15500: Always have to work around Windows path incompatibilities. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 24090dd747..64aa402fae 100755 --- a/build.sh +++ b/build.sh @@ -281,7 +281,7 @@ python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel} initialize_version # provided by buildscripts build.sh; sets version id # install the git-hooks dependencies -pip install -r "$git_hooks_checkout/requirements.txt" || \ +pip install -r "$(native_path "$git_hooks_checkout/requirements.txt")" || \ fatal "pip install git-hooks failed" # validate the branch we're about to build python_cmd "$git_hooks_checkout/coding_policy_git.py" --all_files || \ -- cgit v1.2.3 From 6460b7ac419021ca998c5f849ad382423599fc58 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 30 Jun 2021 09:48:02 -0400 Subject: SL-15500: Only run coding_policy_git.py on Mac since it fails on Windows due to some problem in the underlying library. Also wrap the coding policy checks in a TC log subsection. --- build.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 64aa402fae..961d1df30d 100755 --- a/build.sh +++ b/build.sh @@ -280,12 +280,21 @@ python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel} initialize_version # provided by buildscripts build.sh; sets version id -# install the git-hooks dependencies -pip install -r "$(native_path "$git_hooks_checkout/requirements.txt")" || \ - fatal "pip install git-hooks failed" -# validate the branch we're about to build -python_cmd "$git_hooks_checkout/coding_policy_git.py" --all_files || \ - fatal "coding policy check failed" +begin_section "coding policy check" +# On our TC Windows build hosts, the GitPython library underlying our +# coding_policy_git.py script fails to run git for reasons we have not tried +# to diagnose. Clearly git works fine on those hosts, or we would never get +# this far. Running coding policy checks on one platform *should* suffice... +if [[ "$arch" == "Darwin" ]] +then + # install the git-hooks dependencies + pip install -r "$(native_path "$git_hooks_checkout/requirements.txt")" || \ + fatal "pip install git-hooks failed" + # validate the branch we're about to build + python_cmd "$git_hooks_checkout/coding_policy_git.py" --all_files || \ + fatal "coding policy check failed" +fi +end_section "coding policy check" # Now run the build succeeded=true -- cgit v1.2.3 From e3c256bdafeb239818c824025c4cdd984fe9cdd6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 13 Jul 2021 14:55:11 +0100 Subject: SL-15572 - retry logic for codeticket.py commands --- build.sh | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 05866d2c8a..1b6dd17a4a 100755 --- a/build.sh +++ b/build.sh @@ -16,6 +16,29 @@ # * The special style in which python is invoked is intentional to permit # use of a native python install on windows - which requires paths in DOS form +retry_cmd() +{ + max_attempts="$1"; shift + initial_wait="$1"; shift + attempt_num=1 + echo "trying" "$@" + until "$@" + do + if ((attempt_num==max_attempts)) + then + echo "Last attempt $attempt_num failed" + return 1 + else + wait_time=$(($attempt_num*$initial_wait)) + echo "Attempt $attempt_num failed. Trying again in $wait_time seconds..." + sleep $wait_time + attempt_num=$(($attempt_num+1)) + fi + done + echo "succeeded" + return 0 +} + build_dir_Darwin() { echo build-darwin-x86_64 @@ -463,7 +486,7 @@ then succeeded=$build_coverity else # Upload base package. - python_cmd "$helpers/codeticket.py" addoutput Installer "$package" \ + retry_cmd 4 30 python_cmd "$helpers/codeticket.py" addoutput Installer "$package" \ || fatal "Upload of installer failed" wait_for_codeticket @@ -473,7 +496,7 @@ then package=$(installer_$arch "$package_id") if [ x"$package" != x ] then - python_cmd "$helpers/codeticket.py" addoutput "Installer $package_id" "$package" \ + retry_cmd 4 30 python_cmd "$helpers/codeticket.py" addoutput "Installer $package_id" "$package" \ || fatal "Upload of installer $package_id failed" wait_for_codeticket else @@ -487,7 +510,7 @@ then if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then # Upload crash reporter file - python_cmd "$helpers/codeticket.py" addoutput "Symbolfile" "$VIEWER_SYMBOL_FILE" \ + retry_cmd 4 30 python_cmd "$helpers/codeticket.py" addoutput "Symbolfile" "$VIEWER_SYMBOL_FILE" \ || fatal "Upload of symbolfile failed" wait_for_codeticket fi @@ -497,10 +520,7 @@ then if [ -r "$build_dir/llphysicsextensions_package" ] then llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package) - # This next upload is a frequent failure; see if giving the last one some time helps - # JJ is making changes to Codeticket that we hope will eliminate this failure soon - sleep 300 - python_cmd "$helpers/codeticket.py" addoutput "Physics Extensions Package" "$llphysicsextensions_package" --private \ + retry_cmd 4 30 python_cmd "$helpers/codeticket.py" addoutput "Physics Extensions Package" "$llphysicsextensions_package" --private \ || fatal "Upload of physics extensions package failed" fi fi -- cgit v1.2.3