This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch jbilleter/nested-reapi
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit d8b5e5003a446346f9a65f711ebdd6b2c2fa17a3
Author: Jürg Billeter <[email protected]>
AuthorDate: Fri Apr 11 14:12:09 2025 +0200

    Enable local execution in buildbox-casd to support nested execution
    
    This bumps the minimum version of buildbox-casd to 1.2.0.
---
 src/buildstream/_cas/casdprocessmanager.py | 20 ++++++++++++++++----
 src/buildstream/_context.py                |  1 +
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/buildstream/_cas/casdprocessmanager.py 
b/src/buildstream/_cas/casdprocessmanager.py
index 899a5473d..78934b7cb 100644
--- a/src/buildstream/_cas/casdprocessmanager.py
+++ b/src/buildstream/_cas/casdprocessmanager.py
@@ -45,9 +45,9 @@ _CASD_TIMEOUT = 300  # in seconds
 #
 # Minimum required version of buildbox-casd
 #
-_REQUIRED_CASD_MAJOR = 0
-_REQUIRED_CASD_MINOR = 0
-_REQUIRED_CASD_MICRO = 58
+_REQUIRED_CASD_MAJOR = 1
+_REQUIRED_CASD_MINOR = 2
+_REQUIRED_CASD_MICRO = 0
 
 
 # CASDProcessManager
@@ -76,7 +76,8 @@ class CASDProcessManager:
         messenger,
         *,
         reserved=None,
-        low_watermark=None
+        low_watermark=None,
+        local_jobs=None
     ):
         os.makedirs(path, exist_ok=True)
 
@@ -104,6 +105,17 @@ class CASDProcessManager:
         if protect_session_blobs:
             casd_args.append("--protect-session-blobs")
 
+        if local_jobs is not None:
+            try:
+                buildbox_run = utils._get_host_tool_internal("buildbox-run", 
search_subprojects_dir="buildbox")
+                casd_args.append("--buildbox-run={}".format(buildbox_run))
+                casd_args.append("--jobs={}".format(local_jobs))
+            except utils.ProgramNotFoundError as e:
+                # Not fatal as buildbox-run is not needed for remote execution
+                # and buildbox-casd local execution will never be used if
+                # buildbox-run is not available.
+                pass
+
         if remote_cache_spec:
             casd_args.append("--cas-remote={}".format(remote_cache_spec.url))
             if remote_cache_spec.instance_name:
diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index e125e3c89..87675a3c8 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -749,6 +749,7 @@ class Context:
                 messenger=self.messenger,
                 reserved=self.config_cache_reserved,
                 low_watermark=self.config_cache_low_watermark,
+                local_jobs=self.sched_builders * self.effective_build_max_jobs,
             )
         return self._casd
 

Reply via email to