1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

fbcode_builder: getdeps: add LFS caching for ArchiveFetcher

Summary:
When running in FB infra, prefer to download from our local LFS
server rather than going out to the internet.

Fall back to a normal internet download if the LFS get fails for some reason.

Upload to LFS after successfully verifying the hash for the downloaded archive.

Add a subcommand that performs a fetch for all possible platforms so that it
is easier to ensure that the lfs-pointers file is up to date.

Reviewed By: simpkins

Differential Revision: D14978660

fbshipit-source-id: 240fc32fc7003d1e06c88b80d85054dae36e2f31
This commit is contained in:
Wez Furlong
2019-05-03 15:52:39 -07:00
committed by Facebook Github Bot
parent 5879f91323
commit 7919050c9a
2 changed files with 19 additions and 5 deletions

View File

@@ -329,9 +329,20 @@ class ManifestParser(object):
url = self.get("download", "url", ctx=ctx)
if url:
return ArchiveFetcher(
build_options, self, url, self.get("download", "sha256", ctx=ctx)
)
# We need to defer this import until now to avoid triggering
# a cycle when the facebook/__init__.py is loaded.
try:
from getdeps.facebook.lfs import LFSCachingArchiveFetcher
return LFSCachingArchiveFetcher(
build_options, self, url, self.get("download", "sha256", ctx=ctx)
)
except ImportError:
# This FB internal module isn't shippped to github,
# so just use its base class
return ArchiveFetcher(
build_options, self, url, self.get("download", "sha256", ctx=ctx)
)
raise KeyError(
"project %s has no fetcher configuration matching %r" % (self.name, ctx)