From 8457fb493f1241c360adf56a388dd964f7f5a1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20M=C3=BCller?= <mueller@kip.uni-heidelberg.de> Date: Wed, 24 Jul 2024 10:12:45 +0200 Subject: [PATCH] fix: spackdir not needed for stage "build-base-image" Change-Id: I8fb1fe396c83c50eabd57cf09012c63adc6923ba --- bin/yashchiki | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/yashchiki b/bin/yashchiki index 8970d3f1..6d17e3a9 100755 --- a/bin/yashchiki +++ b/bin/yashchiki @@ -134,9 +134,6 @@ args = parser.parse_args() root_dir = pathlib.Path(__file__).parent.parent # check provided paths -if not args.spack_dir.is_dir(): - raise NotADirectoryError("spack_dir is required to be a path to an " - "existing directory.") if (args.meta_dir is not None) and (not args.meta_dir.is_dir()): raise NotADirectoryError("meta-dir is required to be a path to an " "existing directory.") @@ -191,14 +188,19 @@ env.update({ "YASHCHIKI_JOBS": str(args.jobs), }) +needs_spackdir = False + if "fetch" in args.stages: env.update({"YASHCHIKI_ENABLE_STAGE_FETCH": "1"}) + needs_spackdir = True if "build-base" in args.stages: env.update({"YASHCHIKI_ENABLE_STAGE_BUILD_BASE": "1"}) + needs_spackdir = True if "build-spack" in args.stages: env.update({"YASHCHIKI_ENABLE_STAGE_BUILD_SPACK": "1"}) + needs_spackdir = True if "image" in args.stages: env.update({"YASHCHIKI_ENABLE_STAGE_IMAGE": "1"}) @@ -207,6 +209,11 @@ if args.stages != all_stages: if not pathlib.Path(args.sandboxes_dir, args.style).exists(): raise RuntimeError("Using yashchiki with incomplete set of stages is only possible for using an existing sandbox.") +if needs_spackdir: + if not args.spack_dir.is_dir(): + raise NotADirectoryError("spack_dir is required to be a path to an " + "existing directory.") + if args.build_cache_on_failure_name: env.update({"YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME": args.build_cache_on_failure_name}) -- GitLab