Codesign: Attempt to make macOS codesign more reliable
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 12 Feb 2020 17:57:07 +0000 (18:57 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 12 Feb 2020 17:57:57 +0000 (18:57 +0100)
Is still sometimes .ready file appears prior to an actual archive.

build_files/buildbot/codesign/archive_with_indicator.py

index d417d4560d6b746a3bc2049f1a9858a81fec64a3..ad3fe1c6ac7db23dc431047c65c8e66045b6f5c2 100644 (file)
@@ -72,7 +72,15 @@ class ArchiveWithIndicator:
 
     def is_ready(self) -> bool:
         """Check whether the archive is ready for access."""
-        return self.ready_indicator_filepath.exists()
+        if not self.ready_indicator_filepath.exists():
+            return False
+        # Sometimes on macOS indicator file appears prior to the actual archive
+        # despite the order of creation and os.sync() used in tag_ready().
+        # So consider archive not ready if there is an indicator without an
+        # actual archive.
+        if not self.archive_filepath.exists():
+            return False
+        return True
 
     def tag_ready(self) -> None:
         """