Skip to content
Snippets Groups Projects
Commit 621bd236 authored by Tiago Gomes's avatar Tiago Gomes
Browse files

Merge branch 'valentindavid/silverblue-path-1.2' into 'bst-1.2'

Backport to 1.2: Fix outside-of-project check when project path is not canonical.

See merge request !834
parents 092038d2 075ffefa
No related branches found
No related tags found
1 merge request!834Backport to 1.2: Fix outside-of-project check when project path is not canonical.
Pipeline #31613234 failed
......@@ -467,7 +467,7 @@ def node_get_project_path(node, key, project_dir, *,
"{}: Specified path '{}' does not exist"
.format(provenance, path_str))
is_inside = project_dir_path in full_resolved_path.parents or (
is_inside = project_dir_path.resolve() in full_resolved_path.parents or (
full_resolved_path == project_dir_path)
if path.is_absolute() or not is_inside:
......
......@@ -181,3 +181,15 @@ def test_project_refs_options(cli, datafiles):
# Assert that the cache keys are different
assert result1.output != result2.output
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'element-path'))
def test_element_path_project_path_contains_symlinks(cli, datafiles, tmpdir):
real_project = str(datafiles)
linked_project = os.path.join(str(tmpdir), 'linked')
os.symlink(real_project, linked_project)
os.makedirs(os.path.join(real_project, 'elements'), exist_ok=True)
with open(os.path.join(real_project, 'elements', 'element.bst'), 'w') as f:
f.write("kind: manual\n")
result = cli.run(project=linked_project, args=['show', 'element.bst'])
result.assert_success()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment