From 59a46b22025a81900f75483d8eb4c5699e28d60c Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Fri, 19 Jul 2019 15:23:50 -0700 Subject: [PATCH] update CMakeBuilder to raise an exception if we cannot find CMake Summary: If `path_search()` returns that CMake is not available, raise an Exception and fail the build. This makes the failure somewhat easier to to identify. Without this the code would continue and would try to invoke `subprocess` with a value of `None` in the command argument list. This error is slightly harder to debug, since it isn't clear which command argument or environment variable is not a string. Reviewed By: chadaustin Differential Revision: D16354623 fbshipit-source-id: be972b02cb13bc70db0f867da70e5bf4c6cec46d --- build/fbcode_builder/getdeps/builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/fbcode_builder/getdeps/builder.py b/build/fbcode_builder/getdeps/builder.py index fbdfd6b0a..678c8f42b 100644 --- a/build/fbcode_builder/getdeps/builder.py +++ b/build/fbcode_builder/getdeps/builder.py @@ -257,6 +257,8 @@ class CMakeBuilder(BuilderBase): # Resolve the cmake that we installed cmake = path_search(env, "cmake") + if cmake is None: + raise Exception("Failed to find CMake") if reconfigure: self._invalidate_cache()