diff --git a/bin/yashchiki b/bin/yashchiki index 10446bd641b0b31acb9a4ed786c443867e512063..e4c88342ad0fa79ba22d15eb0c6bd8c39070782d 100644 --- a/bin/yashchiki +++ b/bin/yashchiki @@ -6,6 +6,7 @@ import pathlib import subprocess import tempfile import textwrap +import yaml from typing import Optional @@ -136,18 +137,22 @@ paths = [ for path_to_check in paths: check_no_globbing(path_to_check) +config = None +with open(os.path.join("share", "yashchiki", "styles", args.style, "config.yaml")) as config_file: + config = yaml.safe_load(config_file) + # collection of environment variables used to configure the shell scripts' # behavior env = { - "DOCKER_BASE_IMAGE": "debian:bullseye" if args.style == "visionary" else "centos:7", + "DOCKER_BASE_IMAGE": config["docker_base_image"], # This needs to be here because otherwise the default python # (2.7.18) will pollute the spec and lead to a conflict # can be removed as soon as the explicit preferred version # is dropped - "DEPENDENCY_PYTHON": "python@3." + ("8.2" if args.style == "visionary" else "6.8"), - "YASHCHIKI_BUILD_SPACK_GCC": "1" if args.style == "visionary" else "0", - "YASHCHIKI_SPACK_GCC_VERSION": "11.2.0" if args.style == "visionary" else "4.8.5", - "YASHCHIKI_SPACK_GCC": "gcc@11.2.0" if args.style == "visionary" else "gcc@4.8.5", + "DEPENDENCY_PYTHON": "python@" + config["dependency_python"], + "YASHCHIKI_BUILD_SPACK_GCC": str(int(config["spack_gcc"]["build"])), + "YASHCHIKI_SPACK_GCC_VERSION": config["spack_gcc"]["version"], + "YASHCHIKI_SPACK_GCC": "gcc@" + config["spack_gcc"]["version"], "WORKSPACE": os.getcwd(), # FIXME: should not be required "CONTAINER_STYLE": args.style, "CONTAINER_BUILD_TYPE": "testing", # FIXME: should not be required diff --git a/share/yashchiki/styles/asic/config.yaml b/share/yashchiki/styles/asic/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ef427c02efa44d5ce37480f16496e74400b32c83 --- /dev/null +++ b/share/yashchiki/styles/asic/config.yaml @@ -0,0 +1,5 @@ +docker_base_image: "centos:7" +dependency_python: "3.8.3" +spack_gcc: + build: false + version: "4.8.5" diff --git a/share/yashchiki/styles/visionary/config.yaml b/share/yashchiki/styles/visionary/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7b8f7f4c4a1db63c8a449d3e23a2264f1c6bc8fa --- /dev/null +++ b/share/yashchiki/styles/visionary/config.yaml @@ -0,0 +1,7 @@ +docker_base_image: "debian:bullseye" +dependency_python: "3.8.2" +spack_gcc: + # Whether to build the specified gcc via spack or assume existance. + build: true + # Version to use as compiler for spack build. + version: "11.2.0"