From 64b1927199aaf7821320cae47a86af2e2e590e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Fri, 23 May 2025 10:47:20 +0200 Subject: [PATCH] sandbox: Do not silently drop platform properties For remote execution, there is currently no way to determine what platform properties are supported. Silently dropping platform properties that may or may not be supported can result in build behavior differences or confusing errors. This code was originally added before the `build-uid` and `build-gid` sandbox configuration was made optional to not break remote execution. However, now that the corresponding platform properties are only set if requested by the project or element, it's better to fail the build than to ignore the setting. --- src/buildstream/sandbox/_sandboxbuildboxrun.py | 3 --- src/buildstream/sandbox/_sandboxreapi.py | 7 ------- 2 files changed, 10 deletions(-) diff --git a/src/buildstream/sandbox/_sandboxbuildboxrun.py b/src/buildstream/sandbox/_sandboxbuildboxrun.py index d6eb2dc2d..25d200262 100644 --- a/src/buildstream/sandbox/_sandboxbuildboxrun.py +++ b/src/buildstream/sandbox/_sandboxbuildboxrun.py @@ -238,6 +238,3 @@ def resume_proc(): if returncode != 0: raise SandboxError("buildbox-run failed with returncode {}".format(returncode)) - - def _supported_platform_properties(self): - return {"OSFamily", "ISA", "unixUID", "unixGID", "network"} diff --git a/src/buildstream/sandbox/_sandboxreapi.py b/src/buildstream/sandbox/_sandboxreapi.py index 34b6c8892..17997b355 100644 --- a/src/buildstream/sandbox/_sandboxreapi.py +++ b/src/buildstream/sandbox/_sandboxreapi.py @@ -131,10 +131,6 @@ def _create_platform(self, flags): if flags & _SandboxFlags.NETWORK_ENABLED: platform_dict["network"] = "on" - # Remove unsupported platform properties from the dict - supported_properties = self._supported_platform_properties() - platform_dict = {key: value for (key, value) in platform_dict.items() if key in supported_properties} - # Create Platform message with properties sorted by name in code point order platform = remote_execution_pb2.Platform() for key, value in sorted(platform_dict.items()): @@ -203,9 +199,6 @@ def _create_batch(self, main_group, flags, *, collect=None): def _execute_action(self, action, flags): raise ImplError("Sandbox of type '{}' does not implement _execute_action()".format(type(self).__name__)) - def _supported_platform_properties(self): - return {"OSFamily", "ISA"} - # _SandboxREAPIBatch() #