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 | |
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')
-rw-r--r-- | src/buildstream/_project.py | 8 | ||||
-rw-r--r-- | src/buildstream/_versions.py | 6 | ||||
-rw-r--r-- | src/buildstream/data/projectconfig.yaml | 4 |
3 files changed, 16 insertions, 2 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( diff --git a/src/buildstream/_versions.py b/src/buildstream/_versions.py index 2270bc05a..ad749865d 100644 --- a/src/buildstream/_versions.py +++ b/src/buildstream/_versions.py @@ -25,6 +25,12 @@ # BST_FORMAT_VERSION = 25 +# The mimimum BuildStream format version supported +# +# This version is the minimum format version supported by the +# current buildstream version +# +BST_FORMAT_VERSION_MIN = 18 # The base BuildStream artifact version # diff --git a/src/buildstream/data/projectconfig.yaml b/src/buildstream/data/projectconfig.yaml index ee4055cf5..d84edbf92 100644 --- a/src/buildstream/data/projectconfig.yaml +++ b/src/buildstream/data/projectconfig.yaml @@ -4,8 +4,8 @@ # General configuration defaults # -# Require format version 0 -format-version: 0 +# Require format version 18 +format-version: 18 # Elements are found at the project root element-path: . |