Skip to content

Commit 64b1927

Browse files
committed
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.
1 parent 874f0b7 commit 64b1927

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/buildstream/sandbox/_sandboxbuildboxrun.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,3 @@ def resume_proc():
238238

239239
if returncode != 0:
240240
raise SandboxError("buildbox-run failed with returncode {}".format(returncode))
241-
242-
def _supported_platform_properties(self):
243-
return {"OSFamily", "ISA", "unixUID", "unixGID", "network"}

src/buildstream/sandbox/_sandboxreapi.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ def _create_platform(self, flags):
131131
if flags & _SandboxFlags.NETWORK_ENABLED:
132132
platform_dict["network"] = "on"
133133

134-
# Remove unsupported platform properties from the dict
135-
supported_properties = self._supported_platform_properties()
136-
platform_dict = {key: value for (key, value) in platform_dict.items() if key in supported_properties}
137-
138134
# Create Platform message with properties sorted by name in code point order
139135
platform = remote_execution_pb2.Platform()
140136
for key, value in sorted(platform_dict.items()):
@@ -203,9 +199,6 @@ def _create_batch(self, main_group, flags, *, collect=None):
203199
def _execute_action(self, action, flags):
204200
raise ImplError("Sandbox of type '{}' does not implement _execute_action()".format(type(self).__name__))
205201

206-
def _supported_platform_properties(self):
207-
return {"OSFamily", "ISA"}
208-
209202

210203
# _SandboxREAPIBatch()
211204
#

0 commit comments

Comments
 (0)