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

fbcode_builder: getdeps: fboss: OpenBCM depends on git-lfs

Summary:
OpenBCM libraries are stored with git LFS. As a result, fetcher fetches LFS pointers and not the contents. Use git-lfs to pull the real contents before copying to install dir using NoopBuilder.
In future, if more builders require git-lfs, we would consider installing
git-lfs as part of the sandcastle infra as against repeating similar
 logic for each builder that requires git-lfs.

Reviewed By: wez

Differential Revision: D18759806

fbshipit-source-id: f988a0460107bc0685e7aba107daba9ed88f71e7
This commit is contained in:
Shrikrishna Khare
2019-12-03 11:40:27 -08:00
committed by Facebook Github Bot
parent dd6348ab5d
commit 3a2cd95655
3 changed files with 31 additions and 1 deletions

View File

@@ -723,6 +723,26 @@ class NopBuilder(BuilderBase):
shutil.copytree(self.src_dir, self.inst_dir) shutil.copytree(self.src_dir, self.inst_dir)
class OpenBCMBuilder(NopBuilder):
# OpenBCM libraries are stored with git LFS. As a result, fetcher fetches
# LFS pointers and not the contents. Use git-lfs to pull the real contents
# before copying to install dir using NoopBuilder.
# In future, if more builders require git-lfs, we would consider installing
# git-lfs as part of the sandcastle infra as against repeating similar
# logic for each builder that requires git-lfs.
def __init__(self, build_opts, ctx, manifest, src_dir, inst_dir):
super(OpenBCMBuilder, self).__init__(
build_opts, ctx, manifest, src_dir, inst_dir
)
def build(self, install_dirs, reconfigure):
env = self._compute_env(install_dirs)
self._run_cmd(["git", "lfs", "install", "--local"], cwd=self.src_dir, env=env)
self._run_cmd(["git", "lfs", "pull"], cwd=self.src_dir, env=env)
super(OpenBCMBuilder, self).build(install_dirs, reconfigure)
class SqliteBuilder(BuilderBase): class SqliteBuilder(BuilderBase):
def __init__(self, build_opts, ctx, manifest, src_dir, build_dir, inst_dir): def __init__(self, build_opts, ctx, manifest, src_dir, build_dir, inst_dir):
super(SqliteBuilder, self).__init__( super(SqliteBuilder, self).__init__(

View File

@@ -18,6 +18,7 @@ from .builder import (
MakeBuilder, MakeBuilder,
NinjaBootstrap, NinjaBootstrap,
NopBuilder, NopBuilder,
OpenBCMBuilder,
OpenSSLBuilder, OpenSSLBuilder,
SqliteBuilder, SqliteBuilder,
) )
@@ -424,6 +425,9 @@ class ManifestParser(object):
build_options, ctx, self, src_dir, build_dir, inst_dir, build_doc build_options, ctx, self, src_dir, build_dir, inst_dir, build_doc
) )
if builder == "OpenBCM":
return OpenBCMBuilder(build_options, ctx, self, src_dir, inst_dir)
raise KeyError("project %s has no known builder" % (self.name)) raise KeyError("project %s has no known builder" % (self.name))

View File

@@ -4,9 +4,15 @@ name = OpenBCM
[git] [git]
repo_url = https://github.com/Broadcom-Network-Switching-Software/OpenBCM.git repo_url = https://github.com/Broadcom-Network-Switching-Software/OpenBCM.git
[build] [build.os=linux]
builder = OpenBCM
[build.not(os=linux)]
builder = nop builder = nop
[dependencies]
git-lfs
[install.files] [install.files]
lib/x86-64 = lib lib/x86-64 = lib
include = include include = include