Commit 2f9b90e
Support building with sccache (#593)
Summary:
# Description
- Install `sccache` in Docker image
- Add an extras mount directory and use it for sccache
- Add `--extra-cmake-defines` argument to `docker-build.py` so the caller
can pass `CMAKE_C_COMPILER_LAUNCHER` etc. to the build.
# Motivation
Building FBOSS requires significant resources, the translation units are huge, often taking 1-4G of RAM, sometimes 6-8G, and linking requirements are even more onerous. On a machine with AMD EPYC 9655P (96 cores, 192 threads), in a VM using only 64 cores and 512GB of RAM, the FBOSS builds takes about 22min, but using `sccache` and with the cache warm from a previous build, build time can be as low as 2min with a 100% cache hit rate.
Pull Request resolved: #593
Test Plan: Building with `--extra-cmake-defines {"CMAKE_C_COMPILER_LAUNCHER":"sccache","CMAKE_CXX_COMPILER_LAUNCHER":"sccache"}` works. By default the build process is unchanged. This PR allows injecting `sccache` or other similar tool into the build.
Reviewed By: KevinYakar
Differential Revision: D86343218
Pulled By: joseph5wu
fbshipit-source-id: 3f6d9efb4958bd3cb2d0337c79a167d35d59440a1 parent b61a22e commit 2f9b90e
2 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
160 | 183 | | |
161 | 184 | | |
162 | 185 | | |
| |||
236 | 259 | | |
237 | 260 | | |
238 | 261 | | |
| 262 | + | |
| 263 | + | |
239 | 264 | | |
240 | 265 | | |
241 | 266 | | |
| |||
261 | 286 | | |
262 | 287 | | |
263 | 288 | | |
| 289 | + | |
| 290 | + | |
264 | 291 | | |
265 | 292 | | |
266 | 293 | | |
267 | 294 | | |
268 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
269 | 305 | | |
270 | 306 | | |
271 | 307 | | |
272 | | - | |
| 308 | + | |
273 | 309 | | |
274 | 310 | | |
275 | 311 | | |
| |||
336 | 372 | | |
337 | 373 | | |
338 | 374 | | |
| 375 | + | |
| 376 | + | |
339 | 377 | | |
340 | 378 | | |
341 | 379 | | |
| |||
0 commit comments