[Retrace] Compile retrace by R8 with composition

Bug: b/270105162
Bug: b/283881148
Bug: b/281459606
Change-Id: I62e090b29789b3403dc7fb27ca5299958d0b9cbe
diff --git a/tools/utils.py b/tools/utils.py
index c6b0126..4c671b9 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -311,7 +311,9 @@
   return defines.IsOsX()
 
 def EnsureDepFromGoogleCloudStorage(dep, tgz, sha1, msg):
-  if not os.path.exists(dep) or os.path.getmtime(tgz) < os.path.getmtime(sha1):
+  if (not os.path.exists(dep)
+     or not os.path.exists(tgz)
+     or os.path.getmtime(tgz) < os.path.getmtime(sha1)):
     DownloadFromGoogleCloudStorage(sha1)
     # Update the mtime of the tar file to make sure we do not run again unless
     # there is an update.