]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: fix sccache job limits when dist is unavailable 70189/head
authorSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 14 Jul 2026 11:25:08 +0000 (04:25 -0700)
committerSun Yuechi <sunyuechi@iscas.ac.cn>
Tue, 14 Jul 2026 13:15:35 +0000 (06:15 -0700)
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 <sunyuechi@iscas.ac.cn>
CMakeLists.txt

index 43ce6ef414749fb0dafa905eaee538d72a8ac527..01fb0f9a3619836e6a526ca4be9439796210d378 100644 (file)
@@ -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")