From: Sun Yuechi Date: Tue, 14 Jul 2026 11:25:08 +0000 (-0700) Subject: cmake: fix sccache job limits when dist is unavailable X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae789567a2d500f5a92d8c4460df5fa9b9f4b5d1;p=ceph.git cmake: fix sccache job limits when dist is unavailable The "disabled" search only matches sccache's Disabled("disabled") payload, not "dist-client feature not selected" or the NotConnected states. Those reach the success branch, so the job counts become SchedulerStatus-NOTFOUND, JOB_POOLS is never defined, and ninja rejects the manifest. Key off the JSON lookup's error instead to cover every non-dist state. Signed-off-by: Sun Yuechi --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ce6ef4147..01fb0f9a361 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,13 +117,13 @@ if(WITH_SCCACHE) ERROR_VARIABLE sccache_dist_status_error GET "${sccache_dist_status}" SchedulerStatus 1 num_cpus ) - string(FIND "${sccache_dist_status}" "disabled" find_result) - if(find_result EQUAL -1) + if(sccache_dist_status_error) + message(WARNING "Using sccache, but it is not configured for distributed " + "compilation: ${sccache_dist_status_error}") + else() message(STATUS "Using sccache with distributed compilation. Effective cores: ${sccache_cores}") set(NINJA_MAX_COMPILE_JOBS ${sccache_cores}) set(NINJA_MAX_LINK_JOBS ${sccache_cores}) - else() - message(WARNING "Using sccache, but it is not configured for distributed complilation") endif() else() message(WARNING "Using sccache, but cannot determine maximum job value since cmake version is <3.19")