From cdec438683bedb4d9cabc95abf711125694a8138 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 22 Jan 2014 16:44:34 -0500 Subject: add retries around OSX codesign to try to work around frequent build farm failures --- indra/newview/viewer_manifest.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 9a617c2a13..bf19722a82 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL +from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError try: from llbase import llsd except ImportError: @@ -818,11 +818,27 @@ class Darwin_i386_Manifest(ViewerManifest): keychain_pwd = open(keychain_pwd_path).read().rstrip() self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) - self.run_command('codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { - 'home_path' : home_path, - 'identity': identity, - 'bundle': self.get_dst_prefix() - }) + signed=False + sign_attempts=3 + sign_retry_wait=15 + while (not signed) and (sign_attempts > 0): + try: + sign_attempts-=1; + self.run_command( + 'codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { + 'home_path' : home_path, + 'identity': identity, + 'bundle': self.get_dst_prefix() + }) + signed=True # if no exception was raised, the codesign worked + except ManifestError, err: + if sign_attempts: + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" + time.sleep(sign_retry_wait) + sign_retry_wait*=2 + else: + print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + raise imagename="SecondLife_" + '_'.join(self.args['version']) -- cgit v1.2.3 From cec62b7872db7a9ca52e3872b96bf36f6e271f77 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 24 Jan 2014 16:39:00 -0500 Subject: fix error message python boo-boo --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index bf19722a82..96b4c7268c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -833,7 +833,7 @@ class Darwin_i386_Manifest(ViewerManifest): signed=True # if no exception was raised, the codesign worked except ManifestError, err: if sign_attempts: - print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait time.sleep(sign_retry_wait) sign_retry_wait*=2 else: -- cgit v1.2.3