|
1 | 1 | # Easy builds for Facebook projects |
2 | 2 |
|
3 | | -This is a Python 2.6+ library designed to simplify continuous-integration |
4 | | -(and other builds) of Facebook projects. |
| 3 | +This directory contains tools designed to simplify continuous-integration |
| 4 | +(and other builds) of Facebook open source projects. In particular, this helps |
| 5 | +manage builds for cross-project dependencies. |
5 | 6 |
|
6 | | -For external Travis builds, the entry point is `travis_docker_build.sh`. |
| 7 | +The main entry point is the `getdeps.py` script. This script has several |
| 8 | +subcommands, but the most notable is the `build` command. This will download |
| 9 | +and build all dependencies for a project, and then build the project itself. |
7 | 10 |
|
| 11 | +## Deployment |
8 | 12 |
|
9 | | -## Using Docker to reproduce a CI build |
| 13 | +This directory is copied literally into a number of different Facebook open |
| 14 | +source repositories. Any change made to code in this directory will be |
| 15 | +automatically be replicated by our open source tooling into all GitHub hosted |
| 16 | +repositories that use `fbcode_builder`. Typically this directory is copied |
| 17 | +into the open source repositories as `build/fbcode_builder/`. |
10 | 18 |
|
11 | | -If you are debugging or enhancing a CI build, you will want to do so from |
12 | | -host or virtual machine that can run a reasonably modern version of Docker: |
13 | 19 |
|
14 | | -``` sh |
15 | | -./make_docker_context.py --help # See available options for OS & compiler |
16 | | -# Tiny wrapper that starts a Travis-like build with compile caching: |
17 | | -os_image=ubuntu:18.04 \ |
18 | | - gcc_version=7 \ |
19 | | - make_parallelism=2 \ |
20 | | - travis_cache_dir=~/travis_ccache \ |
21 | | - ./travis_docker_build.sh &> build_at_$(date +'%Y%m%d_%H%M%S').log |
22 | | -``` |
| 20 | +# Project Configuration Files |
23 | 21 |
|
24 | | -**IMPORTANT**: Read `fbcode_builder/README.docker` before diving in! |
| 22 | +The `manifests` subdirectory contains configuration files for many different |
| 23 | +projects, describing how to build each project. These files also list |
| 24 | +dependencies between projects, enabling `getdeps.py` to build all dependencies |
| 25 | +for a project before building the project itself. |
25 | 26 |
|
26 | | -Setting `travis_cache_dir` turns on [ccache](https://ccache.samba.org/), |
27 | | -saving a fresh copy of `ccache.tgz` after every build. This will invalidate |
28 | | -Docker's layer cache, foring it to rebuild starting right after OS package |
29 | | -setup, but the builds will be fast because all the compiles will be cached. |
30 | | -To iterate without invalidating the Docker layer cache, just `cd |
31 | | -/tmp/docker-context-*` and interact with the `Dockerfile` normally. Note |
32 | | -that the `docker-context-*` dirs preserve a copy of `ccache.tgz` as they |
33 | | -first used it. |
34 | 27 |
|
| 28 | +# Shared CMake utilities |
35 | 29 |
|
36 | | -# What to read next |
| 30 | +Since this directory is copied into many Facebook open source repositories, |
| 31 | +it is also used to help share some CMake utility files across projects. The |
| 32 | +`CMake/` subdirectory contains a number of `.cmake` files that are shared by |
| 33 | +the CMake-based build systems across several different projects. |
37 | 34 |
|
38 | | -The *.py files are fairly well-documented. You might want to peruse them |
39 | | -in this order: |
40 | | - - shell_quoting.py |
41 | | - - fbcode_builder.py |
42 | | - - docker_builder.py |
43 | | - - make_docker_context.py |
44 | 35 |
|
45 | | -As far as runs on Travis go, the control flow is: |
46 | | - - .travis.yml calls |
47 | | - - travis_docker_build.sh calls |
48 | | - - docker_build_with_ccache.sh |
| 36 | +# Older Build Scripts |
49 | 37 |
|
50 | | -This library also has an (unpublished) component targeting Facebook's |
51 | | -internal continuous-integration platform using the same build-step DSL. |
52 | | - |
53 | | - |
54 | | -# Contributing |
55 | | - |
56 | | -Please follow the ambient style (or PEP-8), and keep the code Python 2.6 |
57 | | -compatible -- since `fbcode_builder`'s only dependency is Docker, we want to |
58 | | -allow building projects on even fairly ancient base systems. We also wish |
59 | | -to be compatible with Python 3, and would appreciate it if you kept that |
60 | | -in mind while making changes also. |
| 38 | +This directory also still contains a handful of older build scripts that |
| 39 | +pre-date the current `getdeps.py` build system. Most of the other `.py` files |
| 40 | +in this top directory, apart from `getdeps.py` itself, are from this older |
| 41 | +build system. This older system is only used by a few remaining projects, and |
| 42 | +new projects should generally use the newer `getdeps.py` script, by adding a |
| 43 | +new configuration file in the `manifests/` subdirectory. |
0 commit comments