summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2016-08-16 11:41:36 +1000
committerMartin Thomson <martin.thomson@gmail.com>2016-08-16 11:41:36 +1000
commitd2fae95fa33c13679d5115c7e118e2f13a335bba (patch)
tree25f2d9e2d09441ac9af6c8da3cb2134cab4d30dd
parenta5f0c2ac4e84f3dbd74b8824b1ac2c3c931a9e0c (diff)
downloadnss-hg-d2fae95fa33c13679d5115c7e118e2f13a335bba.tar.gz
Bug 1294604 - Make checkout more robust, r=franziskusNSS_3_27_BETA1
-rw-r--r--automation/taskcluster/graph/windows/_build_base.yml2
-rwxr-xr-xautomation/taskcluster/scripts/build.sh10
-rw-r--r--automation/taskcluster/scripts/tools.sh13
-rw-r--r--automation/taskcluster/windows/build.sh8
-rw-r--r--automation/taskcluster/windows/setup.sh15
5 files changed, 36 insertions, 12 deletions
diff --git a/automation/taskcluster/graph/windows/_build_base.yml b/automation/taskcluster/graph/windows/_build_base.yml
index 2ba95846b..a75a7a1af 100644
--- a/automation/taskcluster/graph/windows/_build_base.yml
+++ b/automation/taskcluster/graph/windows/_build_base.yml
@@ -21,7 +21,7 @@ task:
expires: !from_now 24
command:
- - "hg clone -r %NSS_HEAD_REVISION% %NSS_HEAD_REPOSITORY% nss"
+ - "bash -c \"hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss || (sleep 2; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss) || (sleep 5; hg clone -r $NSS_HEAD_REVISION $NSS_HEAD_REPOSITORY nss)\""
- "bash -c nss/automation/taskcluster/windows/build.sh"
env:
diff --git a/automation/taskcluster/scripts/build.sh b/automation/taskcluster/scripts/build.sh
index f48cb20dc..a6a202164 100755
--- a/automation/taskcluster/scripts/build.sh
+++ b/automation/taskcluster/scripts/build.sh
@@ -2,9 +2,9 @@
set -v -e -x
-if [ $(id -u) = 0 ]; then
- source $(dirname $0)/tools.sh
+source $(dirname $0)/tools.sh
+if [[ $(id -u) -eq 0 ]]; then
# Set compiler.
switch_compilers
@@ -13,12 +13,10 @@ if [ $(id -u) = 0 ]; then
fi
# Clone NSPR if needed.
-if [ ! -d "nspr" ]; then
- hg clone https://hg.mozilla.org/projects/nspr
-fi
+hg_clone https://hg.mozilla.org/projects/nspr nspr default
# Build.
-cd nss && make nss_build_all && cd ..
+make -C nss nss_build_all
# Generate certificates.
NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" $(dirname $0)/run_tests.sh
diff --git a/automation/taskcluster/scripts/tools.sh b/automation/taskcluster/scripts/tools.sh
index 1c2bf103e..57f45d6be 100644
--- a/automation/taskcluster/scripts/tools.sh
+++ b/automation/taskcluster/scripts/tools.sh
@@ -14,3 +14,16 @@ switch_compilers() {
exit 1
fi
}
+
+# Usage: hg_clone repo dir [revision=@]
+hg_clone() {
+ repo=$1
+ dir=$2
+ rev=${3:-@}
+ for i in 0 2 5; do
+ sleep $i
+ hg clone -r "$rev" "$repo" "$dir" && return
+ rm -rf "$dir"
+ done
+ exit 1
+}
diff --git a/automation/taskcluster/windows/build.sh b/automation/taskcluster/windows/build.sh
index 479405694..c275df54d 100644
--- a/automation/taskcluster/windows/build.sh
+++ b/automation/taskcluster/windows/build.sh
@@ -6,16 +6,16 @@ set -v -e -x
source $(dirname $0)/setup.sh
# Clone NSPR.
-hg clone https://hg.mozilla.org/projects/nspr
+hg_clone https://hg.mozilla.org/projects/nspr nspr default
# Build.
-cd nss && make nss_build_all
+make -C nss nss_build_all
# Generate certificates.
-cd tests && NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" ./all.sh
+NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" nss/tests/all.sh
# Reset test counter so that test runs pick up our certificates.
-cd ../../ && echo 1 > tests_results/security/localhost
+echo 1 > tests_results/security/localhost
# Package.
7z a public/build/dist.7z dist tests_results
diff --git a/automation/taskcluster/windows/setup.sh b/automation/taskcluster/windows/setup.sh
index 3d91b63c6..80cee2850 100644
--- a/automation/taskcluster/windows/setup.sh
+++ b/automation/taskcluster/windows/setup.sh
@@ -2,7 +2,20 @@
set -v -e -x
-hg clone https://hg.mozilla.org/build/tools
+# Usage: hg_clone repo dir [revision=@]
+hg_clone() {
+ repo=$1
+ dir=$2
+ rev=${3:-@}
+ for i in 0 2 5; do
+ sleep $i
+ hg clone -r "$rev" "$repo" "$dir" && return
+ rm -rf "$dir"
+ done
+ exit 1
+}
+
+hg_clone https://hg.mozilla.org/build/tools tools default
tools/scripts/tooltool/tooltool_wrapper.sh $(dirname $0)/releng.manifest https://api.pub.build.mozilla.org/tooltool/ non-existant-file.sh /c/mozilla-build/python/python.exe /c/builds/tooltool.py --authentication-file /c/builds/relengapi.tok -c /c/builds/tooltool_cache
VSPATH="$(pwd)/vs2015u2"