Skip to content

Commit 190077c

Browse files
committed
sandbox/_config.py: Fix artifact metadata for remote-apis-socket
`new_from_node()` and `to_dict()` must be compatible for artifact loading to work.
1 parent ce4ba2f commit 190077c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/buildstream/sandbox/_config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ def __init__(
7676
# Returns:
7777
# A dictionary representation of this SandboxConfig
7878
#
79-
def to_dict(self) -> Dict[str, Union[str, int, bool]]:
79+
def to_dict(self) -> Dict[str, Union[str, int, Dict]]:
8080

8181
# Assign mandatory portions of the sandbox configuration
8282
#
8383
# /!\ No additional mandatory members can ever be added to
8484
# the sandbox configuration, as that would result in
8585
# breaking cache key stability.
8686
#
87-
sandbox_dict: Dict[str, Union[str, int, bool]] = {"build-os": self.build_os, "build-arch": self.build_arch}
87+
sandbox_dict: Dict[str, Union[str, int, Dict]] = {"build-os": self.build_os, "build-arch": self.build_arch}
8888

8989
# Assign optional portions of the sandbox configuration
9090
#
@@ -98,9 +98,10 @@ def to_dict(self) -> Dict[str, Union[str, int, bool]]:
9898
sandbox_dict["build-gid"] = self.build_gid
9999

100100
if self.remote_apis_socket_path is not None:
101-
sandbox_dict["remote-apis-socket-path"] = self.remote_apis_socket_path
101+
reapi_socket_dict: Dict[str, Union[str, bool]] = {"path": self.remote_apis_socket_path}
102102
if self.remote_apis_socket_action_cache_enable_update:
103-
sandbox_dict["remote-apis-socket-action-cache-enable-update"] = True
103+
reapi_socket_dict["action-cache-enable-update"] = True
104+
sandbox_dict["remote-apis-socket"] = reapi_socket_dict
104105

105106
return sandbox_dict
106107

0 commit comments

Comments
 (0)