From fa70fad6e3f526137aa0a3062ed967c33d036a8e Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Wed, 2 Jul 2025 17:05:17 +0200 Subject: [PATCH 1/2] Renamed perform_build_steps to perform_build Strictly speaking, this function does more than just the steps. Thus, to avoid confusion, let's drop that part. Signed-off-by: Ole Herman Schumacher Elgesem --- cfbs/build.py | 2 +- cfbs/commands.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cfbs/build.py b/cfbs/build.py index 9b8ac196..c038f2c2 100644 --- a/cfbs/build.py +++ b/cfbs/build.py @@ -260,7 +260,7 @@ def _perform_build_step(module, step, max_length): write_json(path, merged) -def perform_build_steps(config) -> int: +def perform_build(config) -> int: if not config.get("build"): user_error("No 'build' key found in the configuration") diff --git a/cfbs/commands.py b/cfbs/commands.py index 9b3535d6..f405934b 100644 --- a/cfbs/commands.py +++ b/cfbs/commands.py @@ -41,7 +41,7 @@ ) from cfbs.build import ( init_out_folder, - perform_build_steps, + perform_build, ) from cfbs.cfbs_config import CFBSConfig, CFBSReturnWithoutCommit from cfbs.validate import validate_config @@ -803,7 +803,7 @@ def build_command(ignore_versions=False) -> int: # so we try building anyway and don't return error(s) init_out_folder() _download_dependencies(config, prefer_offline=True, ignore_versions=ignore_versions) - r = perform_build_steps(config) + r = perform_build(config) return r From dd63ef09b43487e6a1ea20a452a13b22f4c03589 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Wed, 2 Jul 2025 17:10:58 +0200 Subject: [PATCH 2/2] 'cfbs build' now includes cfbs.json into the policy set This file is useful, especially to see which modules were used and their versions. This is also less confusing than the current situation; 'masterfiles' module is putting a cfbs.json there (its own). Other modules can do the same. Ticket: CFE-4553 Signed-off-by: Ole Herman Schumacher Elgesem --- cfbs/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cfbs/build.py b/cfbs/build.py index c038f2c2..f81771ee 100644 --- a/cfbs/build.py +++ b/cfbs/build.py @@ -1,5 +1,6 @@ import os import logging as log +import shutil from typing import List, Tuple from cfbs.utils import ( canonify, @@ -298,6 +299,8 @@ def perform_build(config) -> int: for module in config.get("build", []): for step in module["steps"]: _perform_build_step(module, step, module_name_length) + assert os.path.isdir("./out/masterfiles/") + shutil.copyfile("./cfbs.json", "./out/masterfiles/cfbs.json") if os.path.isfile("out/masterfiles/def.json"): pretty_file("out/masterfiles/def.json") print("")