BuildStream installs using the git repo without tags, but doesn't work

Summary

I installed BuildStream from my own local mirror, but git tags were stripped. When tried, bst (build) failed to work, complaining via this function at the following line:

# buildstream/utils.py
    if versions[0] == '0+untagged':
        raise UtilError("Your git repository has no tags - BuildStream can't "
                        "determine its version. Please run `git fetch --tags`.")

The issue is I was surprised when it allowed me to install in the first place.

Steps to reproduce

git clone https://gitlab.com/BuildStream/buildstream.git
do git-fu to remove tags
pip3 install -e . # -e can be omitted..

bst build # fails

What is the current bug behavior?

See above: It installs but fails to work.

What is the expected correct behavior?

Fails to install or warn user about what'd be not available.

Possible fixes

Assuming that version-checking logic won't go away soon and it is in the heart of Project loading, doing a check at install time and fail (or show a serious warning) to user to say "bst build, .. etc won't be available" could be good.

  • BuildStream version affected: /milestone %BuildStream_v1.x