Skip to content

./foo.bst and foo.bst produce different element hashes #2132

Description

@kotborealis

Buildstream appears to treat an element path with a leading ./ differently from the same path without it.

Reproducer, using tests/elements/filter/basic:

$ bst show input.bst
   ...
   buildable 110d3798d21e046c9aebbc51a1a3465655f0be1d0f44646b8c0557d724d253cb./input.bst

$ bst show ./input.bst
...
   buildable 55aa30d77816a4056a0b9a2b4f8265d70675aa7afd9de5f71f01d02d76832f22input.bst

It looks wrong, because semantically they are the same element.

It gets worse with combinations of other commands. If I build input.bst, ./input.bst is not considered built.

$ bst build input.bst

$ bst show ./input.bst
...
   buildable 55aa30d77816a4056a0b9a2b4f8265d70675aa7afd9de5f71f01d02d76832f22 ./input.bst

$ bst show input.bst
      cached 110d3798d21e046c9aebbc51a1a3465655f0be1d0f44646b8c0557d724d253cb input.bst

This leads to confusing moments, like bst build input.bst && bst artifact checkout ./input.bst. It looks the same to the user, but buildstream complains that element is not built.

Found it while messing with junctions:

$ bst show --deps none --format '%{name}||%{state}' my/junction.bst
my/junction.bst||junction
./my/junction.bst||no reference

BuildStream could not resolve ./my/junction.bst as junction and complains about missing ref.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions