sapling/build/fbcode_builder
Shrikrishna Khare 7ddefe5e25 fbcode_builder: getdeps: fboss: add iproute2 fetcher
Summary:
This is towards getting open source FBOSS to build using fbcode_builder.
iproute2 is one of the dependencies for FBOSS. This patch adds a manifest file
to build the specific version of iproute2 needed for FBOSS.

Additionally, the default git clone depth of 100 is insufficient for the
version of iproute2 FBOSS depends on. Thus, this patch extends the git SCHEMA
to add optional argument depth. The default remains 100.

The usual /configure --prefix does not work for iproute2. Thus, we need to add
a custom builder that:
  - copies sources to build directory, builds, and
  - installs to installed directory using DEST_DIR.
  - it must also explicitly copy include from build dir to install dir

Reviewed By: wez

Differential Revision: D15588809

fbshipit-source-id: ac5eab24134e078d88b85b4be433c78b05ef8ce5
2019-06-05 15:35:52 -07:00
..
CMake add fbcode_builder sources 2019-04-26 11:31:58 -07:00
getdeps fbcode_builder: getdeps: fboss: add iproute2 fetcher 2019-06-05 15:35:52 -07:00
manifests fbcode_builder: getdeps: fboss: add iproute2 fetcher 2019-06-05 15:35:52 -07:00
specs enable CMake build (with HTTP/3) 2019-05-19 19:17:18 -07:00
.gitignore add fbcode_builder sources 2019-04-26 11:31:58 -07:00
docker_build_with_ccache.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
docker_builder.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
docker_enable_ipv6.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
fbcode_builder_config.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
fbcode_builder.py add option to pass options to git clone 2019-05-10 13:55:46 -07:00
getdeps.py watchman: fixup FB internal mac packaging 2019-05-20 19:32:38 -07:00
make_docker_context.py update docker os_image to ubuntu18 and gcc7 2019-05-10 16:39:16 -07:00
parse_args.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
README.docker add fbcode_builder sources 2019-04-26 11:31:58 -07:00
README.md update README.md on ubuntu and gcc version 2019-05-27 13:33:44 -07:00
shell_builder.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
shell_quoting.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
travis_docker_build.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
utils.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00

Easy builds for Facebook projects

This is a Python 2.6+ library designed to simplify continuous-integration (and other builds) of Facebook projects.

For external Travis builds, the entry point is travis_docker_build.sh.

Using Docker to reproduce a CI build

If you are debugging or enhancing a CI build, you will want to do so from host or virtual machine that can run a reasonably modern version of Docker:

./make_docker_context.py --help  # See available options for OS & compiler
# Tiny wrapper that starts a Travis-like build with compile caching:
os_image=ubuntu:18.04 \
  gcc_version=7 \
  make_parallelism=2 \
  travis_cache_dir=~/travis_ccache \
    ./travis_docker_build.sh &> build_at_$(date +'%Y%m%d_%H%M%S').log

IMPORTANT: Read fbcode_builder/README.docker before diving in!

Setting travis_cache_dir turns on ccache, saving a fresh copy of ccache.tgz after every build. This will invalidate Docker's layer cache, foring it to rebuild starting right after OS package setup, but the builds will be fast because all the compiles will be cached. To iterate without invalidating the Docker layer cache, just cd /tmp/docker-context-* and interact with the Dockerfile normally. Note that the docker-context-* dirs preserve a copy of ccache.tgz as they first used it.

What to read next

The *.py files are fairly well-documented. You might want to peruse them in this order:

  • shell_quoting.py
  • fbcode_builder.py
  • docker_builder.py
  • make_docker_context.py

As far as runs on Travis go, the control flow is:

  • .travis.yml calls
  • travis_docker_build.sh calls
  • docker_build_with_ccache.sh

This library also has an (unpublished) component targeting Facebook's internal continuous-integration platform using the same build-step DSL.

Contributing

Please follow the ambient style (or PEP-8), and keep the code Python 2.6 compatible -- since fbcode_builder's only dependency is Docker, we want to allow building projects on even fairly ancient base systems. We also wish to be compatible with Python 3, and would appreciate it if you kept that in mind while making changes also.