Skip to content
Snippets Groups Projects
Commit d96bab9b authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

fix: dict.update instead of | operator

* allows for python@:3.8 compatibility

Change-Id: Id24d73dc4c9574852cf1edc2c99d9a56da1fbb4f
parent 85373c8a
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,8 @@ tmpdir.mkdir(exist_ok=True, parents=True)
# collection of environment variables used to configure the shell scripts'
# behavior
env = {
env = os.environ.copy()
env.update({
"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
......@@ -174,10 +175,10 @@ env = {
"TMPDIR": tmpdir,
"YASHCHIKI_CACHES_ROOT": args.caches_dir,
"YASHCHIKI_JOBS": str(args.jobs),
} | os.environ
})
if args.build_cache_on_failure_name:
env = env | {"YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME": args.build_cache_on_failure_name}
env.update({"YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME": args.build_cache_on_failure_name})
# create directory for logs
args.log_dir.mkdir(parents=True, exist_ok=True)
......@@ -223,14 +224,14 @@ def run(script: str, env: dict, script_args: list = []):
# Temporary directory for spack
temporary_directory_spack = tmpdir.joinpath('tmp_spack')
temporary_directory_spack.mkdir(exist_ok=True, parents=True)
env = env | {"JOB_TMP_SPACK": temporary_directory_spack}
env.update({"JOB_TMP_SPACK": temporary_directory_spack})
# make job temp folder writable for all users (i.e., spack)
os.chmod(temporary_directory_spack, 0o777)
# Directory for (temporary) spack configuration
temporary_directory_spack_config = tmpdir.joinpath('spack_config')
temporary_directory_spack_config.mkdir(exist_ok=True, parents=True)
env = env | {"YASHCHIKI_SPACK_CONFIG": temporary_directory_spack_config}
env.update({"YASHCHIKI_SPACK_CONFIG": temporary_directory_spack_config})
# make spack config directory readable for all users (i.e., spack)
temporary_directory_spack_config.chmod(0o755)
......@@ -271,7 +272,7 @@ if args.recipe_filename is not None:
recipe_filename = args.recipe_filename
else:
recipe_filename = tmpdir.joinpath("recipe.def")
env = env | {"YASHCHIKI_RECIPE_PATH": recipe_filename}
env.update({"YASHCHIKI_RECIPE_PATH": recipe_filename})
# meta data directory defaults to temporary folder
if args.meta_dir is not None:
......@@ -279,7 +280,7 @@ if args.meta_dir is not None:
else:
meta_dir = tmpdir.joinpath("meta")
meta_dir.mkdir(parents=True)
env = env | {"YASHCHIKI_META_DIR": meta_dir}
env.update({"YASHCHIKI_META_DIR": meta_dir})
run("lib/yashchiki/create_caches.sh", env)
run("lib/yashchiki/fetch.sh", env)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment