From 5ec8ae002687b477f3eff69bce67981761e1f4fd Mon Sep 17 00:00:00 2001
From: Philipp Spilger <philipp.spilger@kip.uni-heidelberg.de>
Date: Tue, 13 Feb 2024 14:23:01 +0100
Subject: [PATCH] chore: Move chmod of spack tempdir to yashchiki script

Change-Id: I0c951d8a0c8e71c2fdc343fdccb4c83b6a2f869f
---
 bin/yashchiki                  | 3 +++
 lib/yashchiki/build_sandbox.sh | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/yashchiki b/bin/yashchiki
index f96f4c1c..61345227 100644
--- a/bin/yashchiki
+++ b/bin/yashchiki
@@ -229,6 +229,9 @@ with tempfile.TemporaryDirectory(prefix="spack-", dir=env["TMPDIR"]) \
 
     env = env | {"JOB_TMP_SPACK": temporary_directory_spack}
 
+    # make job temp folder writable for all users (i.e., spack)
+    os.chmod(temporary_directory_spack, 0o777)
+
     # singularity recipe filename defaults to temporary file
     if args.recipe_filename is not None:
         recipe_filename = args.recipe_filename
diff --git a/lib/yashchiki/build_sandbox.sh b/lib/yashchiki/build_sandbox.sh
index f524a71f..0162516d 100755
--- a/lib/yashchiki/build_sandbox.sh
+++ b/lib/yashchiki/build_sandbox.sh
@@ -14,9 +14,6 @@ unset LC_NUMERIC
 unset LC_TIME
 unset LC_MESSAGES
 
-# make job temp folder writable for all users (i.e., spack)
-chmod 777 "${JOB_TMP_SPACK}"
-
 # build the container (using scripts from above)
 if [ -n "${YASHCHIKI_PROXY_HTTP:-}" ]; then
 	export http_proxy=${YASHCHIKI_PROXY_HTTP}
-- 
GitLab