From 0940abaa536b24f8f7e4199e5014222ae90b7541 Mon Sep 17 00:00:00 2001 From: Michael D Starch Date: Wed, 4 Nov 2020 19:32:49 -0800 Subject: [PATCH 1/2] mstarch: fixing build environment from settings.ini --- Fw/Python/src/fprime/fbuild/builder.py | 8 +++++++- Fw/Python/src/fprime/fbuild/cmake.py | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Fw/Python/src/fprime/fbuild/builder.py b/Fw/Python/src/fprime/fbuild/builder.py index 96f0345385..d8b4b72dd5 100644 --- a/Fw/Python/src/fprime/fbuild/builder.py +++ b/Fw/Python/src/fprime/fbuild/builder.py @@ -428,6 +428,7 @@ def execute(self, target: Target, context: Path, make_args: dict): context.absolute(), make_args=make_args, top_target=isinstance(target, GlobalTarget), + environment=self.settings.get("environment", None) ) def generate(self, cmake_args): @@ -459,7 +460,12 @@ def generate(self, cmake_args): cmake_args.update( {"CMAKE_BUILD_TYPE": self.build_type.get_cmake_build_type()} ) - self.cmake.generate_build(self.deployment, self.build_dir, cmake_args) + self.cmake.generate_build( + self.deployment, + self.build_dir, + cmake_args, + environment=self.settings.get("environment", None) + ) except CMakeException as cexc: raise GenerateException(str(cexc)) from cexc diff --git a/Fw/Python/src/fprime/fbuild/cmake.py b/Fw/Python/src/fprime/fbuild/cmake.py index ddede6f4f2..716e34e6c7 100644 --- a/Fw/Python/src/fprime/fbuild/cmake.py +++ b/Fw/Python/src/fprime/fbuild/cmake.py @@ -9,6 +9,7 @@ """ # Get a cache directory for building CMakeList file, if need and remove at exit import collections +import copy import functools import itertools import os @@ -51,7 +52,7 @@ def set_verbose(self, verbose): self.verbose = verbose def execute_known_target( - self, target, build_dir, path, cmake_args=None, make_args=None, top_target=False + self, target, build_dir, path, cmake_args=None, make_args=None, top_target=False, environment=None ): """ Executes a known target for a given build_dir. Path will default to a known path. @@ -61,6 +62,7 @@ def execute_known_target( :param path: path to run target against. (default) current working directory :param cmake_args: cmake args input :param top_target: top-level target. Do not append path name + :param environment: environment to setup when executing CMake :return: return code from CMake """ assert build_dir is not None, "Invalid build dir supplied" @@ -87,7 +89,7 @@ def execute_known_target( ) ) run_args = ["--build", build_dir] - environment = {} + environment = {} if environment is None else copy.copy(environment) if self.verbose: environment["VERBOSE"] = "1" run_args.extend(["--target", cmake_target]) @@ -207,13 +209,14 @@ def get_fprime_configuration(self, fields, cmake_dir=None): self._cmake_validate_build_dir(cmake_dir) # Validate the dir return self._read_values_from_cache(fields, build_dir=cmake_dir) - def generate_build(self, source_dir, build_dir, args=None, ignore_output=False): + def generate_build(self, source_dir, build_dir, args=None, ignore_output=False, environment=None): """Generate a build directory for purposes of the build. :param source_dir: source directory to generate from :param build_dir: build directory to generate to :param args: arguments to hand to CMake. :param ignore_output: do not print the output where the user can see it + :param environment: environment to set when generating """ if not os.path.exists(build_dir): os.makedirs(build_dir) @@ -236,6 +239,7 @@ def generate_build(self, source_dir, build_dir, args=None, ignore_output=False): workdir=build_dir, print_output=not ignore_output, write_override=True, + environment=environment ) def get_cmake_module(self, path, build_dir): From e0e96cc594e99f6c650aedd57c69dfb9d05551bc Mon Sep 17 00:00:00 2001 From: Michael D Starch Date: Thu, 5 Nov 2020 10:04:48 -0800 Subject: [PATCH 2/2] mstarch: bumping python version --- Fw/Python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fw/Python/setup.py b/Fw/Python/setup.py index 0ec8cf1a17..f108548727 100644 --- a/Fw/Python/setup.py +++ b/Fw/Python/setup.py @@ -29,7 +29,7 @@ # information should match the F prime decription information. #### name="fprime", - version="1.5.2", + version="1.5.3", license="Apache 2.0 License", description="F Prime Flight Software core data types", long_description="""