summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_stream.py2
-rw-r--r--tests/frontend/source_checkout.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 6a3d2c7fc..6f298c259 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -1199,7 +1199,7 @@ class Stream():
element_source_dir = self._get_element_dirname(directory, element)
if list(element.sources()):
os.makedirs(element_source_dir)
- element._stage_sources_at(element_source_dir)
+ element._stage_sources_at(element_source_dir, mount_workspaces=False)
# Write a master build script to the sandbox
def _write_build_script(self, directory, elements):
diff --git a/tests/frontend/source_checkout.py b/tests/frontend/source_checkout.py
index 58dfdbd42..4e7541a31 100644
--- a/tests/frontend/source_checkout.py
+++ b/tests/frontend/source_checkout.py
@@ -28,10 +28,17 @@ def generate_remote_import_element(input_path, output_path):
@pytest.mark.datafiles(DATA_DIR)
-def test_source_checkout(datafiles, cli):
+@pytest.mark.parametrize('with_workspace', [('workspace'), ('no-workspace')])
+def test_source_checkout(datafiles, tmpdir_factory, cli, with_workspace):
+ tmpdir = tmpdir_factory.mktemp("")
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'source-checkout')
target = 'checkout-deps.bst'
+ workspace = os.path.join(str(tmpdir), 'workspace')
+
+ if with_workspace == "workspace":
+ result = cli.run(project=project, args=['workspace', 'open', '--directory', workspace, target])
+ result.assert_success()
result = cli.run(project=project, args=['source-checkout', target, '--deps', 'none', checkout])
result.assert_success()