diff options
author | Javier Jardón <jjardon@gnome.org> | 2019-09-12 12:56:09 +0100 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2019-09-12 13:54:48 +0100 |
commit | e27dffd2e5003020e7cad13160b4f5311898ceba (patch) | |
tree | a624f4a3d98e96a8afa39e5fc18e496fb1c93218 /src/buildstream/_project.py | |
parent | 38c620928fc0547f613a2e4c4f7f894c5c8172e2 (diff) | |
download | buildstream-e27dffd2e5003020e7cad13160b4f5311898ceba.tar.gz |
Fail if we try to build a BST_FORMAT_VERSION we do not support anymorejjardon/BST_FORMAT_VERSION
bst-1.x support BST_FORMAT_VERSION == 17, as that is not supported by
master I think is ok to set BST_FORMAT_VERSION_MIN = 18
Diffstat (limited to 'src/buildstream/_project.py')
-rw-r--r-- | src/buildstream/_project.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py index ceba4c44b..6ae8aa9db 100644 --- a/src/buildstream/_project.py +++ b/src/buildstream/_project.py @@ -39,6 +39,7 @@ from ._sourcefactory import SourceFactory from .types import CoreWarnings from ._projectrefs import ProjectRefs, ProjectRefStorage from ._versions import BST_FORMAT_VERSION +from ._versions import BST_FORMAT_VERSION_MIN from ._loader import Loader from .element import Element from .types import FastEnum @@ -590,6 +591,13 @@ class Project(): # Assert project's format version early, before validating toplevel keys format_version = pre_config_node.get_int('format-version') + if format_version < BST_FORMAT_VERSION_MIN: + major, minor = utils.get_bst_version() + raise LoadError( + "Project requested format version {}, but BuildStream {}.{} only supports format version {} or above." + "Use latest 1.x release" + .format(format_version, major, minor, BST_FORMAT_VERSION_MIN), LoadErrorReason.UNSUPPORTED_PROJECT) + if BST_FORMAT_VERSION < format_version: major, minor = utils.get_bst_version() raise LoadError( |