Skip to content

Commit

Permalink
[facebook#38] Clone build config as build config base
Browse files Browse the repository at this point in the history
These two build config need adjustments for a system build:
- Add sudo to 'make install'
- Update ldconfig after build

For better traceability start from the fbcode_builder configs.
  • Loading branch information
butjar committed Mar 25, 2019
1 parent 2ff9388 commit 7959d2c
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
82 changes: 82 additions & 0 deletions build/debian_system_fbcode_builder_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env python

#
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

from __future__ import absolute_import, division, print_function, unicode_literals

import specs.fbthrift as fbthrift
import specs.fbzmq as fbzmq
import specs.folly as folly
import specs.re2 as re2
from shell_quoting import ShellQuoted, path_join


"fbcode_builder steps to build & test Openr"


def fbcode_builder_spec(builder):
builder.add_option("thom311/libnl:git_hash", "libnl3_2_25")
builder.add_option("openr/openr/build:cmake_defines", {"ADD_ROOT_TESTS": "OFF"})
maybe_curl_patch = []
patch = path_join(
builder.option("projects_dir"),
"../shipit_projects/openr/build/fix-route-obj-attr-list.patch",
)

if not builder.has_option("shipit_project_dir"):
maybe_curl_patch = [
builder.run(
ShellQuoted(
"curl -O https://raw.githubusercontent.com/facebook/openr/master/"
"build/fix-route-obj-attr-list.patch"
)
)
]
patch = "fix-route-obj-attr-list.patch"
libnl_build_commands = maybe_curl_patch + [
builder.run(ShellQuoted("git apply {p}").format(p=patch)),
builder.run(ShellQuoted("./autogen.sh")),
builder.configure(),
builder.make_and_install(),
]

return {
"depends_on": [folly, fbthrift, fbzmq, re2],
"steps": [
builder.github_project_workdir("thom311/libnl", "."),
builder.step("Build and install thom311/libnl", libnl_build_commands),
builder.fb_github_project_workdir("openr/openr/build", "facebook"),
builder.step(
"Build and install openr/openr/build",
[
builder.cmake_configure("openr/openr/build"),
# we need the pythonpath to find the thrift compiler
builder.run(
ShellQuoted(
'PYTHONPATH="$PYTHONPATH:"{p}/lib/python2.7/site-packages '
"make -j {n}"
).format(
p=builder.option("prefix"),
n=builder.option("make_parallelism"),
)
),
builder.run(ShellQuoted("make install")),
],
),
builder.step(
"Run openr tests",
[builder.run(ShellQuoted("CTEST_OUTPUT_ON_FAILURE=TRUE make test"))],
),
],
}


config = {
"github_project": "facebook/openr",
"fbcode_builder_spec": fbcode_builder_spec,
}
40 changes: 40 additions & 0 deletions build/fbcode_builder/specs/debian_system_fbzmq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import specs.fbthrift as fbthrift
import specs.folly as folly
import specs.gmock as gmock
import specs.sodium as sodium
import specs.sigar as sigar

from shell_quoting import ShellQuoted


def fbcode_builder_spec(builder):
builder.add_option('zeromq/libzmq:git_hash', 'v4.2.5')
return {
'depends_on': [folly, fbthrift, gmock, sodium, sigar],
'steps': [
builder.github_project_workdir('zeromq/libzmq', '.'),
builder.step('Build and install zeromq/libzmq', [
builder.run(ShellQuoted('./autogen.sh')),
builder.configure(),
builder.make_and_install(),
]),

builder.fb_github_project_workdir('fbzmq/fbzmq/build', 'facebook'),
builder.step('Build and install fbzmq/fbzmq/build', [
builder.cmake_configure('fbzmq/fbzmq/build'),
# we need the pythonpath to find the thrift compiler
builder.run(ShellQuoted(
'PYTHONPATH="$PYTHONPATH:"{p}/lib/python2.7/site-packages '
'make -j {n}'
).format(p=builder.option('prefix'), n=builder.option('make_parallelism'))),
builder.run(ShellQuoted('make install')),
]),
],
}

0 comments on commit 7959d2c

Please sign in to comment.