[Notes] [Git][BuildStream/buildstream][master] 2 commits: Fix outside-of-project check when project path is not canonical.



Title: GitLab

Tiago Gomes pushed to branch master at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/_yaml.py
    ... ... @@ -467,7 +467,7 @@ def node_get_project_path(node, key, project_dir, *,
    467 467
                             "{}: Specified path '{}' does not exist"
    
    468 468
                             .format(provenance, path_str))
    
    469 469
     
    
    470
    -    is_inside = project_dir_path in full_resolved_path.parents or (
    
    470
    +    is_inside = project_dir_path.resolve() in full_resolved_path.parents or (
    
    471 471
             full_resolved_path == project_dir_path)
    
    472 472
     
    
    473 473
         if path.is_absolute() or not is_inside:
    

  • tests/format/project.py
    ... ... @@ -188,3 +188,15 @@ def test_project_refs_options(cli, datafiles):
    188 188
     
    
    189 189
         # Assert that the cache keys are different
    
    190 190
         assert result1.output != result2.output
    
    191
    +
    
    192
    +
    
    193
    +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'element-path'))
    
    194
    +def test_element_path_project_path_contains_symlinks(cli, datafiles, tmpdir):
    
    195
    +    real_project = str(datafiles)
    
    196
    +    linked_project = os.path.join(str(tmpdir), 'linked')
    
    197
    +    os.symlink(real_project, linked_project)
    
    198
    +    os.makedirs(os.path.join(real_project, 'elements'), exist_ok=True)
    
    199
    +    with open(os.path.join(real_project, 'elements', 'element.bst'), 'w') as f:
    
    200
    +        f.write("kind: manual\n")
    
    201
    +    result = cli.run(project=linked_project, args=['show', 'element.bst'])
    
    202
    +    result.assert_success()



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]