mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-05 19:55:47 +03:00
getdeps: fix builds with cached project downloads
Summary: D21364132 accidentally broke this; we can't run the fetcher for projects for which we pulled the build out of cache, because there is no source to update in that case. This commit adjusts the logic so that we write out a marker file to indicate that we installed a build from cache and to look for that file being present to gate the new update logic. Reviewed By: lnicco Differential Revision: D21419122 fbshipit-source-id: 304670848add22531d88549d66f22c40ff255140
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7624f44196
commit
6c378a0eab
@@ -233,6 +233,10 @@ class CachedProject(object):
|
||||
""" We only cache third party projects """
|
||||
return self.cache and self.m.shipit_project is None
|
||||
|
||||
def was_cached(self):
|
||||
cached_marker = os.path.join(self.inst_dir, ".getdeps-cached-build")
|
||||
return os.path.exists(cached_marker)
|
||||
|
||||
def download(self):
|
||||
if self.is_cacheable() and not os.path.exists(self.inst_dir):
|
||||
print("check cache for %s" % self.cache_file_name)
|
||||
@@ -247,6 +251,11 @@ class CachedProject(object):
|
||||
"Extracting %s -> %s..." % (self.cache_file_name, self.inst_dir)
|
||||
)
|
||||
tf.extractall(self.inst_dir)
|
||||
|
||||
cached_marker = os.path.join(self.inst_dir, ".getdeps-cached-build")
|
||||
with open(cached_marker, "w") as f:
|
||||
f.write("\n")
|
||||
|
||||
return True
|
||||
except Exception as exc:
|
||||
print("%s" % str(exc))
|
||||
@@ -471,7 +480,7 @@ class BuildCmd(ProjectCmdBase):
|
||||
cached_project, fetcher, m, built_marker, project_hash
|
||||
)
|
||||
|
||||
if os.path.exists(built_marker):
|
||||
if os.path.exists(built_marker) and not cached_project.was_cached():
|
||||
# We've previously built this. We may need to reconfigure if
|
||||
# our deps have changed, so let's check them.
|
||||
dep_reconfigure, dep_build = self.compute_dep_change_status(
|
||||
|
Reference in New Issue
Block a user