Commit b0ec3021 authored by Shrikrishna Khare's avatar Shrikrishna Khare Committed by Facebook Github Bot

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
parent bbe672fe
......@@ -723,6 +723,26 @@ class NopBuilder(BuilderBase):
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):
def __init__(self, build_opts, ctx, manifest, src_dir, build_dir, inst_dir):
super(SqliteBuilder, self).__init__(
......
......@@ -18,6 +18,7 @@ from .builder import (
MakeBuilder,
NinjaBootstrap,
NopBuilder,
OpenBCMBuilder,
OpenSSLBuilder,
SqliteBuilder,
)
......@@ -424,6 +425,9 @@ class ManifestParser(object):
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))
......
......@@ -4,9 +4,15 @@ name = 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
[dependencies]
git-lfs
[install.files]
lib/x86-64 = lib
include = include
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment