From 190077ca6b210556134dfdd32dcf7299690b5b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Fri, 29 Aug 2025 17:12:43 +0200 Subject: [PATCH 1/2] sandbox/_config.py: Fix artifact metadata for `remote-apis-socket` `new_from_node()` and `to_dict()` must be compatible for artifact loading to work. --- src/buildstream/sandbox/_config.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/buildstream/sandbox/_config.py b/src/buildstream/sandbox/_config.py index c25bf27d0..8b29e9111 100644 --- a/src/buildstream/sandbox/_config.py +++ b/src/buildstream/sandbox/_config.py @@ -76,7 +76,7 @@ def __init__( # Returns: # A dictionary representation of this SandboxConfig # - def to_dict(self) -> Dict[str, Union[str, int, bool]]: + def to_dict(self) -> Dict[str, Union[str, int, Dict]]: # Assign mandatory portions of the sandbox configuration # @@ -84,7 +84,7 @@ def to_dict(self) -> Dict[str, Union[str, int, bool]]: # the sandbox configuration, as that would result in # breaking cache key stability. # - sandbox_dict: Dict[str, Union[str, int, bool]] = {"build-os": self.build_os, "build-arch": self.build_arch} + sandbox_dict: Dict[str, Union[str, int, Dict]] = {"build-os": self.build_os, "build-arch": self.build_arch} # Assign optional portions of the sandbox configuration # @@ -98,9 +98,10 @@ def to_dict(self) -> Dict[str, Union[str, int, bool]]: sandbox_dict["build-gid"] = self.build_gid if self.remote_apis_socket_path is not None: - sandbox_dict["remote-apis-socket-path"] = self.remote_apis_socket_path + reapi_socket_dict: Dict[str, Union[str, bool]] = {"path": self.remote_apis_socket_path} if self.remote_apis_socket_action_cache_enable_update: - sandbox_dict["remote-apis-socket-action-cache-enable-update"] = True + reapi_socket_dict["action-cache-enable-update"] = True + sandbox_dict["remote-apis-socket"] = reapi_socket_dict return sandbox_dict From 8b90e27022c8ee835da260e8e72a0c4cf51eb183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Sat, 30 Aug 2025 09:35:49 +0200 Subject: [PATCH 2/2] tests/integration/sandbox.py: Extend tests to check artifact loading --- tests/integration/sandbox.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/integration/sandbox.py b/tests/integration/sandbox.py index 9ebc75c7b..5e3898b9d 100644 --- a/tests/integration/sandbox.py +++ b/tests/integration/sandbox.py @@ -61,6 +61,11 @@ def test_remote_apis_socket(cli, datafiles): result = cli.run(project=project, args=["build", element_name]) assert result.exit_code == 0 + # Verify that loading the artifact succeeds + artifact_name = cli.get_artifact_name(project, "test", element_name) + result = cli.run(project=project, args=["artifact", "show", artifact_name]) + assert result.exit_code == 0 + # Test configuration with remote action cache for nested REAPI. @pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox") @@ -103,6 +108,11 @@ def test_remote_apis_socket_with_action_cache_update(cli, tmpdir, datafiles): result = cli.run(project=project, args=["build", element_name]) assert result.exit_code == 0 + # Verify that loading the artifact succeeds + artifact_name = cli.get_artifact_name(project, "test", element_name) + result = cli.run(project=project, args=["artifact", "show", artifact_name]) + assert result.exit_code == 0 + # Test configuration with cache storage-service and remote action cache for nested REAPI. @pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")