summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.com>2017-08-02 17:59:30 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2017-09-28 11:30:50 +0100
commit620006f2c3e6271e56743edc129c4fb19eab241a (patch)
tree166c1fc53ff6883acbd345df7cd7d11f549dc794
parent32be8c7b78a80534d75648448221cac5eccd993b (diff)
downloadbuildstream-620006f2c3e6271e56743edc129c4fb19eab241a.tar.gz
Add platform factories
-rw-r--r--buildstream/__init__.py2
-rw-r--r--buildstream/_pipeline.py10
-rw-r--r--buildstream/_platform/__init__.py21
-rw-r--r--buildstream/_platform/linux.py43
-rwxr-xr-xbuildstream/_platform/platform.py92
-rw-r--r--buildstream/_platform/unix.py49
-rw-r--r--buildstream/context.py1
-rw-r--r--buildstream/element.py23
-rw-r--r--buildstream/exceptions.py6
-rw-r--r--buildstream/sandbox/sandbox.py7
-rw-r--r--tests/cachekey/project/elements/build1.expected3
-rw-r--r--tests/cachekey/project/elements/compose1.expected3
-rw-r--r--tests/cachekey/project/elements/compose2.expected2
-rw-r--r--tests/cachekey/project/elements/compose3.expected2
-rw-r--r--tests/cachekey/project/elements/compose4.expected2
-rw-r--r--tests/cachekey/project/elements/compose5.expected2
-rw-r--r--tests/cachekey/project/elements/import1.expected2
-rw-r--r--tests/cachekey/project/elements/import2.expected2
-rw-r--r--tests/cachekey/project/elements/import3.expected2
-rw-r--r--tests/cachekey/project/elements/script1.expected3
-rw-r--r--tests/cachekey/project/sources/bzr1.expected3
-rw-r--r--tests/cachekey/project/sources/git1.expected3
-rw-r--r--tests/cachekey/project/sources/git2.expected3
-rw-r--r--tests/cachekey/project/sources/local1.expected3
-rw-r--r--tests/cachekey/project/sources/local2.expected3
-rw-r--r--tests/cachekey/project/sources/ostree1.expected3
-rw-r--r--tests/cachekey/project/sources/patch1.expected3
-rw-r--r--tests/cachekey/project/sources/patch2.expected3
-rw-r--r--tests/cachekey/project/sources/patch3.expected3
-rw-r--r--tests/cachekey/project/sources/tar1.expected3
-rw-r--r--tests/cachekey/project/sources/tar2.expected3
-rw-r--r--tests/cachekey/project/target.expected2
-rw-r--r--tests/pipeline/load.py2
-rw-r--r--tests/project/plugins.py2
-rw-r--r--tests/variables/variables.py2
35 files changed, 273 insertions, 45 deletions
diff --git a/buildstream/__init__.py b/buildstream/__init__.py
index cda2808d3..f8a2db354 100644
--- a/buildstream/__init__.py
+++ b/buildstream/__init__.py
@@ -20,7 +20,7 @@
# Exceptions and utilities first
from .exceptions import PluginError, LoadError, LoadErrorReason, \
- SourceError, ElementError, ImplError, ProgramNotFoundError
+ SourceError, ElementError, ImplError, ProgramNotFoundError, PlatformError
# Core components
from .context import Context
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 03646ff81..3a72de7ed 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -31,7 +31,6 @@ from pluginbase import PluginBase
from .exceptions import _BstError, _ArtifactError
from ._message import Message, MessageType
-from ._artifactcache import ArtifactCache
from ._elementfactory import ElementFactory
from ._loader import Loader
from ._sourcefactory import SourceFactory
@@ -39,6 +38,7 @@ from . import Consistency, ImplError, LoadError
from . import Scope
from . import _site
from . import _yaml, utils
+from ._platform import Platform
from ._scheduler import SchedStatus, TrackQueue, FetchQueue, BuildQueue, PullQueue, PushQueue
@@ -146,8 +146,8 @@ class Pipeline():
# Resolve project variant now that we've decided on one
project._resolve(loader.project_variant)
-
- self.artifacts = ArtifactCache(self.context, self.project)
+ self.platform = Platform.get_platform(context, project)
+ self.artifacts = self.platform.artifactcache
# Create the factories after resolving the project
pluginbase = PluginBase(package='buildstream.plugins')
@@ -178,7 +178,7 @@ class Pipeline():
if self.artifacts.can_fetch():
try:
if remote_ticker:
- remote_ticker(self.artifacts.artifact_pull)
+ remote_ticker(context.artifact_pull)
self.artifacts.fetch_remote_refs()
except _ArtifactError:
self.message(self.target, MessageType.WARN, "Failed to fetch remote refs")
@@ -686,8 +686,6 @@ class Pipeline():
if not self.artifacts.can_push():
raise PipelineError("Not configured for pushing artifacts")
- if not self.can_push_remote_artifact_cache():
- raise PipelineError("Unable to push to the configured remote artifact cache")
plan = elements
self.assert_consistent(plan)
diff --git a/buildstream/_platform/__init__.py b/buildstream/_platform/__init__.py
new file mode 100644
index 000000000..49400c3f2
--- /dev/null
+++ b/buildstream/_platform/__init__.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2017 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+# Tristan Maat <tristan.maat@codethink.co.uk>
+
+from .platform import Platform
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
new file mode 100644
index 000000000..38afc5423
--- /dev/null
+++ b/buildstream/_platform/linux.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2017 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+# Tristan Maat <tristan.maat@codethink.co.uk>
+
+import os
+import sys
+
+from .. import utils
+from ..sandbox import SandboxBwrap
+from .._artifactcache.ostreecache import OSTreeCache
+
+from . import Platform
+
+
+class Linux(Platform):
+
+ def __init__(self, context, project):
+
+ super().__init__(context, project)
+ self._artifact_cache = OSTreeCache(context, project)
+
+ @property
+ def artifactcache(self):
+ return self._artifact_cache
+
+ def create_sandbox(self, *args, **kwargs):
+ return SandboxBwrap(*args, **kwargs)
diff --git a/buildstream/_platform/platform.py b/buildstream/_platform/platform.py
new file mode 100755
index 000000000..920fddbde
--- /dev/null
+++ b/buildstream/_platform/platform.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2017 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+# Tristan Maat <tristan.maat@codethink.co.uk>
+
+import os
+import sys
+import platform
+
+from .. import utils
+from .. import PlatformError, ProgramNotFoundError, ImplError
+
+
+class Platform():
+
+ # Platform()
+ #
+ # A class to manage platform-specific details. Currently holds the
+ # sandbox factory, the artifact cache and staging operations, as
+ # well as platform helpers.
+ #
+ # Args:
+ # context (context): The project context
+ #
+ def __init__(self, context, project):
+ self.context = context
+ self.project = project
+
+ @classmethod
+ def get_platform(cls, *args, **kwargs):
+
+ if sys.platform.startswith('linux'):
+ backend = 'linux'
+ else:
+ backend = 'unix'
+
+ # Meant for testing purposes and therefore hidden in the
+ # deepest corners of the source code. Try not to abuse this,
+ # please?
+ if os.getenv('BST_FORCE_BACKEND'):
+ backend = os.getenv('BST_FORCE_BACKEND')
+
+ if backend == 'linux':
+ from .linux import Linux as PlatformImpl
+ elif backend == 'unix':
+ from .unix import Unix as PlatformImpl
+ else:
+ raise PlatformError("No such platform: '{}'".format(backend))
+
+ return PlatformImpl(*args, **kwargs)
+
+ ##################################################################
+ # Platform properties #
+ ##################################################################
+ @property
+ def artifactcache(self):
+ raise ImplError("Platform {platform} does not implement an artifactcache"
+ .format(platform=type(self).__name__))
+
+ ##################################################################
+ # Sandbox functions #
+ ##################################################################
+
+ # create_sandbox():
+ #
+ # Create a build sandbox suitable for the environment
+ #
+ # Args:
+ # args (dict): The arguments to pass to the sandbox constructor
+ # kwargs (file): The keyword arguments to pass to the sandbox constructor
+ #
+ # Returns:
+ # (Sandbox) A sandbox
+ #
+ def create_sandbox(self, *args, **kwargs):
+ raise ImplError("Platform {platform} does not implement create_sandbox()"
+ .format(platform=type(self).__name__))
diff --git a/buildstream/_platform/unix.py b/buildstream/_platform/unix.py
new file mode 100644
index 000000000..752386bdf
--- /dev/null
+++ b/buildstream/_platform/unix.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2017 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+# Tristan Maat <tristan.maat@codethink.co.uk>
+
+import os
+import sys
+import pathlib
+
+from .. import utils
+from .. import PlatformError
+from ..sandbox import SandboxChroot
+from .._artifactcache.tarcache import TarCache
+
+from . import Platform
+
+
+class Unix(Platform):
+
+ def __init__(self, context, project):
+
+ super().__init__(context, project)
+ self._artifact_cache = TarCache(context, project)
+
+ # Not necessarily 100% reliable, but we want to fail early.
+ if os.geteuid() != 0:
+ raise PlatformError("Root privileges are required to run without bubblewrap.")
+
+ @property
+ def artifactcache(self):
+ return self._artifact_cache
+
+ def create_sandbox(self, *args, **kwargs):
+ return SandboxChroot(*args, **kwargs)
diff --git a/buildstream/context.py b/buildstream/context.py
index 6f378f700..4ac1adc7a 100644
--- a/buildstream/context.py
+++ b/buildstream/context.py
@@ -128,6 +128,7 @@ class Context():
self._cache_key = None
self._message_handler = None
self._message_depth = deque()
+ self._platform = None
def load(self, config=None):
"""Loads the configuration files
diff --git a/buildstream/element.py b/buildstream/element.py
index 7029acd7e..efb499be0 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -38,15 +38,15 @@ import shutil
from . import _yaml
from ._yaml import CompositePolicy
from ._variables import Variables
-from .exceptions import _BstError, _ArtifactError
+from .exceptions import _BstError
from . import LoadError, LoadErrorReason, ElementError, ImplError
-from ._sandboxbwrap import SandboxBwrap
-from . import Sandbox, SandboxFlags
from . import Plugin, Consistency
from .project import BST_ARTIFACT_VERSION as BST_CORE_ARTIFACT_VERSION
+from . import SandboxFlags
from . import utils
from . import _signals
from . import _site
+from ._platform import Platform
class Scope(Enum):
@@ -456,7 +456,7 @@ class Element(Plugin):
for i in range(len(commands)):
cmd = self.node_subst_list_element(bstdata, 'integration-commands', [i])
self.status("Running integration command", detail=cmd)
- exitcode = sandbox.run(['sh', '-c', '-e', cmd], 0, env=environment, cwd='/')
+ exitcode = sandbox.run(['sh', '-e', '-c', cmd], 0, env=environment, cwd='/')
if exitcode != 0:
raise ElementError("Command '{}' failed with exitcode {}".format(cmd, exitcode))
@@ -866,7 +866,8 @@ class Element(Plugin):
'environment': cache_env,
'sources': [s._get_unique_key() for s in self.__sources],
'dependencies': dependencies,
- 'public': self.__public
+ 'public': self.__public,
+ 'cache': type(self.__artifacts).__name__
})
# _get_cache_key():
@@ -1403,15 +1404,13 @@ class Element(Plugin):
def __sandbox(self, directory, stdout=None, stderr=None):
context = self.get_context()
project = self.get_project()
+ platform = Platform.get_platform(context, project)
if directory is not None and os.path.exists(directory):
-
- # We'll want a factory function and some decision making about
- # which sandbox implementation to use, when we have more than
- # one sandbox implementation.
- #
- sandbox = SandboxBwrap(context, project, directory, stdout=stdout, stderr=stderr)
-
+ sandbox = platform.create_sandbox(context, project,
+ directory,
+ stdout=stdout,
+ stderr=stderr)
yield sandbox
else:
diff --git a/buildstream/exceptions.py b/buildstream/exceptions.py
index 68e43ec37..b23a88506 100644
--- a/buildstream/exceptions.py
+++ b/buildstream/exceptions.py
@@ -141,5 +141,11 @@ class ProgramNotFoundError(_BstError):
pass
+class PlatformError(_BstError):
+ """Raised if the current platform is not supported.
+ """
+ pass
+
+
class _ArtifactError(_BstError):
pass
diff --git a/buildstream/sandbox/sandbox.py b/buildstream/sandbox/sandbox.py
index fe69eae94..ff7dc8762 100644
--- a/buildstream/sandbox/sandbox.py
+++ b/buildstream/sandbox/sandbox.py
@@ -180,12 +180,11 @@ class Sandbox():
Sandbox programming interface for :class:`.Element` plugins.
"""
- def __init__(self, context, project, directory,
- stdout=None, stderr=None):
+ def __init__(self, context, project, directory, **kwargs):
self.__context = context
self.__project = project
- self.__stdout = stdout
- self.__stderr = stderr
+ self.__stdout = kwargs['stdout']
+ self.__stderr = kwargs['stderr']
self.__directories = []
self.__cwd = None
self.__env = None
diff --git a/tests/cachekey/project/elements/build1.expected b/tests/cachekey/project/elements/build1.expected
index bf175041f..e19e1afb9 100644
--- a/tests/cachekey/project/elements/build1.expected
+++ b/tests/cachekey/project/elements/build1.expected
@@ -1 +1,2 @@
-af3b9a7b0c98aa8e2cea8894cabec5b0be93ab80fb23a91241caea4f4b3e42f5
+561ab7191ec25f9761754f8d1cbf5dca1cc08f4a88aaa142e50016a1040eb492
+
diff --git a/tests/cachekey/project/elements/compose1.expected b/tests/cachekey/project/elements/compose1.expected
index aae0f2a69..f3767d9c5 100644
--- a/tests/cachekey/project/elements/compose1.expected
+++ b/tests/cachekey/project/elements/compose1.expected
@@ -1 +1,2 @@
-361b2efdbd40b33d1cf0d6c49b138ff748e02c809b6b8c545502f26e393c51ec
+8ed834155e8c95b1de8a1dd039320a5b688220e585caf507768c0c897951eb97
+
diff --git a/tests/cachekey/project/elements/compose2.expected b/tests/cachekey/project/elements/compose2.expected
index 09fc2994b..69bf454ae 100644
--- a/tests/cachekey/project/elements/compose2.expected
+++ b/tests/cachekey/project/elements/compose2.expected
@@ -1 +1 @@
-1154eed4a7c4d85cf7a86bd3321b4f888d808759d41bbb94becca716bc62b31d
+69a2408862086bc158d4428d6926f6b27f9c5de21302db1fd3705f677c599368
diff --git a/tests/cachekey/project/elements/compose3.expected b/tests/cachekey/project/elements/compose3.expected
index 8b4d3b3bc..bd7b6c1be 100644
--- a/tests/cachekey/project/elements/compose3.expected
+++ b/tests/cachekey/project/elements/compose3.expected
@@ -1 +1 @@
-e724d4075b947c757d41449f4744b148f8e6e0f9b75a74a6a6ab8629c4ddd856
+93f2eca099218f4a01c8030ce6e1ab376eb943eac0fbe960ef70694eb0453540
diff --git a/tests/cachekey/project/elements/compose4.expected b/tests/cachekey/project/elements/compose4.expected
index 0a97cef45..96fa6d7f9 100644
--- a/tests/cachekey/project/elements/compose4.expected
+++ b/tests/cachekey/project/elements/compose4.expected
@@ -1 +1 @@
-95b15616dc332b27f34cd46157638f897dde68c428f1675cc1e44c7f5857181d
+bd14a25dee470598241e6b70e288ac8a8e4d767ab631817d377de334d5fb4905
diff --git a/tests/cachekey/project/elements/compose5.expected b/tests/cachekey/project/elements/compose5.expected
index c2240dd58..9066d43d4 100644
--- a/tests/cachekey/project/elements/compose5.expected
+++ b/tests/cachekey/project/elements/compose5.expected
@@ -1 +1 @@
-1b67cbf1ddd29bfbc7744f10b4298516dda9860f9f8c39c642fc58a1a7c6d592
+e5d5c75a3295701d90f6a6c8ad29444d66244bc95614c53bd185b493722f4849
diff --git a/tests/cachekey/project/elements/import1.expected b/tests/cachekey/project/elements/import1.expected
index a0f745efd..0ca3ce870 100644
--- a/tests/cachekey/project/elements/import1.expected
+++ b/tests/cachekey/project/elements/import1.expected
@@ -1 +1 @@
-8638c5c22601307520aa035e91097a1035c5d0805dc14d188fabd5995a41cecf
+8e1bfd4544ebd9099e6dd942c188dca69eb33cc2689388cd23e9e23bd83c7830
diff --git a/tests/cachekey/project/elements/import2.expected b/tests/cachekey/project/elements/import2.expected
index 3dc01aead..0a9ed3b95 100644
--- a/tests/cachekey/project/elements/import2.expected
+++ b/tests/cachekey/project/elements/import2.expected
@@ -1 +1 @@
-232d1b47a2a04827e7aaf5eb67b10570f014ce0151b8cd13ab764a1d8eb12869
+74a8b51c1cdc22906e2948b3b533c04ef35b09665ba4b6a03bfb416dd1913dc5
diff --git a/tests/cachekey/project/elements/import3.expected b/tests/cachekey/project/elements/import3.expected
index ebab22a00..e30c11bf1 100644
--- a/tests/cachekey/project/elements/import3.expected
+++ b/tests/cachekey/project/elements/import3.expected
@@ -1 +1 @@
-71cc75f1e43be236ad274c3c55d82971437f1e1ca58d8955b2dfc3892a1157d5
+acfe0ef7c41d1698937542784d8d78d64d9b88e550272be72c9ba44f49db8d64
diff --git a/tests/cachekey/project/elements/script1.expected b/tests/cachekey/project/elements/script1.expected
index 138ad193a..689c53ae1 100644
--- a/tests/cachekey/project/elements/script1.expected
+++ b/tests/cachekey/project/elements/script1.expected
@@ -1 +1,2 @@
-12cd69d517a76e823e0c7a2b9e3da1aed1222c183249edcb97b627b350993c36
+4e23a43d403b411d481794e5afdfadbc60eceda3d1b942b681e76067095496fc
+
diff --git a/tests/cachekey/project/sources/bzr1.expected b/tests/cachekey/project/sources/bzr1.expected
index b7fce4bb3..898b30eae 100644
--- a/tests/cachekey/project/sources/bzr1.expected
+++ b/tests/cachekey/project/sources/bzr1.expected
@@ -1 +1,2 @@
-b42fa20fb19fe553c8aae85fac271c2028779d278aa5c741da3d76dbc1b8e75d
+a34d18792825825d9da5664e4b0053f6a9308449c0b1ea872f7350666f9e5964
+
diff --git a/tests/cachekey/project/sources/git1.expected b/tests/cachekey/project/sources/git1.expected
index 7c308911a..227653c7c 100644
--- a/tests/cachekey/project/sources/git1.expected
+++ b/tests/cachekey/project/sources/git1.expected
@@ -1 +1,2 @@
-d3d9fce37d51387adfb93717a2d6ac9fa82de4a0454d40dbcae6683d7e90f9fb
+1307bf4773761714af38b2c5377bf291c28287e923f02c60266211cac2cb4814
+
diff --git a/tests/cachekey/project/sources/git2.expected b/tests/cachekey/project/sources/git2.expected
index 3e57d1fc8..22928e6d4 100644
--- a/tests/cachekey/project/sources/git2.expected
+++ b/tests/cachekey/project/sources/git2.expected
@@ -1 +1,2 @@
-eb87a91092d9edc4eabd0839adeeb08fb4ca7a46bc4e3c6f8b822b88174fa3a7
+f3dd66c3509a9f781b3a5bc6fa185ddbd57e1a14cd2dac0fb3e91fbb23aa4ddb
+
diff --git a/tests/cachekey/project/sources/local1.expected b/tests/cachekey/project/sources/local1.expected
index a0f745efd..85a949195 100644
--- a/tests/cachekey/project/sources/local1.expected
+++ b/tests/cachekey/project/sources/local1.expected
@@ -1 +1,2 @@
-8638c5c22601307520aa035e91097a1035c5d0805dc14d188fabd5995a41cecf
+8e1bfd4544ebd9099e6dd942c188dca69eb33cc2689388cd23e9e23bd83c7830
+
diff --git a/tests/cachekey/project/sources/local2.expected b/tests/cachekey/project/sources/local2.expected
index dd2433413..d146fc138 100644
--- a/tests/cachekey/project/sources/local2.expected
+++ b/tests/cachekey/project/sources/local2.expected
@@ -1 +1,2 @@
-1c7179f249836d755086fce01936057500960102056ba755ce79603a171bfaba
+62c670b295617c114338b483be675932d93368b4326e8c840e9d80f7e787fc4b
+
diff --git a/tests/cachekey/project/sources/ostree1.expected b/tests/cachekey/project/sources/ostree1.expected
index a67a7679f..51cc3b4ad 100644
--- a/tests/cachekey/project/sources/ostree1.expected
+++ b/tests/cachekey/project/sources/ostree1.expected
@@ -1 +1,2 @@
-ebb67e2c6a71e0988fc904d953571c39368a5eb4d0f4ddbac792d117ac654e90
+7b3d581c4df93dd0b6191ac79ed47b642d6f30d65c33fb4bee60a5436205a1e6
+
diff --git a/tests/cachekey/project/sources/patch1.expected b/tests/cachekey/project/sources/patch1.expected
index 97f0f4b4e..b2992d08a 100644
--- a/tests/cachekey/project/sources/patch1.expected
+++ b/tests/cachekey/project/sources/patch1.expected
@@ -1 +1,2 @@
-cea55b5839722e9cc23800fdaf908cb613611db1b243cd17eb52e1a66e977511
+25704e9e01aa56159ccdfa2b5a87294f4aedf1bc8e422a73a67616f0fdeeb371
+
diff --git a/tests/cachekey/project/sources/patch2.expected b/tests/cachekey/project/sources/patch2.expected
index 19da6c464..7fcf9f77d 100644
--- a/tests/cachekey/project/sources/patch2.expected
+++ b/tests/cachekey/project/sources/patch2.expected
@@ -1 +1,2 @@
-123328058bdf05e7234936677894db9359fc394f730604b90d025fecc8a92244
+05ac494c458bb9bcf85d4bc93cc79f69d46550228d21af9d4bbfe1dd83c651eb
+
diff --git a/tests/cachekey/project/sources/patch3.expected b/tests/cachekey/project/sources/patch3.expected
index 4c05727e0..8d4469490 100644
--- a/tests/cachekey/project/sources/patch3.expected
+++ b/tests/cachekey/project/sources/patch3.expected
@@ -1 +1,2 @@
-e2bf4adcac747d03b9af618dfd1c51b47d00e190ff7eea1cdcd193cfdf126fbf
+5c2d9120282c6a1b8c91d0be20e799186e083ec7e8c1bc542cb1fd5decfca64a
+
diff --git a/tests/cachekey/project/sources/tar1.expected b/tests/cachekey/project/sources/tar1.expected
index 331c88a22..02d202366 100644
--- a/tests/cachekey/project/sources/tar1.expected
+++ b/tests/cachekey/project/sources/tar1.expected
@@ -1 +1,2 @@
-d8923fbbd18be7761f7513df5d3c2fc08a928fc0738ff93e0223bbece564bfc5
+3eb538e3c2ca07745e3249cf66f6b7b12636e85224b7937c68d6c149f8419d68
+
diff --git a/tests/cachekey/project/sources/tar2.expected b/tests/cachekey/project/sources/tar2.expected
index 64f565b62..c3e903487 100644
--- a/tests/cachekey/project/sources/tar2.expected
+++ b/tests/cachekey/project/sources/tar2.expected
@@ -1 +1,2 @@
-5defafe194db9d1c3913c3ba0bdaaf18deafab38633a420c91496bed35063516
+e18699582da75d3c8c4f339e27251798d1a60b21d0ad0b74a54c627f516d32a2
+
diff --git a/tests/cachekey/project/target.expected b/tests/cachekey/project/target.expected
index 37a2b6635..3de44cd57 100644
--- a/tests/cachekey/project/target.expected
+++ b/tests/cachekey/project/target.expected
@@ -1 +1 @@
-7daad0df0b59e8a782c737dd95beee69a6c66089d8f8c1293bb9bb9b4c337f69
+f1c164f8837929863f6685f7ee79061d97ae079790343a67168c09066b70fc73
diff --git a/tests/pipeline/load.py b/tests/pipeline/load.py
index 22746dd2f..2071bff4e 100644
--- a/tests/pipeline/load.py
+++ b/tests/pipeline/load.py
@@ -3,6 +3,7 @@ import pytest
from buildstream import Context, Project, Scope
from buildstream._pipeline import Pipeline
+from buildstream._platform import Platform
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
@@ -16,6 +17,7 @@ def create_pipeline(tmpdir, basedir, target, variant):
context.deploydir = os.path.join(str(tmpdir), 'deploy')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
+ context._platform = Platform.get_platform(context, project)
return Pipeline(context, project, target, variant)
diff --git a/tests/project/plugins.py b/tests/project/plugins.py
index 8bc94da9a..e414fa479 100644
--- a/tests/project/plugins.py
+++ b/tests/project/plugins.py
@@ -3,6 +3,7 @@ import pytest
from buildstream import Context, Project, Scope
from buildstream._pipeline import Pipeline
+from buildstream._platform import Platform
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
@@ -14,6 +15,7 @@ def create_pipeline(tmpdir, basedir, target, variant):
context = Context('x86_64')
project = Project(basedir, 'x86_64')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
+ context._platform = Platform.get_platform(context, project)
return Pipeline(context, project, target, variant)
diff --git a/tests/variables/variables.py b/tests/variables/variables.py
index 66f88c695..156081f8f 100644
--- a/tests/variables/variables.py
+++ b/tests/variables/variables.py
@@ -3,6 +3,7 @@ import pytest
from buildstream import Context, Project, BuildElement
from buildstream._pipeline import Pipeline
+from buildstream._platform import Platform
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
@@ -13,6 +14,7 @@ def create_pipeline(tmpdir, basedir, target, variant):
context = Context('x86_64')
project = Project(basedir, 'x86_64')
context.artifactdir = os.path.join(str(tmpdir), 'artifact')
+ context._platform = Platform.get_platform(context, project)
return Pipeline(context, project, target, variant)