diff options
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 55e402a95..320ba7a8a 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -246,15 +246,23 @@ class Element(Plugin): self.__config = self.__extract_config(meta) self._configure(self.__config) - # Extract Sandbox config - self.__sandbox_config = self.__extract_sandbox_config(meta) - # Extract remote execution URL if not self.__is_junction: self.__remote_execution_url = project.remote_execution_url else: self.__remote_execution_url = None + # Extract Sandbox config + self.__sandbox_config = self.__extract_sandbox_config(meta) + + self.__sandbox_config_supported = True + if not self.__use_remote_execution(): + platform = Platform.get_platform() + if not platform.check_sandbox_config(self.__sandbox_config): + # Local sandbox does not fully support specified sandbox config. + # This will taint the artifact, disable pushing. + self.__sandbox_config_supported = False + def __lt__(self, other): return self.name < other.name @@ -1521,6 +1529,11 @@ class Element(Plugin): context = self._get_context() with self._output_file() as output_file: + if not self.__sandbox_config_supported: + self.warn("Sandbox configuration is not supported by the platform.", + detail="Falling back to UID {} GID {}. Artifact will not be pushed." + .format(self.__sandbox_config.build_uid, self.__sandbox_config.build_gid)) + # Explicitly clean it up, keep the build dir around if exceptions are raised os.makedirs(context.builddir, exist_ok=True) rootdir = tempfile.mkdtemp(prefix="{}-".format(self.normal_name), dir=context.builddir) @@ -2110,7 +2123,8 @@ class Element(Plugin): workspaced_dependencies = self.__get_artifact_metadata_workspaced_dependencies() # Other conditions should be or-ed - self.__tainted = workspaced or workspaced_dependencies + self.__tainted = (workspaced or workspaced_dependencies or + not self.__sandbox_config_supported) return self.__tainted |