run-getdeps.py Reference
fboss/oss/scripts/run-getdeps.py is the entry point for every FBOSS build. It wraps Meta's getdeps.py (build/fbcode_builder/getdeps.py): it validates the SAI options, exports the environment variables the CMake build reads, stages vendor SDK artifacts, configures the compiler, and then runs getdeps once per build pass. This page lists every option, the environment variables it sets, the supported SDK values, and the pass logic. For a guided build, see Building FBOSS.
Synopsis
./fboss/oss/scripts/run-getdeps.py [wrapper options] <getdeps subcommand> [getdeps options] fboss
Everything from the getdeps subcommand onward (usually build ... fboss) is collected as getdeps_args and passed to getdeps unchanged, except that the PHY pass rewrites --cmake-target (see Build Passes).
Wrapper Options
NPU (Agent) SDK
| Option | Meaning |
|---|---|
--npu-sai-impl IMPL |
SAI implementation for the agent. Officially supported: SAI_BRCM_IMPL, SAI_TAJO_IMPL, CHENAB_SAI_SDK. Exported as <IMPL>=1. Without it (and without --phy-sai-impl), the build uses fake SAI. |
--npu-sai-sdk-version VER |
Required with --npu-sai-impl. SDK version selector, exported as SAI_SDK_VERSION. Also sets NPU_ASIC_SDK_VERSION and NPU_SAI_SDK_VERSION from the table below (unknown if the selector is not in the table). |
--npu-sai-version X.Y.Z |
SAI spec version (any release tag of the OCP SAI repo), exported as SAI_VERSION and used to pin the libsai dependency. Must match the SDK's sai/inc/saiversion.h if that file exists. |
--npu-libsai-impl-path DIR |
Directory containing libsai_impl.a or libsai_impl.so, optionally with sai_dependencies.txt and other SDK libraries to stage alongside |
--npu-experiments-path DIR |
SAI experimental headers directory |
--npu-libsai-impl-tarball FILE |
A prebuilt NPU SDK tarball, either in the flat layout (library plus experimental/) or a lib/ + include/ layout, optionally under one top-level directory. Mutually exclusive with the two path options. |
An NPU SDK may be a static archive or a shared library; a .so records its own dependencies, so it needs no sai_dependencies.txt. Staged artifacts are put on CMAKE_PREFIX_PATH.
PHY (External PHY) SDK
| Option | Meaning |
|---|---|
--phy-sai-impl IMPL |
SAI implementation for qsfp_service's external PHYs. Officially supported: SAI_BRCM_PAI_IMPL. Triggers a PHY pass that rebuilds qsfp_targets. |
--phy-sai-version X.Y.Z |
SAI spec version for the PHY pass only; defaults to the build's default |
--phy-pai-sdk-path DIR |
Prepared PAI SDK with lib/ (libepdm.a, libpai.a, libphymodepil.a) and include/ (sai/, pai_macsec/, epdm/); symlinked to /var/FBOSS/pai_impl, the path CMake reads |
--phy-pai-sdk-tarball FILE |
Same layout as a tarball (optionally under one top-level directory); extracted and symlinked to /var/FBOSS/pai_impl |
--phy-pai-sdk-path and --phy-pai-sdk-tarball are mutually exclusive. If neither is given, /var/FBOSS/pai_impl must already be populated by hand. PHY-only options without --phy-sai-impl are ignored with a warning.
Other Options
| Option | Meaning |
|---|---|
--benchmark-install |
Install benchmark binaries (BENCHMARK_INSTALL=1) |
--skip-install |
Skip installing binaries (SKIP_ALL_INSTALL=1) |
--preserve-env |
Do not overwrite environment variables that are already set; the existing value wins and is logged |
--use-gcc |
Stay on GCC instead of switching to Clang |
--check-compile-mem |
After a successful build, check <tu>.peak.txt files against compile memory budgets; a breach fails with exit 2. Without peak files it warns and passes. |
--compile-mem-peaks-dir DIR |
Peak files directory (default <scratch>/compile_mem_peaks) |
--compile-mem-budgets FILE |
Budgets file (default compile_mem_budgets.json beside the script) |
--getdeps-help |
Show getdeps.py -h |
--asan exists in the code but is commented out ("re-enable when asan builds are supported").
Common getdeps Options
These follow the subcommand:
| Option | Meaning |
|---|---|
--scratch-path DIR |
Where checkouts, build trees, and install trees live |
--allow-system-packages |
Use system packages to satisfy dependencies (the container provides them) |
--build-type T |
Debug, RelWithDebInfo (default), MinSizeRel, or Release |
--cmake-target T |
Build only this CMake target |
--extra-cmake-defines JSON |
Extra CMake defines, for example '{"CMAKE_CXX_STANDARD": "20", "RANGE_V3_TESTS": "OFF", "RANGE_V3_PERF": "OFF"}' |
--src-dir DIR |
Build this source tree instead of the pinned FBOSS commit |
--num-jobs N |
Parallel jobs (default: number of CPU cores) |
--install-prefix DIR |
Install location (default <scratch-path>/installed) |
--lfs-path PATH |
Serve downloads from an LFS cache (also disables the mirror prefetch below) |
Build Passes
The wrapper turns the SAI options into an ordered list of passes. Each pass runs getdeps as a subprocess into the same build tree, so a later pass overwrites earlier artifacts. The first failing pass aborts the run with its exit code.
| Options given | Passes |
|---|---|
| none | 1. fake SAI (BUILD_SAI_FAKE=1) |
--npu-sai-impl |
1. NPU |
--npu-sai-impl + --phy-sai-impl |
1. NPU base, 2. PHY: qsfp_targets against the PAI SDK |
--phy-sai-impl with --cmake-target qsfp_targets |
1. PHY only |
--phy-sai-impl with any other target |
1. fake SAI base, 2. PHY: qsfp_targets |
Before each pass, the SAI selection variables (SAI_BRCM_IMPL, SAI_TAJO_IMPL, CHENAB_SAI_SDK, SAI_BRCM_PAI_IMPL, BUILD_SAI_FAKE, SAI_SDK_VERSION, SAI_VERSION, NPU_ASIC_SDK_VERSION, NPU_SAI_SDK_VERSION), CMAKE_PREFIX_PATH, and the libsai manifest are reset to their original values, so one pass's choice never leaks into the next. The PHY pass forces --cmake-target qsfp_targets, replacing any target you gave. Progress is printed as === Build pass 1/2: NPU base ===.
Supported SAI Implementations and SDK Versions
--npu-sai-sdk-version |
ASIC SDK | SAI SDK |
|---|---|---|
| Broadcom XGS | ||
SAI_VERSION_8_2_0_0_ODP |
6.5.26-1 | 8.2.0.0_odp |
SAI_VERSION_10_2_0_0_ODP |
6.5.29 | 10.2.0.0_odp |
SAI_VERSION_11_7_0_0_ODP |
6.5.30-4 | 11.7.0.0_odp |
SAI_VERSION_12_2_0_0_ODP |
6.5.31 | 12.2.0.0_odp |
SAI_VERSION_13_3_0_0_ODP |
6.5.32 | 13.3.0.0_odp |
SAI_VERSION_14_0_EA_ODP |
6.5.34 | 14.0_ea_odp |
SAI_VERSION_14_2_0_0_ODP |
6.5.34 | 14.2.0.0_odp |
SAI_VERSION_15_4_EA_ODP |
6.5.35-2 | 15.4_ea_odp |
SAI_VERSION_15_4_0_0_ODP |
6.5.35 | 15.4.0.0_odp |
| Broadcom DNX | ||
SAI_VERSION_11_7_0_0_DNX_ODP |
6.5.30-5 | 11.7.0.0_dnx_odp |
SAI_VERSION_12_2_0_0_DNX_ODP |
6.5.31-2 | 12.2.0.0_dnx_odp |
SAI_VERSION_13_3_0_0_DNX_ODP |
6.5.32 | 13.3.0.0_dnx_odp |
SAI_VERSION_14_0_EA_DNX_ODP |
6.5.34 | 14.0_ea_dnx_odp |
SAI_VERSION_14_2_0_0_DNX_ODP |
6.5.34 | 14.2.0.0_dnx_odp |
SAI_VERSION_15_0_EA_DNX_ODP |
6.5.35 | 15.0_ea_dnx_odp |
SAI_VERSION_16_0_EA_DNX_ODP |
6.5.36 | 16.0_ea_dnx_odp |
| Cisco (Tajo) | ||
TAJO_SDK_VERSION_1_42_8 |
1.42.8-3 | 1.42.8-3 |
TAJO_SDK_VERSION_24_8_3001 |
24.8.3001-3 | 24.8.3001-3 |
TAJO_SDK_VERSION_25_5_4210 |
25.5.4210-3 | 25.5.4210-3 |
TAJO_SDK_VERSION_25_11_4210 |
25.11.4210-2 | 25.11.4210-2 |
TAJO_SDK_VERSION_26_2_4210 |
26.2.4210-1 | 26.2.4210-1 |
TAJO_SDK_VERSION_26_5_4210 |
26.5.4210 | 26.5.4210 |
TAJO_SDK_VERSION_26_5_5210 |
26.5.5210 | 26.5.5210 |
TAJO_SDK_VERSION_26_7_5211 |
26.7.5211 | 26.7.5211 |
| Nvidia (Chenab) | ||
CHENAB_SAI_SDK_VERSION_2511_36_0_20 |
4.8.4062 | 2511.36 |
CHENAB_SAI_SDK_VERSION_2605_37_0_20 |
4.10.1 | 2605.37 |
The table is SDK_VERSIONS in fboss/oss/scripts/sdk_versions.py. Values outside it are accepted with a Note: '<value>' is not a Meta officially supported value message, and their NPU_*_SDK_VERSION variables become unknown.
Toolchain Handling
- The wrapper runs
g++ --version. If it reports Clang, it configures the Clang environment; if GCC, it switches withupdate-alternatives --set gcc /usr/local/llvm/bin/clangand re-detects, exiting with an error and the manual command if that fails.--use-gccsets/opt/rh/gcc-toolset-12/root/usr/bin/gccinstead. - With Clang it reads the Clang-specific
CMAKE_CXX_FLAGSfrom theif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")block ofCMakeLists.txtin the current directory and adds-std=c++20and several-Wno-...flags. Run it from the repository root, or it printsWarning: CMakeLists.txt not found, skipping clang-specific flags. - It copies a
-march=flag from Python's build configuration so C++ code matches the Cython extensions. - It always prepends
-DHAVE_SETNS=1toCFLAGS.
Download Mirrors
getdeps retries a single pinned URL per dependency, so a GNU mirror that drops an old release can fail a build. Before building, the wrapper tries to prefetch GNU-hosted archives from fallback mirrors into getdeps' download directory. This is best-effort: failures print Mirror prefetch failed (...); continuing with getdeps. It is skipped when running from an fbsource checkout or when --lfs-path is given.
Environment
| Variable | Effect |
|---|---|
FBOSS_ROOT |
Repository root used to locate build/fbcode_builder/getdeps.py (default: three directories above the script) |
PYTHONUNBUFFERED |
Set to 1 if unset, so output order is preserved when piping to tee |
Exit Codes
| Code | Meaning |
|---|---|
0 |
All passes succeeded |
1 |
Invalid option combination (for example missing --npu-sai-sdk-version, mutually exclusive options), or toolchain switch failed |
| getdeps' code | A build pass failed (Build pass '<label>' failed with exit code N.) |
2 or the checker's code |
--check-compile-mem budget check failed |