Skip to content

Commit a0c9a5e

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
fbcode_builder: keep going after build errors to surface all failures
Summary: When CMake's `--build` runs through ninja, the build stops on the first error by default. In CI that means a single broken target masks every other failure in the build, and each red run only reveals one problem at a time. Pass `-- -k 0` to ninja so it keeps going after errors. `-k 0` means "do not stop, regardless of failure count". The exit code of the build is still nonzero when any target fails, so this is purely an information-surfacing change — successful runs are unaffected. getdeps always configures CMake with `-G Ninja` (see `_compute_cmake_define_args` and `CMakeBootstrap`), so the underlying build tool is always ninja. ninja requires `-k` to take a value and has no `--keep-going` long form (see `kLongOptions` in `ninja.cc`). Reviewed By: vitaut Differential Revision: D101570020 fbshipit-source-id: 912ad27b2eb790be0f64f074f9257c71f1f5f5ae
1 parent daaa4d9 commit a0c9a5e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

build/fbcode_builder/getdeps/builder.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,12 @@ def _build(self, reconfigure: bool) -> None:
10081008
self.build_opts.build_type,
10091009
"-j",
10101010
str(self.num_jobs),
1011+
"--",
1012+
# Continue building even if we see an error
1013+
# Increases dev velocity by surfacing all errors
1014+
# `-k 0` is understood by ninja - the only build system we use
1015+
"-k",
1016+
"0",
10111017
],
10121018
env=env,
10131019
preexec_fn=self.memory_limit_preexec_fn,
@@ -1047,6 +1053,12 @@ def _build_targets(self, targets: Sequence[str]) -> None:
10471053
self.build_opts.build_type,
10481054
"-j",
10491055
str(self.num_jobs),
1056+
"--",
1057+
# Continue building even if we see an error
1058+
# Increases dev velocity by surfacing all errors
1059+
# `-k 0` is understood by ninja - the only build system we use
1060+
"-k",
1061+
"0",
10501062
]
10511063
)
10521064

0 commit comments

Comments
 (0)