Skip to content

Commit 84d669d

Browse files
Niles Rogofffacebook-github-bot
authored andcommitted
Migrate bistro to getdeps
Summary: This took a lot of cmake fuckery. I am guessing it will break the current travis-ci.org based build, since it no longer downloads gflags. As I put this diff up, mvfst (a dependency of quic (a dependency of proxygen)) is not building right now due to another diff - a fix is in progress but isn't landed yet. I applied the fix locally for the test plan, but didn't include it in the diff. Reviewed By: snarkmaster Differential Revision: D25651851 fbshipit-source-id: b4f15ac7fa5293123710fe367c20d355c0970c42
1 parent eae21fc commit 84d669d

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

build/fbcode_builder/getdeps/builder.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,44 @@ def _build(self, install_dirs, reconfigure):
263263
self._run_cmd(install_cmd, env=env)
264264

265265

266+
class BistroBuilder(BuilderBase):
267+
def _build(self, install_dirs, reconfigure):
268+
p = os.path.join(self.src_dir, "bistro", "bistro")
269+
env = self._compute_env(install_dirs)
270+
env["PATH"] = env["PATH"] + ":" + os.path.join(p, "bin")
271+
env["TEMPLATES_PATH"] = os.path.join(p, "include", "thrift", "templates")
272+
self._run_cmd(
273+
[
274+
os.path.join(".", "cmake", "run-cmake.sh"),
275+
"Release",
276+
"-DCMAKE_INSTALL_PREFIX=" + self.inst_dir,
277+
],
278+
cwd=p,
279+
env=env,
280+
)
281+
self._run_cmd(
282+
[
283+
"make",
284+
"install",
285+
"-j",
286+
str(self.build_opts.num_jobs),
287+
],
288+
cwd=os.path.join(p, "cmake", "Release"),
289+
env=env,
290+
)
291+
292+
def run_tests(
293+
self, install_dirs, schedule_type, owner, test_filter, retry, no_testpilot
294+
):
295+
env = self._compute_env(install_dirs)
296+
build_dir = os.path.join(self.src_dir, "bistro", "bistro", "cmake", "Release")
297+
self._run_cmd(
298+
["ctest", build_dir],
299+
cwd=build_dir,
300+
env=env,
301+
)
302+
303+
266304
class CMakeBuilder(BuilderBase):
267305
MANUAL_BUILD_SCRIPT = """\
268306
#!{sys.executable}

build/fbcode_builder/getdeps/manifest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Boost,
1414
CargoBuilder,
1515
CMakeBuilder,
16+
BistroBuilder,
1617
Iproute2Builder,
1718
MakeBuilder,
1819
NinjaBootstrap,
@@ -462,6 +463,16 @@ def create_builder( # noqa:C901
462463
args = self.get_section_as_args("b2.args", ctx)
463464
return Boost(build_options, ctx, self, src_dir, build_dir, inst_dir, args)
464465

466+
if builder == "bistro":
467+
return BistroBuilder(
468+
build_options,
469+
ctx,
470+
self,
471+
src_dir,
472+
build_dir,
473+
inst_dir,
474+
)
475+
465476
if builder == "cmake":
466477
defines = self.get_section_as_dict("cmake.defines", ctx)
467478
return CMakeBuilder(

build/fbcode_builder/manifests/bistro

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[manifest]
2+
name = bistro
3+
fbsource_path = fbcode/bistro
4+
shipit_project = bistro
5+
shipit_fbcode_builder = true
6+
7+
[git]
8+
repo_url = https://github.com/facebook/bistro.git
9+
10+
[build]
11+
builder = bistro
12+
13+
[dependencies]
14+
fmt
15+
folly
16+
proxygen
17+
fbthrift
18+
libsodium
19+
googletest_1_8
20+
sqlite3
21+
22+
[shipit.pathmap]
23+
fbcode/bistro/public_tld = .
24+
fbcode/bistro = bistro

0 commit comments

Comments
 (0)