diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py index 22d312042b6ac64a6f88bf4524f925e6f338609c..ce28676a20fb2bfc424def8a3c95ac5598706179 100755 --- a/mpsd-software-environment.py +++ b/mpsd-software-environment.py @@ -82,7 +82,7 @@ def create_log_file_names( toolchain : str toolchain name (only for build log file) returns : tuple - tuple containing the strings of installer and build log file names + tuple containing installer_log_file, build_log_file, file names """ installer_log_file = config_vars["installer_log_template"].substitute( mpsd_release=mpsd_release, @@ -631,7 +631,7 @@ def install_environment( # Set required variables release_base_dir = script_dir / mpsd_release - + mpsd_microarch = get_native_microarchitecture() toolchain_dir = release_base_dir / mpsd_microarch toolchain_dir.mkdir(parents=True, exist_ok=True) spack_setup_script = release_base_dir / "spack-environments" / "spack_setup.sh" @@ -667,9 +667,11 @@ def install_environment( if not os.path.exists("logs"): os.mkdir("logs") for toolchain in toolchains: - # Set the install log file name to config_vars["install_log_file"] - # and replace _toolchains_ with the toolchain name and - # _mpsd_spack_ver_ with mpsd_release + # Set the install log file name from create_log_file_names + _, build_log_file_name = create_log_file_names( + mpsd_release, mpsd_microarch, "install", toolchain=toolchain + ) + build_log_file = toolchain_dir / "logs" / build_log_file_name logging.info(f"Installing toolchain {toolchain} to {toolchain_dir}") @@ -677,7 +679,7 @@ def install_environment( setup_log_cmd( mpsd_release, script_dir, - msg=f"installing {toolchain} and logging at {install_log_file}", + msg=f"installing {toolchain} and logging at {build_log_file}", ) setup_log_cmd( mpsd_release, @@ -689,7 +691,7 @@ def install_environment( ) run( f"bash {spack_setup_script} {' '.join(install_flags)} {toolchain} 2>&1 " - f"| tee -a {install_log_file} ", + f"| tee -a {build_log_file} ", shell=True, check=True, ) @@ -813,7 +815,6 @@ def main(): set_up_logging(args.loglevel, installer_log_file) - # Check the command and run related function if args.action == "remove": remove_environment(args.release, args.toolchains, script_dir)