Skip to content

Conversation

@benoit-nexthop
Copy link
Contributor

@benoit-nexthop benoit-nexthop commented Oct 14, 2025

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.

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.

@meta-cla meta-cla bot added the CLA Signed label Oct 14, 2025
@benoit-nexthop benoit-nexthop force-pushed the build-sccache branch 2 times, most recently from 5189c09 to dd1a611 Compare October 16, 2025 20:33
@benoit-nexthop benoit-nexthop changed the title Support building with sccache [Nexthop] Support building with sccache Nov 5, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 5, 2025

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D86343218.

@facebook-github-bot
Copy link
Contributor

@benoit-nexthop has updated the pull request. You must reimport the pull request before landing.

- 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.
@facebook-github-bot
Copy link
Contributor

@benoit-nexthop has updated the pull request. You must reimport the pull request before landing.

@meta-codesync
Copy link

meta-codesync bot commented Nov 11, 2025

@joseph5wu merged this pull request in 2f9b90e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants