summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2020-04-24 16:31:17 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2020-04-24 16:31:17 +0000
commit0307e55dcf0ae7155fa9d9d08a847957f0877545 (patch)
tree618aa1cb32c34dbdbf117824ffbfa45a0d5a051f
parentbacc060cfcf32cdb696ce1a3ef195ea9bed0d8c1 (diff)
parentfe3b3f5fa9bb11cdee451d5169808edfa9a15cd6 (diff)
downloadbuildstream-0307e55dcf0ae7155fa9d9d08a847957f0877545.tar.gz
Merge branch 'tristan/min-version' into 'master'
Replace format-version with min-version See merge request BuildStream/buildstream!1881
-rw-r--r--NEWS3
-rw-r--r--doc/examples/autotools/project.conf4
-rw-r--r--doc/examples/composition/project.conf4
-rw-r--r--doc/examples/developing/project.conf4
-rw-r--r--doc/examples/directives/project.conf4
-rw-r--r--doc/examples/filtering/project.conf4
-rw-r--r--doc/examples/first-project/project.conf4
-rw-r--r--doc/examples/flatpak-autotools/project.conf2
-rw-r--r--doc/examples/integration-commands/project.conf4
-rw-r--r--doc/examples/junction-includes/project.conf2
-rw-r--r--doc/examples/junction-includes/subproject/project.conf2
-rw-r--r--doc/examples/junctions/autotools/project.conf4
-rw-r--r--doc/examples/junctions/project.conf4
-rw-r--r--doc/examples/overlaps/project.conf4
-rw-r--r--doc/examples/running-commands/project.conf4
-rw-r--r--doc/examples/strict-mode/project.conf4
-rw-r--r--doc/source/format_declaring.rst20
-rw-r--r--doc/source/format_intro.rst4
-rw-r--r--doc/source/format_project.rst77
-rw-r--r--doc/source/hacking/writing_plugins.rst15
-rw-r--r--src/buildstream/_frontend/app.py93
-rw-r--r--src/buildstream/_frontend/cli.py25
-rw-r--r--src/buildstream/_project.py91
-rw-r--r--src/buildstream/_versions.py15
-rw-r--r--src/buildstream/buildelement.py11
-rw-r--r--src/buildstream/data/projectconfig.yaml3
-rw-r--r--src/buildstream/exceptions.py2
-rw-r--r--src/buildstream/plugin.py4
-rw-r--r--src/buildstream/plugins/elements/filter.py21
-rw-r--r--src/buildstream/plugins/elements/junction.py8
-rw-r--r--src/buildstream/plugins/sources/git.py8
-rw-r--r--src/buildstream/plugins/sources/pip.py4
-rw-r--r--src/buildstream/plugins/sources/remote.py4
-rw-r--r--src/buildstream/testing/_sourcetests/mirror.py4
-rw-r--r--src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf2
-rw-r--r--src/buildstream/testing/_sourcetests/project/project.conf1
-rw-r--r--src/buildstream/testing/_sourcetests/track_cross_junction.py2
-rw-r--r--src/buildstream/testing/_yaml.py2
-rw-r--r--src/buildstream/utils.py57
-rw-r--r--tests/artifactcache/config.py13
-rw-r--r--tests/artifactcache/expiry/project.conf1
-rw-r--r--tests/artifactcache/junctions/parent/base/project.conf1
-rw-r--r--tests/artifactcache/junctions/parent/project.conf1
-rw-r--r--tests/artifactcache/project/project.conf2
-rw-r--r--tests/cachekey/cachekey.py2
-rw-r--r--tests/cachekey/project/project.conf1
-rw-r--r--tests/elements/filter.py5
-rw-r--r--tests/elements/filter/basic/project.conf1
-rw-r--r--tests/format/assertion/project.conf1
-rw-r--r--tests/format/dependencies1/project.conf1
-rw-r--r--tests/format/dependencies2/project.conf1
-rw-r--r--tests/format/dependencies3/project.conf1
-rw-r--r--tests/format/include.py4
-rw-r--r--tests/format/include/conditional/project.conf1
-rw-r--r--tests/format/include/eventual_overrides/project.conf1
-rw-r--r--tests/format/include/file/project.conf1
-rw-r--r--tests/format/include/file_with_subproject/project.conf1
-rw-r--r--tests/format/include/file_with_subproject/subproject/project.conf1
-rw-r--r--tests/format/include/inner/project.conf1
-rw-r--r--tests/format/include/junction/project.conf1
-rw-r--r--tests/format/include/junction/subproject/project.conf1
-rw-r--r--tests/format/include/junction_options/project.conf1
-rw-r--r--tests/format/include/junction_options/subproject/project.conf1
-rw-r--r--tests/format/include/junction_options_deep/project.conf1
-rw-r--r--tests/format/include/junction_options_deep/subproject-1/project.conf1
-rw-r--r--tests/format/include/junction_options_deep/subproject-2/project.conf1
-rw-r--r--tests/format/include/junction_options_element/project.conf1
-rw-r--r--tests/format/include/junction_options_element/subproject/project.conf1
-rw-r--r--tests/format/include/local_to_junction/project.conf1
-rw-r--r--tests/format/include/local_to_junction/subproject/project.conf1
-rw-r--r--tests/format/include/options/project.conf1
-rw-r--r--tests/format/include/overrides-junction/project.conf1
-rw-r--r--tests/format/include/overrides-junction/subproject/project.conf1
-rw-r--r--tests/format/include/overrides/project.conf1
-rw-r--r--tests/format/include/overrides/subproject/project.conf1
-rw-r--r--tests/format/include/recursive/project.conf1
-rw-r--r--tests/format/include/string/project.conf1
-rw-r--r--tests/format/include/sub-include/project.conf1
-rw-r--r--tests/format/include_composition.py2
-rw-r--r--tests/format/invalid-keys/project.conf1
-rw-r--r--tests/format/junctions/bar/project.conf1
-rw-r--r--tests/format/junctions/base/project.conf1
-rw-r--r--tests/format/junctions/config-target/project.conf1
-rw-r--r--tests/format/junctions/config-target/subproject/project.conf1
-rw-r--r--tests/format/junctions/config-target/subproject/subsubproject/project.conf1
-rw-r--r--tests/format/junctions/conflict/project.conf1
-rw-r--r--tests/format/junctions/foo/project.conf1
-rw-r--r--tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf3
-rw-r--r--tests/format/junctions/inconsistent-names/junctionA/project.conf3
-rw-r--r--tests/format/junctions/inconsistent-names/project.conf3
-rw-r--r--tests/format/junctions/invalid/project.conf1
-rw-r--r--tests/format/junctions/missing-element/junctionA/junctionB/project.conf1
-rw-r--r--tests/format/junctions/missing-element/junctionA/project.conf1
-rw-r--r--tests/format/junctions/missing-element/project.conf1
-rw-r--r--tests/format/junctions/nested/project.conf1
-rw-r--r--tests/format/junctions/options-base/project.conf1
-rw-r--r--tests/format/junctions/options-default/project.conf1
-rw-r--r--tests/format/junctions/options-inherit/project.conf1
-rw-r--r--tests/format/junctions/options/project.conf1
-rw-r--r--tests/format/junctions/toplevel/project.conf1
-rw-r--r--tests/format/list-directive-error-element/project.conf1
-rw-r--r--tests/format/list-directive-error-project/project.conf1
-rw-r--r--tests/format/list-directive-type-error/project.conf1
-rw-r--r--tests/format/option-arch-alias/project.conf1
-rw-r--r--tests/format/option-arch-unknown/project.conf1
-rw-r--r--tests/format/option-arch/project.conf1
-rw-r--r--tests/format/option-bool/project.conf1
-rw-r--r--tests/format/option-element-mask-invalid/project.conf1
-rw-r--r--tests/format/option-element-mask/project.conf1
-rw-r--r--tests/format/option-enum-missing/project.conf1
-rw-r--r--tests/format/option-enum/project.conf1
-rw-r--r--tests/format/option-exports/project.conf1
-rw-r--r--tests/format/option-flags-missing/project.conf1
-rw-r--r--tests/format/option-flags/project.conf1
-rw-r--r--tests/format/option-list-directive/project.conf1
-rw-r--r--tests/format/option-os/project.conf1
-rw-r--r--tests/format/option-overrides/project.conf1
-rw-r--r--tests/format/options/compound-and-condition/project.conf1
-rw-r--r--tests/format/options/compound-or-condition/project.conf1
-rw-r--r--tests/format/options/deep-nesting/project.conf1
-rw-r--r--tests/format/options/invalid-condition/project.conf1
-rw-r--r--tests/format/options/invalid-expression/project.conf1
-rw-r--r--tests/format/options/invalid-name-dashes/project.conf1
-rw-r--r--tests/format/options/invalid-name-leading-number/project.conf1
-rw-r--r--tests/format/options/invalid-name-plus/project.conf1
-rw-r--r--tests/format/options/invalid-name-spaces/project.conf1
-rw-r--r--tests/format/options/invalid-type/project.conf1
-rw-r--r--tests/format/options/invalid-variable-name-plus/project.conf1
-rw-r--r--tests/format/options/invalid-variable-name-spaces/project.conf1
-rw-r--r--tests/format/options/nested-condition/project.conf1
-rw-r--r--tests/format/options/simple-condition/project.conf1
-rw-r--r--tests/format/options/undefined-variable/project.conf1
-rw-r--r--tests/format/project-overrides/prepend-configure-commands/project.conf1
-rw-r--r--tests/format/project.py1
-rw-r--r--tests/format/project/default/project.conf1
-rw-r--r--tests/format/project/duplicate-plugins/project.conf1
-rw-r--r--tests/format/project/element-path/project.conf1
-rw-r--r--tests/format/project/empty-depends/project.conf1
-rw-r--r--tests/format/project/emptyname/project.conf1
-rw-r--r--tests/format/project/invalid-yaml/project.conf1
-rw-r--r--tests/format/project/invalidname/project.conf1
-rw-r--r--tests/format/project/local-plugin/project.conf1
-rw-r--r--tests/format/project/missing-element/project.conf1
-rw-r--r--tests/format/project/missing-junction/project.conf1
-rw-r--r--tests/format/project/overridepath/project.conf1
-rw-r--r--tests/format/project/plugin-allowed/project.conf1
-rw-r--r--tests/format/project/plugin-forbidden/project.conf1
-rw-r--r--tests/format/project/plugin-preflight-error/project.conf1
-rw-r--r--tests/format/project/project-from-subdir/project.conf1
-rw-r--r--tests/format/project/refs-options/project.conf1
-rw-r--r--tests/format/project/unsupported/project.conf2
-rw-r--r--tests/format/variables.py4
-rw-r--r--tests/format/variables/cyclic_variables/project.conf1
-rw-r--r--tests/format/variables/defaults/project.conf1
-rw-r--r--tests/format/variables/missing_variables/project.conf1
-rw-r--r--tests/format/variables/overrides/project.conf1
-rw-r--r--tests/format/variables/protected-vars/project.conf1
-rw-r--r--tests/frontend/__init__.py1
-rw-r--r--tests/frontend/buildcheckout.py1
-rw-r--r--tests/frontend/completions/no-element-path/project.conf1
-rw-r--r--tests/frontend/completions/project/project.conf2
-rw-r--r--tests/frontend/completions/sub-folders/project.conf2
-rw-r--r--tests/frontend/configurable_warnings.py1
-rw-r--r--tests/frontend/configuredwarning/project.conf1
-rw-r--r--tests/frontend/consistencyerror/project.conf1
-rw-r--r--tests/frontend/cross_junction_workspace.py4
-rw-r--r--tests/frontend/default-target/files/sub-project/project.conf2
-rw-r--r--tests/frontend/default-target/project.conf2
-rw-r--r--tests/frontend/default_target.py4
-rw-r--r--tests/frontend/exceptions/project.conf1
-rw-r--r--tests/frontend/init.py39
-rw-r--r--tests/frontend/interactive_init.py30
-rw-r--r--tests/frontend/invalid_element_path/project.conf2
-rw-r--r--tests/frontend/mirror.py5
-rw-r--r--tests/frontend/overlaps.py2
-rw-r--r--tests/frontend/project/files/sub-project/project.conf2
-rw-r--r--tests/frontend/project/files/sub2-project/project.conf2
-rw-r--r--tests/frontend/project/project.conf2
-rw-r--r--tests/frontend/project_fail/project.conf2
-rw-r--r--tests/frontend/pull.py1
-rw-r--r--tests/frontend/push.py1
-rw-r--r--tests/frontend/strict-depends/project.conf1
-rw-r--r--tests/frontend/track-cross-junction/subproject/project.conf1
-rw-r--r--tests/frontend/track-optional-inline/project.conf2
-rw-r--r--tests/frontend/track-optional-project-refs/project.conf1
-rw-r--r--tests/frontend/track.py2
-rw-r--r--tests/frontend/workspaced-build-dep/project.conf4
-rw-r--r--tests/frontend/workspaced-runtime-dep/project.conf4
-rw-r--r--tests/integration/project/project.conf1
-rw-r--r--tests/internals/loader/onefile/project.conf1
-rw-r--r--tests/internals/pluginloading/badversionelement/project.conf1
-rw-r--r--tests/internals/pluginloading/badversionsource/project.conf1
-rw-r--r--tests/internals/pluginloading/customelement/project.conf1
-rw-r--r--tests/internals/pluginloading/customsource/project.conf1
-rw-r--r--tests/plugins/deprecationwarnings/project/project.conf4
-rw-r--r--tests/remoteexecution/project/files/sub-project/project.conf1
-rw-r--r--tests/remoteexecution/project/project.conf1
-rw-r--r--tests/sandboxes/missing-command/project.conf1
-rwxr-xr-xtests/sandboxes/missing-dependencies/project.conf2
-rw-r--r--tests/sandboxes/project/project.conf1
-rw-r--r--tests/sourcecache/project/project.conf1
-rw-r--r--tests/sources/bzr/project.conf1
-rw-r--r--tests/sources/git/project-override/project.conf1
-rw-r--r--tests/sources/git/template/project.conf1
-rw-r--r--tests/sources/local/basic/project.conf1
-rw-r--r--tests/sources/local/directory/project.conf1
-rw-r--r--tests/sources/local/file-exists/project.conf1
-rw-r--r--tests/sources/local/invalid-relative-path/project.conf1
-rw-r--r--tests/sources/local/symlink/project.conf1
-rw-r--r--tests/sources/no-fetch-cached/project.conf1
-rw-r--r--tests/sources/patch/basic/project.conf1
-rw-r--r--tests/sources/patch/different-strip-level/project.conf1
-rw-r--r--tests/sources/patch/invalid-relative-path/project.conf1
-rw-r--r--tests/sources/patch/multiple-patches/project.conf1
-rw-r--r--tests/sources/patch/separate-patch-dir/project.conf1
-rw-r--r--tests/sources/previous_source_access/project.conf1
-rw-r--r--tests/sources/project_key_test/project.conf1
217 files changed, 508 insertions, 331 deletions
diff --git a/NEWS b/NEWS
index 95bcb2e00..84a7a6bf7 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,9 @@ Core
through junctions are evaluated with the options defined in the
sub project the file comes from.
+ o BREAKING CHANGE: "format-version" is removed and replaced with "min-version",
+ which is now required to be specified in project.conf.
+
==================
buildstream 1.93.1
==================
diff --git a/doc/examples/autotools/project.conf b/doc/examples/autotools/project.conf
index 6c1142340..49c22e925 100644
--- a/doc/examples/autotools/project.conf
+++ b/doc/examples/autotools/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: autotools
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/composition/project.conf b/doc/examples/composition/project.conf
index dc82df72b..7f5fbdac6 100644
--- a/doc/examples/composition/project.conf
+++ b/doc/examples/composition/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: composition
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/developing/project.conf b/doc/examples/developing/project.conf
index 3b0920991..0182d1d5c 100644
--- a/doc/examples/developing/project.conf
+++ b/doc/examples/developing/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: developing
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/directives/project.conf b/doc/examples/directives/project.conf
index c078a5af8..8cf4c42b5 100644
--- a/doc/examples/directives/project.conf
+++ b/doc/examples/directives/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: directives
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/filtering/project.conf b/doc/examples/filtering/project.conf
index 9a01a7515..cf7db0d87 100644
--- a/doc/examples/filtering/project.conf
+++ b/doc/examples/filtering/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: filtering
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/first-project/project.conf b/doc/examples/first-project/project.conf
index f66376146..d62fc6c12 100644
--- a/doc/examples/first-project/project.conf
+++ b/doc/examples/first-project/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: first-project
-# Required BuildStream format version
-format-version: 25
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/flatpak-autotools/project.conf b/doc/examples/flatpak-autotools/project.conf
index 1318014f9..08dc6ee32 100644
--- a/doc/examples/flatpak-autotools/project.conf
+++ b/doc/examples/flatpak-autotools/project.conf
@@ -1,5 +1,7 @@
name: flatpak-autotools
+min-version: 2.0
+
aliases:
flathub: https://dl.flathub.org/
diff --git a/doc/examples/integration-commands/project.conf b/doc/examples/integration-commands/project.conf
index c6c59906b..63d50264c 100644
--- a/doc/examples/integration-commands/project.conf
+++ b/doc/examples/integration-commands/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: integration-commands
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/junction-includes/project.conf b/doc/examples/junction-includes/project.conf
index e591b78b1..9d1e6f1e9 100644
--- a/doc/examples/junction-includes/project.conf
+++ b/doc/examples/junction-includes/project.conf
@@ -1,5 +1,5 @@
name: subproject
-format-version: 18
+min-version: 2.0
element-path: elements
aliases:
diff --git a/doc/examples/junction-includes/subproject/project.conf b/doc/examples/junction-includes/subproject/project.conf
index d9387f244..827e0fb4d 100644
--- a/doc/examples/junction-includes/subproject/project.conf
+++ b/doc/examples/junction-includes/subproject/project.conf
@@ -1,5 +1,5 @@
name: subproject
-format-version: 18
+min-version: 2.0
element-path: elements
aliases:
diff --git a/doc/examples/junctions/autotools/project.conf b/doc/examples/junctions/autotools/project.conf
index 216816335..8c0d0a337 100644
--- a/doc/examples/junctions/autotools/project.conf
+++ b/doc/examples/junctions/autotools/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: autotools
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/junctions/project.conf b/doc/examples/junctions/project.conf
index cb9a83716..1a9973004 100644
--- a/doc/examples/junctions/project.conf
+++ b/doc/examples/junctions/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: junctions
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/overlaps/project.conf b/doc/examples/overlaps/project.conf
index 297077220..c54f79cde 100644
--- a/doc/examples/overlaps/project.conf
+++ b/doc/examples/overlaps/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: overlaps
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/running-commands/project.conf b/doc/examples/running-commands/project.conf
index aafb6a9f2..eb9f4012b 100644
--- a/doc/examples/running-commands/project.conf
+++ b/doc/examples/running-commands/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: running-commands
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/examples/strict-mode/project.conf b/doc/examples/strict-mode/project.conf
index ac73434c8..bd6836b44 100644
--- a/doc/examples/strict-mode/project.conf
+++ b/doc/examples/strict-mode/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: strict-mode
-# Required BuildStream format version
-format-version: 18
+# Minimum required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/doc/source/format_declaring.rst b/doc/source/format_declaring.rst
index 80365c6d5..6805c249b 100644
--- a/doc/source/format_declaring.rst
+++ b/doc/source/format_declaring.rst
@@ -124,10 +124,6 @@ The above code snippet is equivalent to:
See :ref:`format_dependencies` for more information on the dependency model.
-.. note::
-
- The ``build-depends`` configuration is available since :ref:`format version 14 <project_format_version>`
-
.. _format_runtime_depends:
@@ -155,10 +151,6 @@ The above code snippet is equivalent to:
See :ref:`format_dependencies` for more information on the dependency model.
-.. note::
-
- The ``runtime-depends`` configuration is available since :ref:`format version 14 <project_format_version>`
-
.. _format_sources:
@@ -331,10 +323,6 @@ field in the ``Command`` uploaded. Whether this actually results in a building
the element for the desired OS and architecture is dependent on the server
having implemented these options the same as buildstream.
-.. note::
-
- The ``sandbox`` configuration is available since :ref:`format version 6 <project_format_version>`
-
.. _format_dependencies:
@@ -397,10 +385,6 @@ Attributes:
See :mod:`junction <elements.junction>`.
- .. note::
-
- The ``junction`` attribute is available since :ref:`format version 1 <project_format_version>`
-
* ``strict``
This attribute can be used to specify that this element should
@@ -442,10 +426,6 @@ attribute, like so:
raised. See :ref:`nested junctions <core_junction_nested>` for more details
on nested junctions.
-.. note::
-
- This shorthand is available since :ref:`format version 23 <project_format_version>`
-
.. _format_dependencies_types:
diff --git a/doc/source/format_intro.rst b/doc/source/format_intro.rst
index e8fe6007b..cc743451b 100644
--- a/doc/source/format_intro.rst
+++ b/doc/source/format_intro.rst
@@ -343,7 +343,3 @@ the previous one.
must be declared in the :ref:`project.conf <projectconf>` or in
included files which are local to the project declaring the
junction itself.
-
-.. note::
-
- The include directive is available since :ref:`format version 12 <project_format_version>`
diff --git a/doc/source/format_project.rst b/doc/source/format_project.rst
index 3ee91e0f9..65ca6c14d 100644
--- a/doc/source/format_project.rst
+++ b/doc/source/format_project.rst
@@ -42,34 +42,41 @@ of your project.
underscores, and may not start with a leading digit.
-.. _project_format_version:
+.. _project_min_version:
-Format version
-~~~~~~~~~~~~~~
+Minimum version
+~~~~~~~~~~~~~~~
The BuildStream format is guaranteed to be backwards compatible
-with any earlier releases. The project's minimum required format
-version of BuildStream can be specified in ``project.conf`` with
-the ``format-version`` field, e.g.:
+with any earlier minor point releases, which is to say that
+BuildStream 1.4 can read projects written for BuildStream 1.0,
+and that BuildStream 2.2 can read projects written for BuildStream 2.0.
+
+Projects are required to specify the minimum version of BuildStream
+which it requires, this allows project authors to convey a useful
+error message to their users and peers, in the case that a user needs
+to get a newer version of BuildStream in order to work with a given
+project.
+
+The project's minimum required BuildStream version must be specified
+in ``project.conf`` using the ``min-version`` field, e.g.:
.. code:: yaml
- # The minimum base BuildStream format
- format-version: 18
+ # This project uses features which were added in 2.2
+ min-version: 2.2
+
+It is recommended that when using new features, always consult this
+documentation and observe which BuildStream version a feature you are
+using was added in. If a feature in the BuildStream YAML format is
+not documented with a specific *Since* version, you can assume that
+it has been there from the beginning.
-BuildStream will increment its core YAML format version at least once
-in any given minor point release where the format has been extended
-to support a new feature.
.. note::
External :mod:`Element <buildstream.element>` and :mod:`Source <buildstream.source>`
plugins also implement their own YAML configuration fragments and as
- such are revisioned separately from the core format. See :ref:`project_plugins`
- for details on specifying a minimum version of a specific plugin.
-
- Core :mod:`Elements <buildstream.element>` and :mod:`Sources <buildstream.source>`
- which are maintained and distributed as a part of BuildStream are revisioned
- under the same global ``format-version`` described here.
+ such are revisioned separately from the core format.
.. _project_element_path:
@@ -120,10 +127,6 @@ following to your ``project.conf``:
ref-storage: project.refs
-.. note::
-
- The ``ref-storage`` configuration is available since :ref:`format version 8 <project_format_version>`
-
.. _configurable_warnings:
@@ -145,10 +148,6 @@ Individual warnings can be configured as fatal by setting ``fatal-warnings`` to
BuildStream provides a collection of :class:`Core Warnings <buildstream.types.CoreWarnings>` which may be raised
by a variety of plugins. Other configurable warnings are plugin specific and should be noted within their individual documentation.
-.. note::
-
- The ``fatal-warnings`` configuration is available since :ref:`format version 14 <project_format_version>`
-
.. _project_source_aliases:
@@ -179,10 +178,6 @@ for more detail.
build-uid: 1003
build-gid: 1001
-.. note::
-
- The ``sandbox`` configuration is available since :ref:`format version 6 <project_format_version>`
-
.. _project_essentials_artifacts:
@@ -373,10 +368,6 @@ A default mirror to consult first can be defined via
:ref:`user config <config_default_mirror>`, or the command-line argument
:ref:`--default-mirror <invoking_bst>`.
-.. note::
-
- The ``mirrors`` field is available since :ref:`format version 11 <project_format_version>`
-
.. _project_plugins:
@@ -852,10 +843,6 @@ specific configuration data as shown below.
config:
checkout-submodules: False
-.. note::
-
- The ``sources`` override is available since :ref:`format version 1 <project_format_version>`
-
.. _project_shell:
@@ -867,10 +854,6 @@ environment for debugging and testing applications may need some help.
The ``shell`` section allows some customization of the shell environment.
-.. note::
-
- The ``shell`` section is available since :ref:`format version 1 <project_format_version>`
-
Interactive shell command
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -903,10 +886,6 @@ which is expressed as a dictionary very similar to the
:ref:`default environment <project_defaults_environment>`, except that it
supports host side environment variable expansion in values.
-.. note::
-
- The ``environment`` configuration is available since :ref:`format version 4 <project_format_version>`
-
For example, to share your host ``DISPLAY`` and ``DBUS_SESSION_BUS_ADDRESS``
environments with debugging shells for your project, specify the following:
@@ -939,10 +918,6 @@ it can integrate better with the host environment.
The ``host-files`` configuration allows one to specify files and
directories on the host to be bind mounted into the sandbox.
-.. note::
-
- The ``host-files`` configuration is available since :ref:`format version 4 <project_format_version>`
-
.. warning::
One should never mount directories where one expects to
@@ -1052,10 +1027,6 @@ currently limited to a single target element and due to this, they currently
do not use project default targets. However, they still use the workspace
element as default target when run from a workspace directory.
-.. note::
-
- The ``targets`` configuration is available since :ref:`format version 21 <project_format_version>`
-
.. _project_builtin_defaults:
diff --git a/doc/source/hacking/writing_plugins.rst b/doc/source/hacking/writing_plugins.rst
index cecd79053..8425425bf 100644
--- a/doc/source/hacking/writing_plugins.rst
+++ b/doc/source/hacking/writing_plugins.rst
@@ -17,21 +17,6 @@ documentation of your plugin automatically.
Whenever adding a new plugin, you must add an entry for it in ``doc/source/core_plugins.rst``.
-Bump format version
-~~~~~~~~~~~~~~~~~~~
-In order for projects to assert that they have a new enough version
-of BuildStream to use the new plugin, the ``BST_FORMAT_VERSION`` must
-be incremented in the ``_versions.py`` file.
-
-Remember to include in your plugin's main documentation, the format
-version in which the plugin was introduced, using the standard annotation
-which we use throughout the documentation, e.g.::
-
- .. note::
-
- The ``foo`` plugin is available since :ref:`format version 16 <project_format_version>`
-
-
Add tests
~~~~~~~~~
Needless to say, all new feature additions need to be tested. For ``Element``
diff --git a/src/buildstream/_frontend/app.py b/src/buildstream/_frontend/app.py
index baf75c05d..8d4dd34b1 100644
--- a/src/buildstream/_frontend/app.py
+++ b/src/buildstream/_frontend/app.py
@@ -36,9 +36,10 @@ from .._exceptions import BstError, StreamError, LoadError, AppError
from ..exceptions import LoadErrorReason
from .._message import Message, MessageType, unconditional_messages
from .._stream import Stream
-from .._versions import BST_FORMAT_VERSION
from ..types import _SchedulerErrorAction
from .. import node
+from .. import utils
+from ..utils import UtilError
# Import frontend assets
from .profile import Profile
@@ -357,18 +358,13 @@ class App:
#
# Args:
# project_name (str): The project name, must be a valid symbol name
- # format_version (int): The project format version, default is the latest version
+ # min_version (str): The minimum required version of BuildStream (default is current version)
# element_path (str): The subdirectory to store elements in, default is 'elements'
# force (bool): Allow overwriting an existing project.conf
# target_directory (str): The target directory the project should be initialized in
#
def init_project(
- self,
- project_name,
- format_version=BST_FORMAT_VERSION,
- element_path="elements",
- force=False,
- target_directory=None,
+ self, project_name, min_version=None, element_path="elements", force=False, target_directory=None,
):
if target_directory:
directory = os.path.abspath(target_directory)
@@ -378,6 +374,10 @@ class App:
project_path = os.path.join(directory, "project.conf")
+ if min_version is None:
+ bst_major, bst_minor = utils.get_bst_version()
+ min_version = "{}.{}".format(bst_major, bst_minor)
+
try:
if self._set_project_dir:
raise AppError(
@@ -394,7 +394,7 @@ class App:
# If project name was specified, user interaction is not desired, just
# perform some validation and write the project.conf
node._assert_symbol_name(project_name, "project name")
- self._assert_format_version(format_version)
+ self._assert_min_version(min_version)
self._assert_element_path(element_path)
elif not self.interactive:
@@ -404,8 +404,8 @@ class App:
)
else:
# Collect the parameters using an interactive session
- project_name, format_version, element_path = self._init_project_interactive(
- project_name, format_version, element_path
+ project_name, min_version, element_path = self._init_project_interactive(
+ project_name, min_version, element_path
)
# Create the directory if it doesnt exist
@@ -429,8 +429,8 @@ class App:
f.write(
"# Unique project name\n"
+ "name: {}\n\n".format(project_name)
- + "# Required BuildStream format version\n"
- + "format-version: {}\n\n".format(format_version)
+ + "# Required BuildStream version\n"
+ + "min-version: {}\n\n".format(min_version)
+ "# Subdirectory where elements are stored\n"
+ "element-path: {}\n".format(element_path)
)
@@ -827,20 +827,19 @@ class App:
# Some validation routines for project initialization
#
- def _assert_format_version(self, format_version):
- message = "The version must be supported by this " + "version of buildstream (0 - {})\n".format(
- BST_FORMAT_VERSION
- )
+ def _assert_min_version(self, min_version):
+ bst_major, bst_minor = utils._get_bst_api_version()
+ message = "The minimum version must be a known version of BuildStream {}".format(bst_major)
- # Validate that it is an integer
+ # Validate the version format
try:
- number = int(format_version)
- except ValueError as e:
- raise AppError(message, reason="invalid-format-version") from e
+ min_version_major, min_version_minor = utils._parse_version(min_version)
+ except UtilError as e:
+ raise AppError(str(e), reason="invalid-min-version") from e
- # Validate that the specified version is supported
- if number < 0 or number > BST_FORMAT_VERSION:
- raise AppError(message, reason="invalid-format-version")
+ # Validate that this version can be loaded by the installed version of BuildStream
+ if min_version_major != bst_major or min_version_minor > bst_minor:
+ raise AppError(message, reason="invalid-min-version")
def _assert_element_path(self, element_path):
message = "The element path cannot be an absolute path or contain any '..' components\n"
@@ -864,15 +863,21 @@ class App:
#
# Args:
# project_name (str): The project name, must be a valid symbol name
- # format_version (int): The project format version, default is the latest version
+ # min_version (str): The minimum BuildStream version, default is the latest version
# element_path (str): The subdirectory to store elements in, default is 'elements'
#
# Returns:
# project_name (str): The user selected project name
- # format_version (int): The user selected format version
+ # min_version (int): The user selected minimum BuildStream version
# element_path (str): The user selected element path
#
- def _init_project_interactive(self, project_name, format_version=BST_FORMAT_VERSION, element_path="elements"):
+ def _init_project_interactive(self, project_name, min_version=None, element_path="elements"):
+
+ bst_major, bst_minor = utils._get_bst_api_version()
+
+ if min_version is None:
+ min_version = "{}.{}".format(bst_major, bst_minor)
+
def project_name_proc(user_input):
try:
node._assert_symbol_name(user_input, "project name")
@@ -881,9 +886,9 @@ class App:
raise UsageError(message) from e
return user_input
- def format_version_proc(user_input):
+ def min_version_proc(user_input):
try:
- self._assert_format_version(user_input)
+ self._assert_min_version(user_input)
except AppError as e:
raise UsageError(str(e)) from e
return user_input
@@ -927,17 +932,21 @@ class App:
project_name = click.prompt(self._content_profile.fmt("Project name"), value_proc=project_name_proc, err=True)
click.echo("", err=True)
- # Collect format version
- click.echo(self._content_profile.fmt("Select the minimum required format version for your project"), err=True)
- click.echo(self._format_profile.fmt("-----------------------------------------------------------"), err=True)
+ # Collect minimum BuildStream version
+ click.echo(
+ self._content_profile.fmt("Select the minimum required BuildStream version for your project"), err=True
+ )
+ click.echo(
+ self._format_profile.fmt("----------------------------------------------------------------"), err=True
+ )
click.echo("", err=True)
click.echo(
self._detail_profile.fmt(
w.fill(
- "The format version is used to provide users who build your project "
+ "The minimum version is used to provide users who build your project "
"with a helpful error message in the case that they do not have a recent "
- "enough version of BuildStream supporting all the features which your "
- "project might use."
+ "enough version of BuildStream to support all the features which your "
+ "project uses."
)
),
err=True,
@@ -946,19 +955,17 @@ class App:
click.echo(
self._detail_profile.fmt(
w.fill(
- "The lowest version allowed is 0, the currently installed version of BuildStream "
- "supports up to format version {}.".format(BST_FORMAT_VERSION)
+ "The lowest version allowed is {major}.0, the currently installed version of BuildStream is {major}.{minor}".format(
+ major=bst_major, minor=bst_minor
+ )
)
),
err=True,
)
click.echo("", err=True)
- format_version = click.prompt(
- self._content_profile.fmt("Format version"),
- value_proc=format_version_proc,
- default=format_version,
- err=True,
+ min_version = click.prompt(
+ self._content_profile.fmt("Minimum version"), value_proc=min_version_proc, default=min_version, err=True,
)
click.echo("", err=True)
@@ -991,7 +998,7 @@ class App:
self._content_profile.fmt("Element path"), value_proc=element_path_proc, default=element_path, err=True
)
- return (project_name, format_version, element_path)
+ return (project_name, min_version, element_path)
#
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 44bb99f92..522f15115 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -7,10 +7,9 @@ import shutil
import click
from .. import _yaml
from .._exceptions import BstError, LoadError, AppError
-from .._versions import BST_FORMAT_VERSION
from .complete import main_bashcomplete, complete_path, CompleteUnhandled
from ..types import _CacheBuildTrees, _SchedulerErrorAction, _PipelineSelection
-from ..utils import _get_compression, UtilError
+from ..utils import UtilError
##################################################################
@@ -414,12 +413,20 @@ def help_command(ctx, command):
##################################################################
# Init Command #
##################################################################
+def default_min_version():
+ from .. import utils
+
+ bst_major, bst_minor = utils._get_bst_api_version()
+
+ return "{}.{}".format(bst_major, bst_minor)
+
+
@cli.command(short_help="Initialize a new BuildStream project")
@click.option("--project-name", type=click.STRING, help="The project name to use")
@click.option(
- "--format-version",
- type=click.INT,
- default=BST_FORMAT_VERSION,
+ "--min-version",
+ type=click.STRING,
+ default=default_min_version(),
show_default=True,
help="The required format version",
)
@@ -433,7 +440,7 @@ def help_command(ctx, command):
@click.option("--force", "-f", is_flag=True, help="Allow overwriting an existing project.conf")
@click.argument("target-directory", nargs=1, required=False, type=click.Path(file_okay=False, writable=True))
@click.pass_obj
-def init(app, project_name, format_version, element_path, force, target_directory):
+def init(app, project_name, min_version, element_path, force, target_directory):
"""Initialize a new BuildStream project
Creates a new BuildStream project.conf in the project
@@ -442,7 +449,7 @@ def init(app, project_name, format_version, element_path, force, target_director
Unless `--project-name` is specified, this will be an
interactive session.
"""
- app.init_project(project_name, format_version, element_path, force, target_directory)
+ app.init_project(project_name, min_version, element_path, force, target_directory)
##################################################################
@@ -1226,6 +1233,8 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, compression,
When this command is executed from a workspace directory, the default
is to checkout the artifact of the workspace element.
"""
+ from .. import utils
+
if hardlinks and tar:
click.echo("ERROR: options --hardlinks and --tar conflict", err=True)
sys.exit(-1)
@@ -1249,7 +1258,7 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, compression,
else:
location = tar
try:
- inferred_compression = _get_compression(tar)
+ inferred_compression = utils._get_compression(tar)
except UtilError as e:
click.echo("ERROR: Invalid file extension given with '--tar': {}".format(e), err=True)
sys.exit(-1)
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 9e5d92b7c..3527d211f 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -26,6 +26,7 @@ from pluginbase import PluginBase
from . import utils
from . import _site
from . import _yaml
+from .utils import UtilError
from ._artifactelement import ArtifactElement
from ._profile import Topics, PROFILER
from ._exceptions import LoadError
@@ -39,8 +40,6 @@ from ._elementfactory import ElementFactory
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
@@ -336,7 +335,7 @@ class Project:
def _validate_node(self, node):
node.validate_keys(
[
- "format-version",
+ "min-version",
"element-path",
"variables",
"environment",
@@ -579,6 +578,72 @@ class Project:
return tuple(default_targets)
+ # _validate_version()
+ #
+ # Asserts that we have a BuildStream installation which is recent
+ # enough for the project required version
+ #
+ # Args:
+ # config_node (dict) - YaML node of the configuration file.
+ #
+ # Raises: LoadError if there was a problem with the project.conf
+ #
+ def _validate_version(self, config_node):
+
+ bst_major, bst_minor = utils._get_bst_api_version()
+
+ # Use a custom error message for the absence of the required "min-version"
+ # as this may be an indication that we are trying to load a BuildStream 1 project.
+ #
+ min_version_node = config_node.get_scalar("min-version", None)
+ if min_version_node.is_none():
+ p = config_node.get_provenance()
+ raise LoadError(
+ "{}: Dictionary did not contain expected key 'min-version'".format(p),
+ LoadErrorReason.INVALID_DATA,
+ #
+ # TODO: Provide a link to documentation on how to install
+ # BuildStream 1 in a venv
+ #
+ detail="If you are trying to use a BuildStream 1 project, "
+ + "please install BuildStream 1 to use this project.",
+ )
+
+ # Parse the project declared minimum required BuildStream version
+ min_version = min_version_node.as_str()
+ try:
+ min_version_major, min_version_minor = utils._parse_version(min_version)
+ except UtilError as e:
+ p = min_version_node.get_provenance()
+ raise LoadError(
+ "{}: {}\n".format(p, e),
+ LoadErrorReason.INVALID_DATA,
+ detail="The min-version must be specified as MAJOR.MINOR with "
+ + "numeric major and minor minimum required version numbers",
+ ) from e
+
+ # Future proofing, in case there is ever a BuildStream 3
+ if min_version_major != bst_major:
+ p = min_version_node.get_provenance()
+ raise LoadError(
+ "{}: Version mismatch".format(p),
+ LoadErrorReason.UNSUPPORTED_PROJECT,
+ detail="Project requires BuildStream {}, ".format(min_version_major)
+ + "but BuildStream {} is installed.\n".format(bst_major)
+ + "Please use BuildStream {} with this project.".format(min_version_major),
+ )
+
+ # Check minimal minor point requirement is satisfied
+ if min_version_minor > bst_minor:
+ p = min_version_node.get_provenance()
+ raise LoadError(
+ "{}: Version mismatch".format(p),
+ LoadErrorReason.UNSUPPORTED_PROJECT,
+ detail="Project requires at least BuildStream {}.{}, ".format(min_version_major, min_version_minor)
+ + "but BuildStream {}.{} is installed.\n".format(bst_major, bst_minor)
+ + "Please upgrade BuildStream.",
+ )
+
# _load():
#
# Loads the project configuration file in the project
@@ -606,24 +671,8 @@ class Project:
pre_config_node = self._default_config_node.clone()
self._project_conf._composite(pre_config_node)
- # 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(
- "Project requested format version {}, but BuildStream {}.{} only supports up until format version {}".format(
- format_version, major, minor, BST_FORMAT_VERSION
- ),
- LoadErrorReason.UNSUPPORTED_PROJECT,
- )
+ # Assert project's minimum required version early, before validating toplevel keys
+ self._validate_version(pre_config_node)
self._validate_node(pre_config_node)
diff --git a/src/buildstream/_versions.py b/src/buildstream/_versions.py
index ad749865d..f97560b4d 100644
--- a/src/buildstream/_versions.py
+++ b/src/buildstream/_versions.py
@@ -17,21 +17,6 @@
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
-
-# The base BuildStream format version
-#
-# This version is bumped whenever enhancements are made
-# to the `project.conf` format or the core element format.
-#
-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
#
# The artifact version changes whenever the cache key
diff --git a/src/buildstream/buildelement.py b/src/buildstream/buildelement.py
index 95b085eba..32b64a8ed 100644
--- a/src/buildstream/buildelement.py
+++ b/src/buildstream/buildelement.py
@@ -23,11 +23,11 @@ BuildElement - Abstract class for build elements
The BuildElement class is a convenience element one can derive from for
implementing the most common case of element.
+
.. _core_buildelement_builtins:
Built-in functionality
----------------------
-
The BuildElement base class provides built in functionality that could be
overridden by the individual plugins.
@@ -35,6 +35,7 @@ This section will give a brief summary of how some of the common features work,
some of them or the variables they use will be further detailed in the following
sections.
+
The `strip-binaries` variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The `strip-binaries` variable is by default **empty**. You need to use the
@@ -43,12 +44,14 @@ If you are targetting Linux, ones known to work are the ones used by the
`freedesktop-sdk <https://freedesktop-sdk.io/>`_, you can take a look to them in their
`project.conf <https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/freedesktop-sdk-18.08.21/project.conf#L74>`_
+
Location for running commands
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``command-subdir`` variable sets where the build commands will be executed,
if the directory does not exist it will be created, it is defined relative to
the buildroot.
+
Location for configuring the project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``conf-root`` is defined by default as ``.`` and is the location that
@@ -66,21 +69,19 @@ The current working directory when your configuration command is run will still
be wherever you set your ``command-subdir`` to be, regardless of where the
configure scripts are set with ``conf-root``.
-.. note::
-
- The ``conf-root`` variable is available since :ref:`format version 17 <project_format_version>`
Install Location
~~~~~~~~~~~~~~~~
-
You should not change the ``install-root`` variable as it is a special
writeable location in the sandbox but it is useful when writing custom
install instructions as it may need to be supplied as the ``DESTDIR``, please
see the :mod:`cmake <elements.cmake>` build element for example.
+
Abstract method implementations
-------------------------------
+
Element.configure_sandbox()
~~~~~~~~~~~~~~~~~~~~~~~~~~~
In :func:`Element.configure_sandbox() <buildstream.element.Element.configure_sandbox>`,
diff --git a/src/buildstream/data/projectconfig.yaml b/src/buildstream/data/projectconfig.yaml
index a2dc4ad9b..a2753c312 100644
--- a/src/buildstream/data/projectconfig.yaml
+++ b/src/buildstream/data/projectconfig.yaml
@@ -4,9 +4,6 @@
# General configuration defaults
#
-# Require format version 18
-format-version: 18
-
# Elements are found at the project root
element-path: .
diff --git a/src/buildstream/exceptions.py b/src/buildstream/exceptions.py
index 123e18d72..cc2bd6381 100644
--- a/src/buildstream/exceptions.py
+++ b/src/buildstream/exceptions.py
@@ -86,7 +86,7 @@ class LoadErrorReason(Enum):
"""
UNSUPPORTED_PROJECT = 7
- """BuildStream does not support the required project format version"""
+ """The project requires an incompatible BuildStream version"""
UNSUPPORTED_PLUGIN = 8
"""Project requires a newer version of a plugin than the one which was
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py
index 5c362aff6..2182f5a08 100644
--- a/src/buildstream/plugin.py
+++ b/src/buildstream/plugin.py
@@ -167,10 +167,6 @@ class Plugin:
Plugins are expected to maintain backward compatibility
in the format and configurations they expose. The versioning
is intended to track availability of new features only.
-
- For convenience, the format version for plugins maintained and
- distributed with BuildStream are revisioned with BuildStream's
- core format version :ref:`core format version <project_format_version>`.
"""
BST_PLUGIN_DEPRECATED = False
diff --git a/src/buildstream/plugins/elements/filter.py b/src/buildstream/plugins/elements/filter.py
index 71ed1f6cb..d5749ad2d 100644
--- a/src/buildstream/plugins/elements/filter.py
+++ b/src/buildstream/plugins/elements/filter.py
@@ -77,21 +77,14 @@ we can define the following filter, ``filter-foo.bst``:
kind: filter
# Declare the sole build-dependency of the filter element
- depends:
- - filename: import.bst
- type: build
+ build-depends:
+ - import.bst
# Declare a list of domains to include in the filter's artifact
config:
include:
- foo
-.. note::
-
- We can also specify build-dependencies with a 'build-depends' field which has been
- available since :ref:`format version 14 <project_format_version>`. See the
- :ref:`Build-Depends documentation <format_build_depends>` for more detail.
-
It should be noted that an 'empty' ``include:`` list would, by default, include all
split-rules specified in the parent element, which, in this example, would be the
files 'foo' and 'bar' (the file 'baz' was not covered by any split rules).
@@ -104,9 +97,8 @@ only contains the file 'foo') by declaring the following element, ``exclude-bar.
kind: filter
# Declare the sole build-dependency of the filter element
- depends:
- - filename: import.bst
- type: build
+ build-depends:
+ - import.bst
# Declare a list of domains to exclude in the filter's artifact
config:
@@ -123,9 +115,8 @@ which are not included as split rules we can define the following element, ``fil
kind: filter
# Declare the sole build-dependency of the filter element
- depends:
- - filename: import.bst
- type: build
+ build-depends:
+ - import.bst
# Filter out all files which are not declared as split rules
config:
diff --git a/src/buildstream/plugins/elements/junction.py b/src/buildstream/plugins/elements/junction.py
index f0fcdcdfd..46c4ddf68 100644
--- a/src/buildstream/plugins/elements/junction.py
+++ b/src/buildstream/plugins/elements/junction.py
@@ -66,14 +66,6 @@ Overview
.. note::
- The configuration option to allow specifying junction targets is available
- since :ref:`format version 24 <project_format_version>` and the configuration
- options allowing for junction project elements to interact with parent remotes
- or to completely ignore junction project remotes are available since
- :ref:`format version 25 <project_format_version>`.
-
-.. note::
-
Junction elements may not specify any dependencies as they are simply
links to other projects and are not in the dependency graph on their own.
diff --git a/src/buildstream/plugins/sources/git.py b/src/buildstream/plugins/sources/git.py
index d04ccfe1b..473166132 100644
--- a/src/buildstream/plugins/sources/git.py
+++ b/src/buildstream/plugins/sources/git.py
@@ -143,17 +143,9 @@ This plugin provides the following :ref:`configurable warnings <configurable_war
- ``git:unlisted-submodule`` - A submodule is present in the git repository but was not specified in
the source configuration and was not disabled for checkout.
- .. note::
-
- The ``git:unlisted-submodule`` warning is available since :ref:`format version 20 <project_format_version>`
-
- ``git:invalid-submodule`` - A submodule is specified in the source configuration but does not exist
in the repository.
- .. note::
-
- The ``git:invalid-submodule`` warning is available since :ref:`format version 20 <project_format_version>`
-
This plugin also utilises the following configurable :class:`core warnings <buildstream.types.CoreWarnings>`:
- :attr:`ref-not-in-track <buildstream.types.CoreWarnings.REF_NOT_IN_TRACK>` - The provided ref was not
diff --git a/src/buildstream/plugins/sources/pip.py b/src/buildstream/plugins/sources/pip.py
index c3af0f9cf..69c08e81f 100644
--- a/src/buildstream/plugins/sources/pip.py
+++ b/src/buildstream/plugins/sources/pip.py
@@ -62,10 +62,6 @@ Downloaded tarballs will be stored in a directory called ".bst_pip_downloads".
See :ref:`built-in functionality doumentation <core_source_builtins>` for
details on common configuration options for sources.
-
-.. note::
-
- The ``pip`` plugin is available since :ref:`format version 16 <project_format_version>`
"""
import hashlib
diff --git a/src/buildstream/plugins/sources/remote.py b/src/buildstream/plugins/sources/remote.py
index da1a1f964..29333c0d9 100644
--- a/src/buildstream/plugins/sources/remote.py
+++ b/src/buildstream/plugins/sources/remote.py
@@ -46,10 +46,6 @@ remote - stage files from remote urls
See :ref:`built-in functionality doumentation <core_source_builtins>` for
details on common configuration options for sources.
-
-.. note::
-
- The ``remote`` plugin is available since :ref:`format version 10 <project_format_version>`
"""
import os
from buildstream import SourceError, utils
diff --git a/src/buildstream/testing/_sourcetests/mirror.py b/src/buildstream/testing/_sourcetests/mirror.py
index de05b894c..69042747c 100644
--- a/src/buildstream/testing/_sourcetests/mirror.py
+++ b/src/buildstream/testing/_sourcetests/mirror.py
@@ -156,7 +156,7 @@ def test_mirror_from_includes(cli, tmpdir, datafiles, kind):
config_project_dir = str(tmpdir.join("config"))
os.makedirs(config_project_dir, exist_ok=True)
- config_project = {"name": "config"}
+ config_project = {"name": "config", "min-version": "2.0"}
_yaml.roundtrip_dump(config_project, os.path.join(config_project_dir, "project.conf"))
extra_mirrors = {"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}]}
_yaml.roundtrip_dump(extra_mirrors, os.path.join(config_project_dir, "mirrors.yml"))
@@ -199,7 +199,7 @@ def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind):
config_project_dir = str(tmpdir.join("config"))
os.makedirs(config_project_dir, exist_ok=True)
- config_project = {"name": "config"}
+ config_project = {"name": "config", "min-version": "2.0"}
_yaml.roundtrip_dump(config_project, os.path.join(config_project_dir, "project.conf"))
extra_mirrors = {"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}]}
_yaml.roundtrip_dump(extra_mirrors, os.path.join(config_project_dir, "mirrors.yml"))
diff --git a/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf b/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf
index bbb8414a3..74cfd2583 100644
--- a/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf
+++ b/src/buildstream/testing/_sourcetests/project/files/sub-project/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: subtest
-
+min-version: 2.0
element-path: elements
diff --git a/src/buildstream/testing/_sourcetests/project/project.conf b/src/buildstream/testing/_sourcetests/project/project.conf
index 05b68bfeb..22fe9477f 100644
--- a/src/buildstream/testing/_sourcetests/project/project.conf
+++ b/src/buildstream/testing/_sourcetests/project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: test
+min-version: 2.0
element-path: elements
aliases:
alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
diff --git a/src/buildstream/testing/_sourcetests/track_cross_junction.py b/src/buildstream/testing/_sourcetests/track_cross_junction.py
index 2477b37ee..2c4141936 100644
--- a/src/buildstream/testing/_sourcetests/track_cross_junction.py
+++ b/src/buildstream/testing/_sourcetests/track_cross_junction.py
@@ -68,7 +68,7 @@ def generate_project(tmpdir, name, kind, config=None):
subproject_path = os.path.join(str(tmpdir.join(project_name)))
os.makedirs(os.path.join(subproject_path, "elements"))
- project_conf = {"name": name, "element-path": "elements"}
+ project_conf = {"name": name, "min-version": "2.0", "element-path": "elements"}
project_conf.update(config)
_yaml.roundtrip_dump(project_conf, os.path.join(subproject_path, "project.conf"))
add_plugins_conf(subproject_path, kind)
diff --git a/src/buildstream/testing/_yaml.py b/src/buildstream/testing/_yaml.py
index ccf65a1ae..0a16f3226 100644
--- a/src/buildstream/testing/_yaml.py
+++ b/src/buildstream/testing/_yaml.py
@@ -9,6 +9,8 @@ def generate_project(project_dir, config=None):
project_file = os.path.join(project_dir, "project.conf")
if "name" not in config:
config["name"] = os.path.basename(project_dir)
+ if "min-version" not in config:
+ config["min-version"] = "2.0"
roundtrip_dump(config, project_file)
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py
index 997c073b9..9f7690f7f 100644
--- a/src/buildstream/utils.py
+++ b/src/buildstream/utils.py
@@ -580,17 +580,9 @@ def get_bst_version() -> Tuple[int, int]:
)
try:
- return (int(versions[0]), int(versions[1]))
- except IndexError:
- raise UtilError(
- "Cannot detect Major and Minor parts of the version\n"
- "Version: {} not in XX.YY.whatever format".format(__version__)
- )
- except ValueError:
- raise UtilError(
- "Cannot convert version to integer numbers\n"
- "Version: {} not in Integer.Integer.whatever format".format(__version__)
- )
+ return _parse_version(__version__)
+ except UtilError as e:
+ raise UtilError("Failed to detect BuildStream version: {}\n".format(e)) from e
def move_atomic(source: Union[Path, str], destination: Union[Path, str], *, ensure_parents: bool = True) -> None:
@@ -1591,3 +1583,46 @@ def _is_single_threaded():
return True
time.sleep(wait)
return False
+
+
+# _parse_version():
+#
+# Args:
+# version (str): The file name from which to determine compression
+#
+# Returns:
+# A 2-tuple of form (major version, minor version)
+#
+# Raises:
+# UtilError: In the case of a malformed version string
+#
+def _parse_version(version: str) -> Tuple[int, int]:
+
+ versions = version.split(".")
+ try:
+ major = int(versions[0])
+ minor = int(versions[1])
+ except (IndexError, ValueError):
+ raise UtilError("Malformed version string: {}".format(version),)
+
+ return (major, minor)
+
+
+# _get_bst_api_version():
+#
+# Fetch the current BuildStream API version, this
+# ensures that we get "2.0" for example when we are
+# in a development stage leading up to 2.0.
+#
+# Returns:
+# A 2-tuple of form (major version, minor version)
+#
+def _get_bst_api_version() -> Tuple[int, int]:
+
+ bst_major, bst_minor = get_bst_version()
+
+ if bst_major < 2:
+ bst_major = 2
+ bst_minor = 0
+
+ return (bst_major, bst_minor)
diff --git a/tests/artifactcache/config.py b/tests/artifactcache/config.py
index a42d1e487..24d555860 100644
--- a/tests/artifactcache/config.py
+++ b/tests/artifactcache/config.py
@@ -116,6 +116,7 @@ def test_artifact_cache_precedence(tmpdir, override_caches, project_caches, user
# Produce a fake user and project config with the cache configuration.
user_config, project_config = configure_remote_caches(override_caches, project_caches, user_caches)
project_config["name"] = "test"
+ project_config["min-version"] = "2.0"
user_config_file = str(tmpdir.join("buildstream.conf"))
_yaml.roundtrip_dump(user_config, file=user_config_file)
@@ -179,6 +180,7 @@ def test_only_one(cli, datafiles, override_caches, project_caches, user_caches):
# Produce a fake user and project config with the cache configuration.
user_config, project_config = configure_remote_caches(override_caches, project_caches, user_caches)
project_config["name"] = "test"
+ project_config["min-version"] = "2.0"
cli.configure(user_config)
@@ -226,15 +228,12 @@ def test_paths_for_artifact_config_are_expanded(tmpdir, monkeypatch, artifacts_c
monkeypatch.setenv("HOME", str(tmpdir.join("homedir")))
+ project_config = {"name": "test", "min-version": "2.0"}
+ user_config = {}
if in_user_config:
- user_config = {"artifacts": artifacts_config}
- project_config = {"name": "test"}
+ user_config["artifacts"] = artifacts_config
else:
- user_config = {}
- project_config = {
- "name": "test",
- "artifacts": artifacts_config,
- }
+ project_config["artifacts"] = artifacts_config
user_config_file = str(tmpdir.join("buildstream.conf"))
_yaml.roundtrip_dump(user_config, file=user_config_file)
diff --git a/tests/artifactcache/expiry/project.conf b/tests/artifactcache/expiry/project.conf
index 18db7dab7..e70dae3c7 100644
--- a/tests/artifactcache/expiry/project.conf
+++ b/tests/artifactcache/expiry/project.conf
@@ -1,5 +1,6 @@
# Project config for cache expiry test
name: test
+min-version: 2.0
element-path: elements
aliases:
project_dir: file://{project_dir}
diff --git a/tests/artifactcache/junctions/parent/base/project.conf b/tests/artifactcache/junctions/parent/base/project.conf
index 951ea1a34..7e258e29f 100644
--- a/tests/artifactcache/junctions/parent/base/project.conf
+++ b/tests/artifactcache/junctions/parent/base/project.conf
@@ -1 +1,2 @@
name: base
+min-version: 2.0
diff --git a/tests/artifactcache/junctions/parent/project.conf b/tests/artifactcache/junctions/parent/project.conf
index 620fb42dc..30a3839a8 100644
--- a/tests/artifactcache/junctions/parent/project.conf
+++ b/tests/artifactcache/junctions/parent/project.conf
@@ -1 +1,2 @@
name: parent
+min-version: 2.0
diff --git a/tests/artifactcache/project/project.conf b/tests/artifactcache/project/project.conf
index 854e38693..5ba316874 100644
--- a/tests/artifactcache/project/project.conf
+++ b/tests/artifactcache/project/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
element-path: elements
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index b669bacaa..08870f2a0 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -196,7 +196,7 @@ def test_cache_key_fatal_warnings(cli, tmpdir, first_warnings, second_warnings,
# Builds project, Runs bst show, gathers cache keys
def run_get_cache_key(project_name, warnings):
- config = {"name": project_name, "element-path": "elements", "fatal-warnings": warnings}
+ config = {"name": project_name, "min-version": "2.0", "element-path": "elements", "fatal-warnings": warnings}
project_dir = tmpdir.mkdir(project_name)
project_config_file = str(project_dir.join("project.conf"))
diff --git a/tests/cachekey/project/project.conf b/tests/cachekey/project/project.conf
index 49726cdef..fb06907ed 100644
--- a/tests/cachekey/project/project.conf
+++ b/tests/cachekey/project/project.conf
@@ -1,2 +1,3 @@
# Project config for cache key test
name: cachekey
+min-version: 2.0
diff --git a/tests/elements/filter.py b/tests/elements/filter.py
index 2f16270d8..3bc24c20a 100644
--- a/tests/elements/filter.py
+++ b/tests/elements/filter.py
@@ -197,6 +197,7 @@ def test_filter_track(datafiles, cli, tmpdir):
project_config = {
"name": "filter-track-test",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
@@ -242,6 +243,7 @@ def test_filter_track_excepted(datafiles, cli, tmpdir):
project_config = {
"name": "filter-track-test",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
@@ -286,6 +288,7 @@ def test_filter_track_multi_to_one(datafiles, cli, tmpdir):
project_config = {
"name": "filter-track-test",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
@@ -332,6 +335,7 @@ def test_filter_track_multi(datafiles, cli, tmpdir):
project_config = {
"name": "filter-track-test",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
@@ -392,6 +396,7 @@ def test_filter_track_multi_exclude(datafiles, cli, tmpdir):
project_config = {
"name": "filter-track-test",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
diff --git a/tests/elements/filter/basic/project.conf b/tests/elements/filter/basic/project.conf
index 418ed02c6..e0b487d01 100644
--- a/tests/elements/filter/basic/project.conf
+++ b/tests/elements/filter/basic/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
element-path: elements
plugins:
- origin: local
diff --git a/tests/format/assertion/project.conf b/tests/format/assertion/project.conf
index 4c0016692..0a0e2eaeb 100644
--- a/tests/format/assertion/project.conf
+++ b/tests/format/assertion/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
diff --git a/tests/format/dependencies1/project.conf b/tests/format/dependencies1/project.conf
index fcd60b6df..9a5f11ee1 100644
--- a/tests/format/dependencies1/project.conf
+++ b/tests/format/dependencies1/project.conf
@@ -1,3 +1,4 @@
# Basic project
name: test
+min-version: 2.0
element-path: elements
diff --git a/tests/format/dependencies2/project.conf b/tests/format/dependencies2/project.conf
index 2027cc27a..716db37ac 100644
--- a/tests/format/dependencies2/project.conf
+++ b/tests/format/dependencies2/project.conf
@@ -1,3 +1,4 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
diff --git a/tests/format/dependencies3/project.conf b/tests/format/dependencies3/project.conf
index d9f7e08cb..8b361b03d 100644
--- a/tests/format/dependencies3/project.conf
+++ b/tests/format/dependencies3/project.conf
@@ -1 +1,2 @@
name: dup-dup-checker
+min-version: 2.0
diff --git a/tests/format/include.py b/tests/format/include.py
index c64753be5..12b043c8e 100644
--- a/tests/format/include.py
+++ b/tests/format/include.py
@@ -25,7 +25,7 @@ def test_include_project_file(cli, datafiles):
def test_include_missing_file(cli, tmpdir):
- tmpdir.join("project.conf").write('{"name": "test"}')
+ tmpdir.join("project.conf").write('{"name": "test", "min-version": "2.0"}')
element = tmpdir.join("include_missing_file.bst")
# Normally we would use dicts and _yaml.roundtrip_dump to write such things, but here
@@ -48,7 +48,7 @@ def test_include_missing_file(cli, tmpdir):
def test_include_dir(cli, tmpdir):
- tmpdir.join("project.conf").write('{"name": "test"}')
+ tmpdir.join("project.conf").write('{"name": "test", "min-version": "2.0"}')
tmpdir.mkdir("subdir")
element = tmpdir.join("include_dir.bst")
diff --git a/tests/format/include/conditional/project.conf b/tests/format/include/conditional/project.conf
index cb54779d3..fbfc9f827 100644
--- a/tests/format/include/conditional/project.conf
+++ b/tests/format/include/conditional/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
build_arch:
diff --git a/tests/format/include/eventual_overrides/project.conf b/tests/format/include/eventual_overrides/project.conf
index b32753625..20636c446 100644
--- a/tests/format/include/eventual_overrides/project.conf
+++ b/tests/format/include/eventual_overrides/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/include/file/project.conf b/tests/format/include/file/project.conf
index a7791a416..a71243f86 100644
--- a/tests/format/include/file/project.conf
+++ b/tests/format/include/file/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- extra_conf.yml
diff --git a/tests/format/include/file_with_subproject/project.conf b/tests/format/include/file_with_subproject/project.conf
index a7791a416..a71243f86 100644
--- a/tests/format/include/file_with_subproject/project.conf
+++ b/tests/format/include/file_with_subproject/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- extra_conf.yml
diff --git a/tests/format/include/file_with_subproject/subproject/project.conf b/tests/format/include/file_with_subproject/subproject/project.conf
index 7a6655421..4b423740d 100644
--- a/tests/format/include/file_with_subproject/subproject/project.conf
+++ b/tests/format/include/file_with_subproject/subproject/project.conf
@@ -1 +1,2 @@
name: test-sub
+min-version: 2.0
diff --git a/tests/format/include/inner/project.conf b/tests/format/include/inner/project.conf
index 8bdfc428a..12dcd52bc 100644
--- a/tests/format/include/inner/project.conf
+++ b/tests/format/include/inner/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
(@):
diff --git a/tests/format/include/junction/project.conf b/tests/format/include/junction/project.conf
index 4836c5f8b..804374680 100644
--- a/tests/format/include/junction/project.conf
+++ b/tests/format/include/junction/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- junction.bst:extra_conf.yml
diff --git a/tests/format/include/junction/subproject/project.conf b/tests/format/include/junction/subproject/project.conf
index 7a6655421..4b423740d 100644
--- a/tests/format/include/junction/subproject/project.conf
+++ b/tests/format/include/junction/subproject/project.conf
@@ -1 +1,2 @@
name: test-sub
+min-version: 2.0
diff --git a/tests/format/include/junction_options/project.conf b/tests/format/include/junction_options/project.conf
index 4836c5f8b..804374680 100644
--- a/tests/format/include/junction_options/project.conf
+++ b/tests/format/include/junction_options/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- junction.bst:extra_conf.yml
diff --git a/tests/format/include/junction_options/subproject/project.conf b/tests/format/include/junction_options/subproject/project.conf
index 33ab0c8af..4d035b484 100644
--- a/tests/format/include/junction_options/subproject/project.conf
+++ b/tests/format/include/junction_options/subproject/project.conf
@@ -1,4 +1,5 @@
name: test-sub
+min-version: 2.0
options:
local_option:
diff --git a/tests/format/include/junction_options_deep/project.conf b/tests/format/include/junction_options_deep/project.conf
index 2525081ce..a114cb8e6 100644
--- a/tests/format/include/junction_options_deep/project.conf
+++ b/tests/format/include/junction_options_deep/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- junction-1.bst:extra_conf.yml
diff --git a/tests/format/include/junction_options_deep/subproject-1/project.conf b/tests/format/include/junction_options_deep/subproject-1/project.conf
index f0cd28202..5a42d3191 100644
--- a/tests/format/include/junction_options_deep/subproject-1/project.conf
+++ b/tests/format/include/junction_options_deep/subproject-1/project.conf
@@ -1 +1,2 @@
name: test-sub-1
+min-version: 2.0
diff --git a/tests/format/include/junction_options_deep/subproject-2/project.conf b/tests/format/include/junction_options_deep/subproject-2/project.conf
index d44ccd809..b64e3fa49 100644
--- a/tests/format/include/junction_options_deep/subproject-2/project.conf
+++ b/tests/format/include/junction_options_deep/subproject-2/project.conf
@@ -1,4 +1,5 @@
name: test-sub-2
+min-version: 2.0
options:
local_option:
diff --git a/tests/format/include/junction_options_element/project.conf b/tests/format/include/junction_options_element/project.conf
index b32753625..20636c446 100644
--- a/tests/format/include/junction_options_element/project.conf
+++ b/tests/format/include/junction_options_element/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/include/junction_options_element/subproject/project.conf b/tests/format/include/junction_options_element/subproject/project.conf
index 33ab0c8af..4d035b484 100644
--- a/tests/format/include/junction_options_element/subproject/project.conf
+++ b/tests/format/include/junction_options_element/subproject/project.conf
@@ -1,4 +1,5 @@
name: test-sub
+min-version: 2.0
options:
local_option:
diff --git a/tests/format/include/local_to_junction/project.conf b/tests/format/include/local_to_junction/project.conf
index 4836c5f8b..804374680 100644
--- a/tests/format/include/local_to_junction/project.conf
+++ b/tests/format/include/local_to_junction/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- junction.bst:extra_conf.yml
diff --git a/tests/format/include/local_to_junction/subproject/project.conf b/tests/format/include/local_to_junction/subproject/project.conf
index 7a6655421..4b423740d 100644
--- a/tests/format/include/local_to_junction/subproject/project.conf
+++ b/tests/format/include/local_to_junction/subproject/project.conf
@@ -1 +1,2 @@
name: test-sub
+min-version: 2.0
diff --git a/tests/format/include/options/project.conf b/tests/format/include/options/project.conf
index a7791a416..a71243f86 100644
--- a/tests/format/include/options/project.conf
+++ b/tests/format/include/options/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- extra_conf.yml
diff --git a/tests/format/include/overrides-junction/project.conf b/tests/format/include/overrides-junction/project.conf
index d03bec634..da1d184ae 100644
--- a/tests/format/include/overrides-junction/project.conf
+++ b/tests/format/include/overrides-junction/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
elements:
junction:
diff --git a/tests/format/include/overrides-junction/subproject/project.conf b/tests/format/include/overrides-junction/subproject/project.conf
index 7a6655421..4b423740d 100644
--- a/tests/format/include/overrides-junction/subproject/project.conf
+++ b/tests/format/include/overrides-junction/subproject/project.conf
@@ -1 +1,2 @@
name: test-sub
+min-version: 2.0
diff --git a/tests/format/include/overrides/project.conf b/tests/format/include/overrides/project.conf
index fa3c75703..07a6bfe21 100644
--- a/tests/format/include/overrides/project.conf
+++ b/tests/format/include/overrides/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
elements:
junction:
diff --git a/tests/format/include/overrides/subproject/project.conf b/tests/format/include/overrides/subproject/project.conf
index 7a6655421..4b423740d 100644
--- a/tests/format/include/overrides/subproject/project.conf
+++ b/tests/format/include/overrides/subproject/project.conf
@@ -1 +1,2 @@
name: test-sub
+min-version: 2.0
diff --git a/tests/format/include/recursive/project.conf b/tests/format/include/recursive/project.conf
index a7791a416..a71243f86 100644
--- a/tests/format/include/recursive/project.conf
+++ b/tests/format/include/recursive/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
(@):
- extra_conf.yml
diff --git a/tests/format/include/string/project.conf b/tests/format/include/string/project.conf
index 6ee9988e9..1d011ee92 100644
--- a/tests/format/include/string/project.conf
+++ b/tests/format/include/string/project.conf
@@ -1,3 +1,4 @@
name: test
+min-version: 2.0
(@): extra_conf.yml
diff --git a/tests/format/include/sub-include/project.conf b/tests/format/include/sub-include/project.conf
index 7f7df84c8..6e7fc95a2 100644
--- a/tests/format/include/sub-include/project.conf
+++ b/tests/format/include/sub-include/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
elements:
manual:
diff --git a/tests/format/include_composition.py b/tests/format/include_composition.py
index 4af6862fa..3224822af 100644
--- a/tests/format/include_composition.py
+++ b/tests/format/include_composition.py
@@ -11,7 +11,7 @@ from tests.testutils import dummy_context
@contextmanager
def make_includes(basedir):
- _yaml.roundtrip_dump({"name": "test"}, os.path.join(basedir, "project.conf"))
+ _yaml.roundtrip_dump({"name": "test", "min-version": "2.0"}, os.path.join(basedir, "project.conf"))
with dummy_context() as context:
project = Project(basedir, context)
loader = project.loader
diff --git a/tests/format/invalid-keys/project.conf b/tests/format/invalid-keys/project.conf
index c24f5789e..b4ea0966a 100644
--- a/tests/format/invalid-keys/project.conf
+++ b/tests/format/invalid-keys/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
thingy:
diff --git a/tests/format/junctions/bar/project.conf b/tests/format/junctions/bar/project.conf
index f8ed6621d..42d288416 100644
--- a/tests/format/junctions/bar/project.conf
+++ b/tests/format/junctions/bar/project.conf
@@ -1 +1,2 @@
name: bar
+min-version: 2.0
diff --git a/tests/format/junctions/base/project.conf b/tests/format/junctions/base/project.conf
index 951ea1a34..7e258e29f 100644
--- a/tests/format/junctions/base/project.conf
+++ b/tests/format/junctions/base/project.conf
@@ -1 +1,2 @@
name: base
+min-version: 2.0
diff --git a/tests/format/junctions/config-target/project.conf b/tests/format/junctions/config-target/project.conf
index 4049c3739..d9e1d7a4f 100644
--- a/tests/format/junctions/config-target/project.conf
+++ b/tests/format/junctions/config-target/project.conf
@@ -1,3 +1,4 @@
name: config-target
+min-version: 2.0
element-path: elements
diff --git a/tests/format/junctions/config-target/subproject/project.conf b/tests/format/junctions/config-target/subproject/project.conf
index 1097282c3..1529ece04 100644
--- a/tests/format/junctions/config-target/subproject/project.conf
+++ b/tests/format/junctions/config-target/subproject/project.conf
@@ -1,3 +1,4 @@
name: subproject
+min-version: 2.0
element-path: elements
diff --git a/tests/format/junctions/config-target/subproject/subsubproject/project.conf b/tests/format/junctions/config-target/subproject/subsubproject/project.conf
index 9d75121a0..162143c80 100644
--- a/tests/format/junctions/config-target/subproject/subsubproject/project.conf
+++ b/tests/format/junctions/config-target/subproject/subsubproject/project.conf
@@ -1,3 +1,4 @@
name: subsubproject
+min-version: 2.0
element-path: elements
diff --git a/tests/format/junctions/conflict/project.conf b/tests/format/junctions/conflict/project.conf
index 395bb8423..660ab4fa2 100644
--- a/tests/format/junctions/conflict/project.conf
+++ b/tests/format/junctions/conflict/project.conf
@@ -1 +1,2 @@
name: conflict
+min-version: 2.0
diff --git a/tests/format/junctions/foo/project.conf b/tests/format/junctions/foo/project.conf
index 5a240e3ed..43a09bb5e 100644
--- a/tests/format/junctions/foo/project.conf
+++ b/tests/format/junctions/foo/project.conf
@@ -1 +1,2 @@
name: foo
+min-version: 2.0
diff --git a/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf b/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf
index 2e96170f8..6bdff02c5 100644
--- a/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf
+++ b/tests/format/junctions/inconsistent-names/junctionA/junctionB/project.conf
@@ -1,5 +1,8 @@
# Unique project name
name: projectB
+# Minimum required BuildStream version
+min-version: 2.0
+
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/format/junctions/inconsistent-names/junctionA/project.conf b/tests/format/junctions/inconsistent-names/junctionA/project.conf
index 166c4b78c..8af914819 100644
--- a/tests/format/junctions/inconsistent-names/junctionA/project.conf
+++ b/tests/format/junctions/inconsistent-names/junctionA/project.conf
@@ -1,5 +1,8 @@
# Unique project name
name: projectA
+# Minimum required BuildStream version
+min-version: 2.0
+
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/format/junctions/inconsistent-names/project.conf b/tests/format/junctions/inconsistent-names/project.conf
index 064bbc588..8eef10e76 100644
--- a/tests/format/junctions/inconsistent-names/project.conf
+++ b/tests/format/junctions/inconsistent-names/project.conf
@@ -1,5 +1,8 @@
# Unique project name
name: inconsistent-names
+# Minimum required BuildStream version
+min-version: 2.0
+
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/format/junctions/invalid/project.conf b/tests/format/junctions/invalid/project.conf
index 38070bf71..ec193834a 100644
--- a/tests/format/junctions/invalid/project.conf
+++ b/tests/format/junctions/invalid/project.conf
@@ -1 +1,2 @@
name: invalid
+min-version: 2.0
diff --git a/tests/format/junctions/missing-element/junctionA/junctionB/project.conf b/tests/format/junctions/missing-element/junctionA/junctionB/project.conf
index 41b8d6c72..7d0310066 100644
--- a/tests/format/junctions/missing-element/junctionA/junctionB/project.conf
+++ b/tests/format/junctions/missing-element/junctionA/junctionB/project.conf
@@ -1 +1,2 @@
name: projectB
+min-version: 2.0
diff --git a/tests/format/junctions/missing-element/junctionA/project.conf b/tests/format/junctions/missing-element/junctionA/project.conf
index 5f6ab28a2..7a0f119c3 100644
--- a/tests/format/junctions/missing-element/junctionA/project.conf
+++ b/tests/format/junctions/missing-element/junctionA/project.conf
@@ -1 +1,2 @@
name: projectA
+min-version: 2.0
diff --git a/tests/format/junctions/missing-element/project.conf b/tests/format/junctions/missing-element/project.conf
index b32753625..20636c446 100644
--- a/tests/format/junctions/missing-element/project.conf
+++ b/tests/format/junctions/missing-element/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/junctions/nested/project.conf b/tests/format/junctions/nested/project.conf
index 551f51c6a..eba806781 100644
--- a/tests/format/junctions/nested/project.conf
+++ b/tests/format/junctions/nested/project.conf
@@ -1 +1,2 @@
name: nested
+min-version: 2.0
diff --git a/tests/format/junctions/options-base/project.conf b/tests/format/junctions/options-base/project.conf
index a98ebd5ed..58bfa55e5 100644
--- a/tests/format/junctions/options-base/project.conf
+++ b/tests/format/junctions/options-base/project.conf
@@ -1,4 +1,5 @@
name: options-base
+min-version: 2.0
options:
animal:
type: enum
diff --git a/tests/format/junctions/options-default/project.conf b/tests/format/junctions/options-default/project.conf
index b9e58a582..c362c12b6 100644
--- a/tests/format/junctions/options-default/project.conf
+++ b/tests/format/junctions/options-default/project.conf
@@ -1 +1,2 @@
name: options-default
+min-version: 2.0
diff --git a/tests/format/junctions/options-inherit/project.conf b/tests/format/junctions/options-inherit/project.conf
index 1e0ea4464..b5680a792 100644
--- a/tests/format/junctions/options-inherit/project.conf
+++ b/tests/format/junctions/options-inherit/project.conf
@@ -1,4 +1,5 @@
name: options-inherit
+min-version: 2.0
options:
animal:
type: enum
diff --git a/tests/format/junctions/options/project.conf b/tests/format/junctions/options/project.conf
index de53ae176..f191a50a9 100644
--- a/tests/format/junctions/options/project.conf
+++ b/tests/format/junctions/options/project.conf
@@ -1 +1,2 @@
name: options
+min-version: 2.0
diff --git a/tests/format/junctions/toplevel/project.conf b/tests/format/junctions/toplevel/project.conf
index 496c82128..d35b2b8f8 100644
--- a/tests/format/junctions/toplevel/project.conf
+++ b/tests/format/junctions/toplevel/project.conf
@@ -1 +1,2 @@
name: toplevel
+min-version: 2.0
diff --git a/tests/format/list-directive-error-element/project.conf b/tests/format/list-directive-error-element/project.conf
index b32753625..20636c446 100644
--- a/tests/format/list-directive-error-element/project.conf
+++ b/tests/format/list-directive-error-element/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/list-directive-error-project/project.conf b/tests/format/list-directive-error-project/project.conf
index 2d66408a8..cfeb30a4b 100644
--- a/tests/format/list-directive-error-project/project.conf
+++ b/tests/format/list-directive-error-project/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
artifacts:
(>):
diff --git a/tests/format/list-directive-type-error/project.conf b/tests/format/list-directive-type-error/project.conf
index 79f73402b..c25ef0713 100644
--- a/tests/format/list-directive-type-error/project.conf
+++ b/tests/format/list-directive-type-error/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
arch:
diff --git a/tests/format/option-arch-alias/project.conf b/tests/format/option-arch-alias/project.conf
index 47f0945c9..46a7e127d 100644
--- a/tests/format/option-arch-alias/project.conf
+++ b/tests/format/option-arch-alias/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
machine_arch:
diff --git a/tests/format/option-arch-unknown/project.conf b/tests/format/option-arch-unknown/project.conf
index 0827ec387..a72cba198 100644
--- a/tests/format/option-arch-unknown/project.conf
+++ b/tests/format/option-arch-unknown/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
machine_arch:
diff --git a/tests/format/option-arch/project.conf b/tests/format/option-arch/project.conf
index 8b94232cf..c386c16b9 100644
--- a/tests/format/option-arch/project.conf
+++ b/tests/format/option-arch/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
machine_arch:
diff --git a/tests/format/option-bool/project.conf b/tests/format/option-bool/project.conf
index a51c4fcbe..fac5b55ed 100644
--- a/tests/format/option-bool/project.conf
+++ b/tests/format/option-bool/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
diff --git a/tests/format/option-element-mask-invalid/project.conf b/tests/format/option-element-mask-invalid/project.conf
index a3d381855..cabae029c 100644
--- a/tests/format/option-element-mask-invalid/project.conf
+++ b/tests/format/option-element-mask-invalid/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
debug_elements:
diff --git a/tests/format/option-element-mask/project.conf b/tests/format/option-element-mask/project.conf
index ede07fbdd..a00d4555e 100644
--- a/tests/format/option-element-mask/project.conf
+++ b/tests/format/option-element-mask/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
debug_elements:
diff --git a/tests/format/option-enum-missing/project.conf b/tests/format/option-enum-missing/project.conf
index d6cd7049a..fea674958 100644
--- a/tests/format/option-enum-missing/project.conf
+++ b/tests/format/option-enum-missing/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
empty:
diff --git a/tests/format/option-enum/project.conf b/tests/format/option-enum/project.conf
index 0b8ea6d1e..6e471e6e2 100644
--- a/tests/format/option-enum/project.conf
+++ b/tests/format/option-enum/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
brother:
diff --git a/tests/format/option-exports/project.conf b/tests/format/option-exports/project.conf
index e81a31347..e208536c7 100644
--- a/tests/format/option-exports/project.conf
+++ b/tests/format/option-exports/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
diff --git a/tests/format/option-flags-missing/project.conf b/tests/format/option-flags-missing/project.conf
index 6554022e4..79128819a 100644
--- a/tests/format/option-flags-missing/project.conf
+++ b/tests/format/option-flags-missing/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
empty:
diff --git a/tests/format/option-flags/project.conf b/tests/format/option-flags/project.conf
index 1cab9e315..75aac7ad3 100644
--- a/tests/format/option-flags/project.conf
+++ b/tests/format/option-flags/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
# Include an enum option here so we can compare it
diff --git a/tests/format/option-list-directive/project.conf b/tests/format/option-list-directive/project.conf
index 5b2b64fe8..588b3bcd6 100644
--- a/tests/format/option-list-directive/project.conf
+++ b/tests/format/option-list-directive/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
shell_mount_devices:
diff --git a/tests/format/option-os/project.conf b/tests/format/option-os/project.conf
index 5edb5072f..db2da08d7 100644
--- a/tests/format/option-os/project.conf
+++ b/tests/format/option-os/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
machine_os:
diff --git a/tests/format/option-overrides/project.conf b/tests/format/option-overrides/project.conf
index c8058f076..c9e73a190 100644
--- a/tests/format/option-overrides/project.conf
+++ b/tests/format/option-overrides/project.conf
@@ -2,6 +2,7 @@
# in the element overrides.
#
name: test
+min-version: 2.0
options:
arch:
diff --git a/tests/format/options/compound-and-condition/project.conf b/tests/format/options/compound-and-condition/project.conf
index 650d017bd..e4816596f 100644
--- a/tests/format/options/compound-and-condition/project.conf
+++ b/tests/format/options/compound-and-condition/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
debug:
diff --git a/tests/format/options/compound-or-condition/project.conf b/tests/format/options/compound-or-condition/project.conf
index c59cc64f3..6841b79cc 100644
--- a/tests/format/options/compound-or-condition/project.conf
+++ b/tests/format/options/compound-or-condition/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
debug:
diff --git a/tests/format/options/deep-nesting/project.conf b/tests/format/options/deep-nesting/project.conf
index d912cd19e..02bbdb3ff 100644
--- a/tests/format/options/deep-nesting/project.conf
+++ b/tests/format/options/deep-nesting/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
type: bool
diff --git a/tests/format/options/invalid-condition/project.conf b/tests/format/options/invalid-condition/project.conf
index b31f35c95..c2b3c240f 100644
--- a/tests/format/options/invalid-condition/project.conf
+++ b/tests/format/options/invalid-condition/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
opt:
diff --git a/tests/format/options/invalid-expression/project.conf b/tests/format/options/invalid-expression/project.conf
index ee0147232..6a9af4ca4 100644
--- a/tests/format/options/invalid-expression/project.conf
+++ b/tests/format/options/invalid-expression/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
opt:
diff --git a/tests/format/options/invalid-name-dashes/project.conf b/tests/format/options/invalid-name-dashes/project.conf
index 045ce564f..a554ed05f 100644
--- a/tests/format/options/invalid-name-dashes/project.conf
+++ b/tests/format/options/invalid-name-dashes/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
name-with-dashes:
diff --git a/tests/format/options/invalid-name-leading-number/project.conf b/tests/format/options/invalid-name-leading-number/project.conf
index bb3e2ef6d..ec3e16999 100644
--- a/tests/format/options/invalid-name-leading-number/project.conf
+++ b/tests/format/options/invalid-name-leading-number/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
123number_is_first:
diff --git a/tests/format/options/invalid-name-plus/project.conf b/tests/format/options/invalid-name-plus/project.conf
index d62869e73..4f1c690fd 100644
--- a/tests/format/options/invalid-name-plus/project.conf
+++ b/tests/format/options/invalid-name-plus/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
name_with_+:
diff --git a/tests/format/options/invalid-name-spaces/project.conf b/tests/format/options/invalid-name-spaces/project.conf
index 66931e28c..3c662ee81 100644
--- a/tests/format/options/invalid-name-spaces/project.conf
+++ b/tests/format/options/invalid-name-spaces/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
name with spaces:
diff --git a/tests/format/options/invalid-type/project.conf b/tests/format/options/invalid-type/project.conf
index b4280cdb6..aa00f508a 100644
--- a/tests/format/options/invalid-type/project.conf
+++ b/tests/format/options/invalid-type/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
opt:
diff --git a/tests/format/options/invalid-variable-name-plus/project.conf b/tests/format/options/invalid-variable-name-plus/project.conf
index 5652bb8b3..d4a4699de 100644
--- a/tests/format/options/invalid-variable-name-plus/project.conf
+++ b/tests/format/options/invalid-variable-name-plus/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
diff --git a/tests/format/options/invalid-variable-name-spaces/project.conf b/tests/format/options/invalid-variable-name-spaces/project.conf
index 5115115bf..a89d8b5a6 100644
--- a/tests/format/options/invalid-variable-name-spaces/project.conf
+++ b/tests/format/options/invalid-variable-name-spaces/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
diff --git a/tests/format/options/nested-condition/project.conf b/tests/format/options/nested-condition/project.conf
index 104b89571..b66f5b53f 100644
--- a/tests/format/options/nested-condition/project.conf
+++ b/tests/format/options/nested-condition/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
debug:
diff --git a/tests/format/options/simple-condition/project.conf b/tests/format/options/simple-condition/project.conf
index b6bd29fb4..ab96936ef 100644
--- a/tests/format/options/simple-condition/project.conf
+++ b/tests/format/options/simple-condition/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
opt:
diff --git a/tests/format/options/undefined-variable/project.conf b/tests/format/options/undefined-variable/project.conf
index d634ef0a4..a00d51a67 100644
--- a/tests/format/options/undefined-variable/project.conf
+++ b/tests/format/options/undefined-variable/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
options:
pony:
diff --git a/tests/format/project-overrides/prepend-configure-commands/project.conf b/tests/format/project-overrides/prepend-configure-commands/project.conf
index 439a21809..b6053feb7 100644
--- a/tests/format/project-overrides/prepend-configure-commands/project.conf
+++ b/tests/format/project-overrides/prepend-configure-commands/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
# Test that prepending to configure-commands works
elements:
diff --git a/tests/format/project.py b/tests/format/project.py
index 3d0931b86..c2e2f733f 100644
--- a/tests/format/project.py
+++ b/tests/format/project.py
@@ -175,6 +175,7 @@ def test_plugin_no_load_ref(cli, datafiles, ref_storage):
#
config = {
"name": "test",
+ "min-version": "2.0",
"ref-storage": ref_storage,
"plugins": [{"origin": "local", "path": "plugins", "sources": {"noloadref": 0}}],
}
diff --git a/tests/format/project/default/project.conf b/tests/format/project/default/project.conf
index fd3134c58..0409a6f91 100644
--- a/tests/format/project/default/project.conf
+++ b/tests/format/project/default/project.conf
@@ -2,3 +2,4 @@
#
name: pony
+min-version: 2.0
diff --git a/tests/format/project/duplicate-plugins/project.conf b/tests/format/project/duplicate-plugins/project.conf
index 4b8f5be5f..a413e6137 100644
--- a/tests/format/project/duplicate-plugins/project.conf
+++ b/tests/format/project/duplicate-plugins/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
plugins:
- origin: local
diff --git a/tests/format/project/element-path/project.conf b/tests/format/project/element-path/project.conf
index 57e87de4f..1309fddbb 100644
--- a/tests/format/project/element-path/project.conf
+++ b/tests/format/project/element-path/project.conf
@@ -1,2 +1,3 @@
name: foo
+min-version: 2.0
element-path: elements
diff --git a/tests/format/project/empty-depends/project.conf b/tests/format/project/empty-depends/project.conf
index b32753625..20636c446 100644
--- a/tests/format/project/empty-depends/project.conf
+++ b/tests/format/project/empty-depends/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/project/emptyname/project.conf b/tests/format/project/emptyname/project.conf
index 2c5cf0783..9db3c011d 100644
--- a/tests/format/project/emptyname/project.conf
+++ b/tests/format/project/emptyname/project.conf
@@ -2,3 +2,4 @@
# this one is an empty string
#
name: ''
+min-version: 2.0
diff --git a/tests/format/project/invalid-yaml/project.conf b/tests/format/project/invalid-yaml/project.conf
index 5f9282bbf..96181d9cc 100644
--- a/tests/format/project/invalid-yaml/project.conf
+++ b/tests/format/project/invalid-yaml/project.conf
@@ -2,6 +2,7 @@
#
name: pony
+min-version: 2.0
variables:
sbindir: "%{bindir}
diff --git a/tests/format/project/invalidname/project.conf b/tests/format/project/invalidname/project.conf
index 3b064d7ec..34b65719e 100644
--- a/tests/format/project/invalidname/project.conf
+++ b/tests/format/project/invalidname/project.conf
@@ -2,3 +2,4 @@
# this one contains a space
#
name: Project Name
+min-version: 2.0
diff --git a/tests/format/project/local-plugin/project.conf b/tests/format/project/local-plugin/project.conf
index 97166e350..ccb6ef433 100644
--- a/tests/format/project/local-plugin/project.conf
+++ b/tests/format/project/local-plugin/project.conf
@@ -1,4 +1,5 @@
name: foo
+min-version: 2.0
plugins:
- origin: local
path: plugins
diff --git a/tests/format/project/missing-element/project.conf b/tests/format/project/missing-element/project.conf
index b32753625..20636c446 100644
--- a/tests/format/project/missing-element/project.conf
+++ b/tests/format/project/missing-element/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/project/missing-junction/project.conf b/tests/format/project/missing-junction/project.conf
index b32753625..20636c446 100644
--- a/tests/format/project/missing-junction/project.conf
+++ b/tests/format/project/missing-junction/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/project/overridepath/project.conf b/tests/format/project/overridepath/project.conf
index ef1d01c59..640bff318 100644
--- a/tests/format/project/overridepath/project.conf
+++ b/tests/format/project/overridepath/project.conf
@@ -1,6 +1,7 @@
# A project configuration which overrides the sandbox PATH environment variable
name: foo
+min-version: 2.0
environment:
PATH: /bin:/sbin
diff --git a/tests/format/project/plugin-allowed/project.conf b/tests/format/project/plugin-allowed/project.conf
index d49e40d48..3896b7bc2 100644
--- a/tests/format/project/plugin-allowed/project.conf
+++ b/tests/format/project/plugin-allowed/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
plugins:
- origin: local
diff --git a/tests/format/project/plugin-forbidden/project.conf b/tests/format/project/plugin-forbidden/project.conf
index 39cc3d65f..0211b2061 100644
--- a/tests/format/project/plugin-forbidden/project.conf
+++ b/tests/format/project/plugin-forbidden/project.conf
@@ -1,2 +1,3 @@
name: test
+min-version: 2.0
diff --git a/tests/format/project/plugin-preflight-error/project.conf b/tests/format/project/plugin-preflight-error/project.conf
index 20a234413..07d60daf2 100644
--- a/tests/format/project/plugin-preflight-error/project.conf
+++ b/tests/format/project/plugin-preflight-error/project.conf
@@ -1,6 +1,7 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
# Whitelist the local test Source "errorplugin" to be loaded
#
diff --git a/tests/format/project/project-from-subdir/project.conf b/tests/format/project/project-from-subdir/project.conf
index fd3134c58..0409a6f91 100644
--- a/tests/format/project/project-from-subdir/project.conf
+++ b/tests/format/project/project-from-subdir/project.conf
@@ -2,3 +2,4 @@
#
name: pony
+min-version: 2.0
diff --git a/tests/format/project/refs-options/project.conf b/tests/format/project/refs-options/project.conf
index a44806da0..35941efae 100644
--- a/tests/format/project/refs-options/project.conf
+++ b/tests/format/project/refs-options/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
ref-storage: project.refs
options:
diff --git a/tests/format/project/unsupported/project.conf b/tests/format/project/unsupported/project.conf
index ecd8e06cc..76528a493 100644
--- a/tests/format/project/unsupported/project.conf
+++ b/tests/format/project/unsupported/project.conf
@@ -1,3 +1,3 @@
# A project which requires a too new version of the format
name: foo
-format-version: 5000
+min-version: 2.900
diff --git a/tests/format/variables.py b/tests/format/variables.py
index ecc1e2b12..81bda291b 100644
--- a/tests/format/variables.py
+++ b/tests/format/variables.py
@@ -74,7 +74,7 @@ def test_cyclic_variables(cli, datafiles):
@pytest.mark.datafiles(os.path.join(DATA_DIR, "protected-vars"))
def test_use_of_protected_var_project_conf(cli, datafiles, protected_var):
project = str(datafiles)
- conf = {"name": "test", "variables": {protected_var: "some-value"}}
+ conf = {"name": "test", "min-version": "2.0", "variables": {protected_var: "some-value"}}
_yaml.roundtrip_dump(conf, os.path.join(project, "project.conf"))
element = {
@@ -91,7 +91,7 @@ def test_use_of_protected_var_project_conf(cli, datafiles, protected_var):
@pytest.mark.datafiles(os.path.join(DATA_DIR, "protected-vars"))
def test_use_of_protected_var_element_overrides(cli, datafiles, protected_var):
project = str(datafiles)
- conf = {"name": "test", "elements": {"manual": {"variables": {protected_var: "some-value"}}}}
+ conf = {"name": "test", "min-version": "2.0", "elements": {"manual": {"variables": {protected_var: "some-value"}}}}
_yaml.roundtrip_dump(conf, os.path.join(project, "project.conf"))
element = {
diff --git a/tests/format/variables/cyclic_variables/project.conf b/tests/format/variables/cyclic_variables/project.conf
index b32753625..20636c446 100644
--- a/tests/format/variables/cyclic_variables/project.conf
+++ b/tests/format/variables/cyclic_variables/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/format/variables/defaults/project.conf b/tests/format/variables/defaults/project.conf
index 2027cc27a..716db37ac 100644
--- a/tests/format/variables/defaults/project.conf
+++ b/tests/format/variables/defaults/project.conf
@@ -1,3 +1,4 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
diff --git a/tests/format/variables/missing_variables/project.conf b/tests/format/variables/missing_variables/project.conf
index 2027cc27a..716db37ac 100644
--- a/tests/format/variables/missing_variables/project.conf
+++ b/tests/format/variables/missing_variables/project.conf
@@ -1,3 +1,4 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
diff --git a/tests/format/variables/overrides/project.conf b/tests/format/variables/overrides/project.conf
index 2027cc27a..716db37ac 100644
--- a/tests/format/variables/overrides/project.conf
+++ b/tests/format/variables/overrides/project.conf
@@ -1,3 +1,4 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
diff --git a/tests/format/variables/protected-vars/project.conf b/tests/format/variables/protected-vars/project.conf
index 5a240e3ed..43a09bb5e 100644
--- a/tests/format/variables/protected-vars/project.conf
+++ b/tests/format/variables/protected-vars/project.conf
@@ -1 +1,2 @@
name: foo
+min-version: 2.0
diff --git a/tests/frontend/__init__.py b/tests/frontend/__init__.py
index ad1f9ea92..65ecda3ef 100644
--- a/tests/frontend/__init__.py
+++ b/tests/frontend/__init__.py
@@ -6,5 +6,6 @@ from buildstream import _yaml
#
def configure_project(path, config):
config["name"] = "test"
+ config["min-version"] = "2.0"
config["element-path"] = "elements"
_yaml.roundtrip_dump(config, os.path.join(path, "project.conf"))
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 1aa9bbd01..96c96ccfe 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -1001,6 +1001,7 @@ def test_partial_artifact_checkout_fetch(cli, datafiles, tmpdir):
project = str(tmpdir)
project_config = {
"name": "partial-artifact-checkout-fetch",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
diff --git a/tests/frontend/completions/no-element-path/project.conf b/tests/frontend/completions/no-element-path/project.conf
index e7e35e716..4090cce21 100644
--- a/tests/frontend/completions/no-element-path/project.conf
+++ b/tests/frontend/completions/no-element-path/project.conf
@@ -1,2 +1,3 @@
# Project config for frontend build test
name: test
+min-version: 2.0
diff --git a/tests/frontend/completions/project/project.conf b/tests/frontend/completions/project/project.conf
index 854e38693..5ba316874 100644
--- a/tests/frontend/completions/project/project.conf
+++ b/tests/frontend/completions/project/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/completions/sub-folders/project.conf b/tests/frontend/completions/sub-folders/project.conf
index 854e38693..5ba316874 100644
--- a/tests/frontend/completions/sub-folders/project.conf
+++ b/tests/frontend/completions/sub-folders/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/configurable_warnings.py b/tests/frontend/configurable_warnings.py
index be0706360..e61db6c37 100644
--- a/tests/frontend/configurable_warnings.py
+++ b/tests/frontend/configurable_warnings.py
@@ -16,6 +16,7 @@ TOP_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "configuredw
def get_project(fatal_warnings):
return {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"plugins": [
{"origin": "local", "path": "plugins", "elements": {"warninga": 0, "warningb": 0, "corewarn": 0,}}
diff --git a/tests/frontend/configuredwarning/project.conf b/tests/frontend/configuredwarning/project.conf
index c73d217b8..195ee176a 100644
--- a/tests/frontend/configuredwarning/project.conf
+++ b/tests/frontend/configuredwarning/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
element-path: elements
plugins:
- origin: local
diff --git a/tests/frontend/consistencyerror/project.conf b/tests/frontend/consistencyerror/project.conf
index 524a32134..d28ba12df 100644
--- a/tests/frontend/consistencyerror/project.conf
+++ b/tests/frontend/consistencyerror/project.conf
@@ -1,6 +1,7 @@
# Basic project configuration that doesnt override anything
#
name: test
+min-version: 2.0
# Whitelist the local test Sources
#
diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py
index 574de2bed..5e25d1fa8 100644
--- a/tests/frontend/cross_junction_workspace.py
+++ b/tests/frontend/cross_junction_workspace.py
@@ -13,8 +13,8 @@ def prepare_junction_project(cli, tmpdir):
os.makedirs(str(main_project))
os.makedirs(str(sub_project))
- _yaml.roundtrip_dump({"name": "main"}, str(main_project.join("project.conf")))
- _yaml.roundtrip_dump({"name": "sub"}, str(sub_project.join("project.conf")))
+ _yaml.roundtrip_dump({"name": "main", "min-version": "2.0"}, str(main_project.join("project.conf")))
+ _yaml.roundtrip_dump({"name": "sub", "min-version": "2.0"}, str(sub_project.join("project.conf")))
import_dir = tmpdir.join("import")
os.makedirs(str(import_dir))
diff --git a/tests/frontend/default-target/files/sub-project/project.conf b/tests/frontend/default-target/files/sub-project/project.conf
index db76b5267..85e67e961 100644
--- a/tests/frontend/default-target/files/sub-project/project.conf
+++ b/tests/frontend/default-target/files/sub-project/project.conf
@@ -1,3 +1,3 @@
name: test-default-target-subproject
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/default-target/project.conf b/tests/frontend/default-target/project.conf
index 17937ed73..095c54610 100644
--- a/tests/frontend/default-target/project.conf
+++ b/tests/frontend/default-target/project.conf
@@ -1,3 +1,3 @@
name: test-default-target
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/default_target.py b/tests/frontend/default_target.py
index d2a75c961..bb7a49592 100644
--- a/tests/frontend/default_target.py
+++ b/tests/frontend/default_target.py
@@ -40,6 +40,7 @@ def test_default_target(cli, datafiles, operation, expected_state):
# First, modify project configuration to set a default target
project_conf = {
"name": "test-default-target",
+ "min-version": "2.0",
"element-path": "elements",
"defaults": {"targets": ["dummy_stack.bst"]},
}
@@ -102,6 +103,7 @@ def test_default_target_track(cli, tmpdir, datafiles):
# Then, make it the default target
project_conf = {
"name": "test-default-target",
+ "min-version": "2.0",
"element-path": "elements",
"defaults": {"targets": [target]},
}
@@ -131,6 +133,7 @@ def test_default_target_fetch(cli, tmpdir, datafiles):
# Then, make it the default target
project_conf = {
"name": "test-default-target",
+ "min-version": "2.0",
"element-path": "elements",
"defaults": {"targets": [target]},
}
@@ -157,6 +160,7 @@ def test_default_target_push_pull(cli, tmpdir, datafiles):
# Set a default target
project_conf = {
"name": "test-default-target",
+ "min-version": "2.0",
"element-path": "elements",
"defaults": {"targets": [target]},
}
diff --git a/tests/frontend/exceptions/project.conf b/tests/frontend/exceptions/project.conf
index 2027cc27a..716db37ac 100644
--- a/tests/frontend/exceptions/project.conf
+++ b/tests/frontend/exceptions/project.conf
@@ -1,3 +1,4 @@
# Basic project configuration that doesnt override anything
#
name: pony
+min-version: 2.0
diff --git a/tests/frontend/init.py b/tests/frontend/init.py
index 78aa3eb19..db1b9c955 100644
--- a/tests/frontend/init.py
+++ b/tests/frontend/init.py
@@ -6,9 +6,24 @@ import pytest
from buildstream.testing import cli # pylint: disable=unused-import
from buildstream import _yaml
+from buildstream import utils
from buildstream._frontend.app import App
from buildstream.exceptions import ErrorDomain, LoadErrorReason
-from buildstream._versions import BST_FORMAT_VERSION
+
+
+def get_default_min_version():
+ bst_major, bst_minor = utils.get_bst_version()
+
+ # For the version check, artificially set the version to at least
+ # version 2.0
+ #
+ # TODO: Remove this code block after releasing 2.0
+ #
+ if bst_major < 2:
+ bst_major = 2
+ bst_minor = 0
+
+ return "{}.{}".format(bst_major, bst_minor)
def test_defaults(cli, tmpdir):
@@ -20,7 +35,7 @@ def test_defaults(cli, tmpdir):
project_conf = _yaml.load(project_path)
assert project_conf.get_str("name") == "foo"
- assert project_conf.get_str("format-version") == str(BST_FORMAT_VERSION)
+ assert project_conf.get_str("min-version") == get_default_min_version()
assert project_conf.get_str("element-path") == "elements"
@@ -29,13 +44,13 @@ def test_all_options(cli, tmpdir):
project_path = os.path.join(project, "project.conf")
result = cli.run(
- args=["init", "--project-name", "foo", "--format-version", "2", "--element-path", "ponies", project]
+ args=["init", "--project-name", "foo", "--min-version", "2.0", "--element-path", "ponies", project]
)
result.assert_success()
project_conf = _yaml.load(project_path)
assert project_conf.get_str("name") == "foo"
- assert project_conf.get_str("format-version") == str(2)
+ assert project_conf.get_str("min-version") == "2.0"
assert project_conf.get_str("element-path") == "ponies"
elements_dir = os.path.join(project, "ponies")
@@ -68,7 +83,7 @@ def test_force_overwrite_project(cli, tmpdir):
project_conf = _yaml.load(project_path)
assert project_conf.get_str("name") == "foo"
- assert project_conf.get_str("format-version") == str(BST_FORMAT_VERSION)
+ assert project_conf.get_str("min-version") == get_default_min_version()
def test_relative_path_directory_as_argument(cli, tmpdir):
@@ -82,7 +97,7 @@ def test_relative_path_directory_as_argument(cli, tmpdir):
project_conf = _yaml.load(project_path)
assert project_conf.get_str("name") == "foo"
- assert project_conf.get_int("format-version") == BST_FORMAT_VERSION
+ assert project_conf.get_str("min-version") == get_default_min_version()
assert project_conf.get_str("element-path") == "elements"
@@ -97,10 +112,10 @@ def test_bad_project_name(cli, tmpdir, project_name):
result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_SYMBOL_NAME)
-@pytest.mark.parametrize("format_version", [(str(-1)), (str(BST_FORMAT_VERSION + 1))])
-def test_bad_format_version(cli, tmpdir, format_version):
- result = cli.run(args=["init", "--project-name", "foo", "--format-version", format_version, str(tmpdir)])
- result.assert_main_error(ErrorDomain.APP, "invalid-format-version")
+@pytest.mark.parametrize("min_version", [("-1"), ("1.4"), ("2.900"), ("abc")])
+def test_bad_min_version(cli, tmpdir, min_version):
+ result = cli.run(args=["init", "--project-name", "foo", "--min-version", min_version, str(tmpdir)])
+ result.assert_main_error(ErrorDomain.APP, "invalid-min-version")
@pytest.mark.parametrize("element_path", [("/absolute/path"), ("../outside/of/project")])
@@ -124,7 +139,7 @@ def test_element_path_interactive(cli, tmp_path, monkeypatch, element_path):
return DummyInteractiveApp(*args, **kwargs)
def _init_project_interactive(self, *args, **kwargs): # pylint: disable=arguments-differ
- return ("project_name", "0", element_path)
+ return ("project_name", "2.0", element_path)
monkeypatch.setattr(App, "create", DummyInteractiveApp.create)
@@ -136,5 +151,5 @@ def test_element_path_interactive(cli, tmp_path, monkeypatch, element_path):
project_conf = _yaml.load(str(project_conf_path))
assert project_conf.get_str("name") == "project_name"
- assert project_conf.get_str("format-version") == "0"
+ assert project_conf.get_str("min-version") == "2.0"
assert project_conf.get_str("element-path") == element_path
diff --git a/tests/frontend/interactive_init.py b/tests/frontend/interactive_init.py
index c8f169000..b8cbe522f 100644
--- a/tests/frontend/interactive_init.py
+++ b/tests/frontend/interactive_init.py
@@ -1,23 +1,33 @@
import os
import pexpect
-from ruamel import yaml
-from buildstream._versions import BST_FORMAT_VERSION
+from buildstream import _yaml
+from buildstream import utils
from tests.testutils.constants import PEXPECT_TIMEOUT_SHORT
def test_init(tmpdir):
session = pexpect.spawn("bst", ["--no-colors", "init", str(tmpdir)], timeout=PEXPECT_TIMEOUT_SHORT)
name = "test-project"
- format_version = 24
+ min_version = "2.0"
element_path = "my-elements"
+ bst_major, bst_minor = utils.get_bst_version()
+
+ # For the version check, artificially set the version to at least
+ # version 2.0
+ #
+ # TODO: Remove this code block after releasing 2.0
+ #
+ if bst_major < 2:
+ bst_major = 2
+ bst_minor = 0
session.expect_exact("Project name:")
session.sendline(name)
- session.expect_exact("Format version [{}]:".format(BST_FORMAT_VERSION))
- session.sendline(str(format_version))
+ session.expect_exact("Minimum version [{}.{}]:".format(bst_major, bst_minor))
+ session.sendline(str(min_version))
session.expect_exact("Element path [elements]:")
session.sendline(element_path)
@@ -26,9 +36,7 @@ def test_init(tmpdir):
session.close()
# Now assert that a project.conf got created with expected values
- with open(os.path.join(str(tmpdir), "project.conf")) as f:
- project_conf = yaml.safe_load(f)
-
- assert project_conf["name"] == name
- assert project_conf["format-version"] == format_version
- assert project_conf["element-path"] == element_path
+ project_conf = _yaml.load(os.path.join(str(tmpdir), "project.conf"))
+ assert project_conf.get_str("name") == name
+ assert project_conf.get_str("min-version") == min_version
+ assert project_conf.get_str("element-path") == element_path
diff --git a/tests/frontend/invalid_element_path/project.conf b/tests/frontend/invalid_element_path/project.conf
index 7b09276e1..e752d22d5 100644
--- a/tests/frontend/invalid_element_path/project.conf
+++ b/tests/frontend/invalid_element_path/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
elephant-path: elements
diff --git a/tests/frontend/mirror.py b/tests/frontend/mirror.py
index f71cb554d..848047ee8 100644
--- a/tests/frontend/mirror.py
+++ b/tests/frontend/mirror.py
@@ -41,6 +41,7 @@ def generate_element(output_file):
def generate_project():
project = {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"aliases": {"foo": "FOO/", "bar": "BAR/",},
"mirrors": [
@@ -95,6 +96,7 @@ def test_mirror_fetch_ref_storage(cli, tmpdir, datafiles, ref_storage, mirror):
project = {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"aliases": {alias: upstream_map + "/"},
"ref-storage": ref_storage,
@@ -290,6 +292,7 @@ def test_mirror_git_submodule_fetch(cli, tmpdir, datafiles):
mirror_map, _ = os.path.split(full_mirror)
project = {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"aliases": {alias: "http://www.example.com/"},
"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],},},],
@@ -361,6 +364,7 @@ def test_mirror_fallback_git_only_submodules(cli, tmpdir, datafiles):
project = {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"aliases": {alias: upstream_map + "/"},
"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}],
@@ -446,6 +450,7 @@ def test_mirror_fallback_git_with_submodules(cli, tmpdir, datafiles):
project = {
"name": "test",
+ "min-version": "2.0",
"element-path": "elements",
"aliases": {alias: upstream_map + "/"},
"mirrors": [{"name": "middle-earth", "aliases": {alias: [mirror_map + "/"],}}],
diff --git a/tests/frontend/overlaps.py b/tests/frontend/overlaps.py
index d734a3781..a45fc700d 100644
--- a/tests/frontend/overlaps.py
+++ b/tests/frontend/overlaps.py
@@ -14,7 +14,7 @@ DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "overlaps")
def gen_project(project_dir, fail_on_overlap, use_fatal_warnings=True, project_name="test"):
- template = {"name": project_name}
+ template = {"name": project_name, "min-version": "2.0"}
if use_fatal_warnings:
template["fatal-warnings"] = [CoreWarnings.OVERLAPS] if fail_on_overlap else []
else:
diff --git a/tests/frontend/project/files/sub-project/project.conf b/tests/frontend/project/files/sub-project/project.conf
index bbb8414a3..74cfd2583 100644
--- a/tests/frontend/project/files/sub-project/project.conf
+++ b/tests/frontend/project/files/sub-project/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: subtest
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/project/files/sub2-project/project.conf b/tests/frontend/project/files/sub2-project/project.conf
index bbb8414a3..74cfd2583 100644
--- a/tests/frontend/project/files/sub2-project/project.conf
+++ b/tests/frontend/project/files/sub2-project/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: subtest
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/project/project.conf b/tests/frontend/project/project.conf
index ed18221e4..c82f85bb6 100644
--- a/tests/frontend/project/project.conf
+++ b/tests/frontend/project/project.conf
@@ -1,6 +1,6 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
element-path: elements
fatal-warnings:
diff --git a/tests/frontend/project_fail/project.conf b/tests/frontend/project_fail/project.conf
index 854e38693..5ba316874 100644
--- a/tests/frontend/project_fail/project.conf
+++ b/tests/frontend/project_fail/project.conf
@@ -1,4 +1,4 @@
# Project config for frontend build test
name: test
-
+min-version: 2.0
element-path: elements
diff --git a/tests/frontend/pull.py b/tests/frontend/pull.py
index 1845f320e..e38cd1bcb 100644
--- a/tests/frontend/pull.py
+++ b/tests/frontend/pull.py
@@ -312,6 +312,7 @@ def test_pull_missing_local_blob(cli, tmpdir, datafiles):
project = str(tmpdir)
project_config = {
"name": "pull-missing-local-blob",
+ "min-version": "2.0",
"element-path": "elements",
}
project_file = os.path.join(str(tmpdir), "project.conf")
diff --git a/tests/frontend/push.py b/tests/frontend/push.py
index c2f52c514..362084372 100644
--- a/tests/frontend/push.py
+++ b/tests/frontend/push.py
@@ -640,6 +640,7 @@ def test_push_after_rebuild(cli, tmpdir, datafiles):
project,
config={
"element-path": "elements",
+ "min-version": "2.0",
"plugins": [{"origin": "local", "path": "plugins", "elements": {"randomelement": 0}}],
},
)
diff --git a/tests/frontend/strict-depends/project.conf b/tests/frontend/strict-depends/project.conf
index 627522526..1e02cb89a 100644
--- a/tests/frontend/strict-depends/project.conf
+++ b/tests/frontend/strict-depends/project.conf
@@ -1,2 +1,3 @@
name: test
element-path: elements
+min-version: 2.0
diff --git a/tests/frontend/track-cross-junction/subproject/project.conf b/tests/frontend/track-cross-junction/subproject/project.conf
index b32753625..20636c446 100644
--- a/tests/frontend/track-cross-junction/subproject/project.conf
+++ b/tests/frontend/track-cross-junction/subproject/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/frontend/track-optional-inline/project.conf b/tests/frontend/track-optional-inline/project.conf
index 3f02c4718..47a2552c7 100644
--- a/tests/frontend/track-optional-inline/project.conf
+++ b/tests/frontend/track-optional-inline/project.conf
@@ -1,5 +1,5 @@
name: test
-
+min-version: 2.0
options:
test:
type: bool
diff --git a/tests/frontend/track-optional-project-refs/project.conf b/tests/frontend/track-optional-project-refs/project.conf
index 37fe02caa..3cb9bdc46 100644
--- a/tests/frontend/track-optional-project-refs/project.conf
+++ b/tests/frontend/track-optional-project-refs/project.conf
@@ -1,4 +1,5 @@
name: test
+min-version: 2.0
ref-storage: project.refs
diff --git a/tests/frontend/track.py b/tests/frontend/track.py
index 07a89d428..2ebaae81f 100644
--- a/tests/frontend/track.py
+++ b/tests/frontend/track.py
@@ -144,7 +144,7 @@ def test_track_cross_junction(cli, tmpdir, datafiles, cross_junction, ref_storag
# Generate project.conf
#
- project_conf = {"name": "test", "ref-storage": ref_storage}
+ project_conf = {"name": "test", "min-version": "2.0", "ref-storage": ref_storage}
_yaml.roundtrip_dump(project_conf, os.path.join(project, "project.conf"))
#
diff --git a/tests/frontend/workspaced-build-dep/project.conf b/tests/frontend/workspaced-build-dep/project.conf
index 48da02ff0..a4b4e7cca 100644
--- a/tests/frontend/workspaced-build-dep/project.conf
+++ b/tests/frontend/workspaced-build-dep/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: test
-# Required BuildStream format version
-format-version: 18
+# Required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/frontend/workspaced-runtime-dep/project.conf b/tests/frontend/workspaced-runtime-dep/project.conf
index 48da02ff0..a4b4e7cca 100644
--- a/tests/frontend/workspaced-runtime-dep/project.conf
+++ b/tests/frontend/workspaced-runtime-dep/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: test
-# Required BuildStream format version
-format-version: 18
+# Required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/integration/project/project.conf b/tests/integration/project/project.conf
index ddfe47b6d..d30996041 100644
--- a/tests/integration/project/project.conf
+++ b/tests/integration/project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: test
+min-version: 2.0
element-path: elements
aliases:
alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
diff --git a/tests/internals/loader/onefile/project.conf b/tests/internals/loader/onefile/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/internals/loader/onefile/project.conf
+++ b/tests/internals/loader/onefile/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/internals/pluginloading/badversionelement/project.conf b/tests/internals/pluginloading/badversionelement/project.conf
index 4f32752c3..bff73e251 100644
--- a/tests/internals/pluginloading/badversionelement/project.conf
+++ b/tests/internals/pluginloading/badversionelement/project.conf
@@ -1,4 +1,5 @@
name: pony
+min-version: 2.0
element-path: elements
plugins:
diff --git a/tests/internals/pluginloading/badversionsource/project.conf b/tests/internals/pluginloading/badversionsource/project.conf
index 58cf9c577..cd5b2dc82 100644
--- a/tests/internals/pluginloading/badversionsource/project.conf
+++ b/tests/internals/pluginloading/badversionsource/project.conf
@@ -1,4 +1,5 @@
name: pony
+min-version: 2.0
element-path: elements
plugins:
diff --git a/tests/internals/pluginloading/customelement/project.conf b/tests/internals/pluginloading/customelement/project.conf
index bdc909985..6a33cc504 100644
--- a/tests/internals/pluginloading/customelement/project.conf
+++ b/tests/internals/pluginloading/customelement/project.conf
@@ -1,4 +1,5 @@
name: pony
+min-version: 2.0
element-path: elements
plugins:
- origin: local
diff --git a/tests/internals/pluginloading/customsource/project.conf b/tests/internals/pluginloading/customsource/project.conf
index 8205d185a..87d9b5d09 100644
--- a/tests/internals/pluginloading/customsource/project.conf
+++ b/tests/internals/pluginloading/customsource/project.conf
@@ -1,4 +1,5 @@
name: pony
+min-version: 2.0
element-path: elements
plugins:
- origin: local
diff --git a/tests/plugins/deprecationwarnings/project/project.conf b/tests/plugins/deprecationwarnings/project/project.conf
index 18e368fe9..8a2536cab 100644
--- a/tests/plugins/deprecationwarnings/project/project.conf
+++ b/tests/plugins/deprecationwarnings/project/project.conf
@@ -1,8 +1,8 @@
# Unique project name
name: deprecation-warnings
-# Required BuildStream format version
-format-version: 20
+# Required BuildStream version
+min-version: 2.0
# Subdirectory where elements are stored
element-path: elements
diff --git a/tests/remoteexecution/project/files/sub-project/project.conf b/tests/remoteexecution/project/files/sub-project/project.conf
index c4d876cc2..c8d9e327f 100644
--- a/tests/remoteexecution/project/files/sub-project/project.conf
+++ b/tests/remoteexecution/project/files/sub-project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: subtest
+min-version: 2.0
element-path: elements
diff --git a/tests/remoteexecution/project/project.conf b/tests/remoteexecution/project/project.conf
index ddfe47b6d..d30996041 100644
--- a/tests/remoteexecution/project/project.conf
+++ b/tests/remoteexecution/project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: test
+min-version: 2.0
element-path: elements
aliases:
alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
diff --git a/tests/sandboxes/missing-command/project.conf b/tests/sandboxes/missing-command/project.conf
index b32753625..20636c446 100644
--- a/tests/sandboxes/missing-command/project.conf
+++ b/tests/sandboxes/missing-command/project.conf
@@ -1 +1,2 @@
name: test
+min-version: 2.0
diff --git a/tests/sandboxes/missing-dependencies/project.conf b/tests/sandboxes/missing-dependencies/project.conf
index 080ab758f..fee86b3f9 100755
--- a/tests/sandboxes/missing-dependencies/project.conf
+++ b/tests/sandboxes/missing-dependencies/project.conf
@@ -1,4 +1,4 @@
# Project config for missing dependencies test
name: test
-
+min-version: 2.0
element-path: elements
diff --git a/tests/sandboxes/project/project.conf b/tests/sandboxes/project/project.conf
index ddfe47b6d..d30996041 100644
--- a/tests/sandboxes/project/project.conf
+++ b/tests/sandboxes/project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: test
+min-version: 2.0
element-path: elements
aliases:
alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
diff --git a/tests/sourcecache/project/project.conf b/tests/sourcecache/project/project.conf
index 728f3faa1..dde417f71 100644
--- a/tests/sourcecache/project/project.conf
+++ b/tests/sourcecache/project/project.conf
@@ -1,5 +1,6 @@
# Project config for frontend build test
name: test
+min-version: 2.0
element-path: elements
diff --git a/tests/sources/bzr/project.conf b/tests/sources/bzr/project.conf
index 04b84631f..08a9d60db 100644
--- a/tests/sources/bzr/project.conf
+++ b/tests/sources/bzr/project.conf
@@ -1,2 +1,3 @@
# Basic Project
name: foo
+min-version: 2.0
diff --git a/tests/sources/git/project-override/project.conf b/tests/sources/git/project-override/project.conf
index 299992f15..01c901657 100644
--- a/tests/sources/git/project-override/project.conf
+++ b/tests/sources/git/project-override/project.conf
@@ -1,5 +1,6 @@
# Basic project
name: foo
+min-version: 2.0
sources:
git:
config:
diff --git a/tests/sources/git/template/project.conf b/tests/sources/git/template/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/git/template/project.conf
+++ b/tests/sources/git/template/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/local/basic/project.conf b/tests/sources/local/basic/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/local/basic/project.conf
+++ b/tests/sources/local/basic/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/local/directory/project.conf b/tests/sources/local/directory/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/local/directory/project.conf
+++ b/tests/sources/local/directory/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/local/file-exists/project.conf b/tests/sources/local/file-exists/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/local/file-exists/project.conf
+++ b/tests/sources/local/file-exists/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/local/invalid-relative-path/project.conf b/tests/sources/local/invalid-relative-path/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/local/invalid-relative-path/project.conf
+++ b/tests/sources/local/invalid-relative-path/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/local/symlink/project.conf b/tests/sources/local/symlink/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/local/symlink/project.conf
+++ b/tests/sources/local/symlink/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/no-fetch-cached/project.conf b/tests/sources/no-fetch-cached/project.conf
index af0cec15c..eeb00d432 100644
--- a/tests/sources/no-fetch-cached/project.conf
+++ b/tests/sources/no-fetch-cached/project.conf
@@ -1,5 +1,6 @@
# Project with local source plugins
name: no-fetch-cached
+min-version: 2.0
plugins:
- origin: local
diff --git a/tests/sources/patch/basic/project.conf b/tests/sources/patch/basic/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/patch/basic/project.conf
+++ b/tests/sources/patch/basic/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/patch/different-strip-level/project.conf b/tests/sources/patch/different-strip-level/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/patch/different-strip-level/project.conf
+++ b/tests/sources/patch/different-strip-level/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/patch/invalid-relative-path/project.conf b/tests/sources/patch/invalid-relative-path/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/patch/invalid-relative-path/project.conf
+++ b/tests/sources/patch/invalid-relative-path/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/patch/multiple-patches/project.conf b/tests/sources/patch/multiple-patches/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/patch/multiple-patches/project.conf
+++ b/tests/sources/patch/multiple-patches/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/patch/separate-patch-dir/project.conf b/tests/sources/patch/separate-patch-dir/project.conf
index afa0f5475..dc34380a4 100644
--- a/tests/sources/patch/separate-patch-dir/project.conf
+++ b/tests/sources/patch/separate-patch-dir/project.conf
@@ -1,2 +1,3 @@
# Basic project
name: foo
+min-version: 2.0
diff --git a/tests/sources/previous_source_access/project.conf b/tests/sources/previous_source_access/project.conf
index 5d50ec2c5..2d3bb1fb2 100644
--- a/tests/sources/previous_source_access/project.conf
+++ b/tests/sources/previous_source_access/project.conf
@@ -1,5 +1,6 @@
# Project with local source plugins
name: foo
+min-version: 2.0
element-path: elements
diff --git a/tests/sources/project_key_test/project.conf b/tests/sources/project_key_test/project.conf
index 97ab12c05..fb9ba1f88 100644
--- a/tests/sources/project_key_test/project.conf
+++ b/tests/sources/project_key_test/project.conf
@@ -1,4 +1,5 @@
name: key-test
+min-version: 2.0
element-path: elements