summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbderrahim Kitouni <akitouni@gnome.org>2020-06-23 12:17:17 +0100
committerAbderrahim Kitouni <akitouni@gnome.org>2020-07-15 09:37:47 +0100
commit70040a5c509077fb4044ad0ff583a4b0bc9c77e0 (patch)
tree344947c858c2ea4c82600f326ca754d335dae9c5
parentb7d6f239694dad4135cbbd3584bfe4315838fe3c (diff)
downloadbuildstream-abderrahim/loader-workspace.tar.gz
loader.py: use the full name of the element when looking up a workspaceabderrahim/loader-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