summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbderrahim Kitouni <akitouni@gnome.org>2020-06-23 12:17:17 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2020-07-16 07:05:18 +0000
commite59cdd23d0cfa6b658696299487745ccf8a6e3c8 (patch)
treecb08def1a6cd3fe45be58d3149e1209fa58158a7
parentbb579a1a7475576f7e2f8ef24f3d7299fc8babe8 (diff)
downloadbuildstream-e59cdd23d0cfa6b658696299487745ccf8a6e3c8.tar.gz
loader.py: use the full name of the element when looking up a workspace
This fixes a bug where buildstream would ignore the opened workspace on a cross-junction element.
-rw-r--r--src/buildstream/_loader/loader.py2
-rw-r--r--tests/frontend/cross_junction_workspace.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index a3af70f4b..9f881743d 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -281,7 +281,7 @@ class Loader:
# if there's a workspace for this element then just append a dummy workspace
# metasource.
- workspace = self.load_context.context.get_workspaces().get_workspace(element.name)
+ workspace = self.load_context.context.get_workspaces().get_workspace(element.full_name)
skip_workspace = True
if workspace:
workspace_node = {"kind": "workspace"}
diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py
index 5e25d1fa8..c3b80ae0a 100644
--- a/tests/frontend/cross_junction_workspace.py
+++ b/tests/frontend/cross_junction_workspace.py
@@ -48,15 +48,18 @@ def prepare_junction_project(cli, tmpdir):
def open_cross_junction(cli, tmpdir):
project = prepare_junction_project(cli, tmpdir)
- workspace = tmpdir.join("workspace")
-
element = "sub.bst:data.bst"
+
+ oldkey = cli.get_element_key(project, element)
+
+ workspace = tmpdir.join("workspace")
args = ["workspace", "open", "--directory", str(workspace), element]
result = cli.run(project=project, args=args)
result.assert_success()
assert cli.get_element_state(project, element) == "buildable"
assert os.path.exists(str(workspace.join("hello.txt")))
+ assert cli.get_element_key(project, element) != oldkey
return project, workspace