You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/08/15 06:55:38 UTC

[buildstream] 01/01: _context.py: Don't call utils._get_bst_api_version() at load time.

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/fix-complete-artifact
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit b33e56b30693c0a2581016c0ad679acb7c65e317
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Mon Aug 15 15:53:07 2022 +0900

    _context.py: Don't call utils._get_bst_api_version() at load time.
    
    Getting the version requires importing the __version__ module which not
    available at bash completion time, and we need to load the buildstream.conf
    file when completing artifact names (because the config may determine where
    the local artifact cache resides).
    
    This fixes stack traces which were occurring in `bst artifact checkout <TAB>`
---
 src/buildstream/_context.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index ded01a44b..710c706a2 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -273,8 +273,7 @@ class Context:
             # trying a (major point) version specific configuration file
             # and then falling back to buildstream.conf.
             #
-            major_version, _ = utils._get_bst_api_version()
-            for config_filename in ("buildstream{}.conf".format(major_version), "buildstream.conf"):
+            for config_filename in ("buildstream2.conf", "buildstream.conf"):
                 default_config = os.path.join(os.environ["XDG_CONFIG_HOME"], config_filename)
                 if os.path.exists(default_config):
                     config = default_config