From a5ea37ac7fc3b8cf58642a1b77e74e5cc4990767 Mon Sep 17 00:00:00 2001
From: Nicolas Richart <nicolas.richart@epfl.ch>
Date: Wed, 7 Feb 2024 18:30:34 +0100
Subject: [PATCH] Lots of small fixes

---
 ci/install_compilers.sh |  8 ++++----
 ci/setup_spack.sh       |  4 ++--
 config.json             | 12 ++++++++++--
 config.yaml             |  4 ++--
 4 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ci/install_compilers.sh b/ci/install_compilers.sh
index 4fc787f..4f74853 100755
--- a/ci/install_compilers.sh
+++ b/ci/install_compilers.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 
-COMPILER_LIST_SPECS=$(jq -Mr '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")[]' config.json)
+COMPILER_LIST_SPECS=$(jq -Mr '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.spec_version) %\($core)")[]' config.json)
 
 echo "Getting system compiler"
 spack/bin/spack compiler find --scope system /usr
@@ -40,7 +40,7 @@ spack/bin/spack buildcache create \
 
 core_compiler=$(jq -Mrc '.stack | .core_compiler' config.json)
 compilers=$(jq -Mrc '.stack | .compilers | to_entries | map("\(.key)@\(.value.version)")' config.json)
-compilers_specs=$(jq -Mrc '.stack | .compilers | map("\(.spec)@\(.version)")' config.json)
+compilers_specs=$(jq -Mrc '.stack | .compilers | map("\(.spec)@\(.spec_version)")' config.json)
 
 cat > compiler_definitions.yaml << EOF
 definitions:
@@ -55,10 +55,10 @@ for compiler_hash in $(echo ${hashes}); do
     location=$(spack/bin/spack location -i ${compiler_hash})
     echo "Checking for compiler in locations:"
     echo "  - ${location}"
-    echo "  - ${location}/compiler/latest"
+    echo "  - ${location}/compiler/latest/linux"
 
     spack/bin/spack compiler find \
         --scope system \
         ${location} \
-        ${location}/compiler/latest
+        ${location}/compiler/latest/linux
 done
diff --git a/ci/setup_spack.sh b/ci/setup_spack.sh
index b264a39..774fc0c 100755
--- a/ci/setup_spack.sh
+++ b/ci/setup_spack.sh
@@ -27,8 +27,8 @@ EXTERNAL_REPOS=$(jq -r '.spack.repos | keys[]' config.json)
 
 for file in mirrors.yaml repos.yaml packages.yaml concretizer.yaml config.yaml
 do
-    if [ -e ${file} ]; then
-        cp ${file} ${SPACK_SYSTEM_CONFIG_PATH}
+    if [ -e "${file}" ]; then
+        cp "${file}" ${SPACK_SYSTEM_CONFIG_PATH}
     fi
 done
 
diff --git a/config.json b/config.json
index cbc0637..e6db38e 100644
--- a/config.json
+++ b/config.json
@@ -16,8 +16,16 @@
         "mount_point": "/stack",
         "core_compiler": "gcc@11.4.1 arch=linux-rhel9-x86_64_v2",
         "compilers": {
-            "gcc": { "spec": "gcc", "version": "12.2.0" },
-            "oneapi": { "spec": "intel-oneapi-compilers", "version": "2023.2.1" }
+            "gcc": {
+                "spec": "gcc",
+                "spec_version": "12.2.0",
+                "version": "12.2.0"
+            },
+            "oneapi": {
+                "spec": "intel-oneapi-compilers",
+                "spec_version": "2023.2.1",
+                "version": "2023.2.0"
+            }
         }
     }
 }
diff --git a/config.yaml b/config.yaml
index da38440..6e41c66 100644
--- a/config.yaml
+++ b/config.yaml
@@ -2,5 +2,5 @@ config:
 #  ccache: true
   install_missing_compilers: false
 
-  install_tree:
-    padded_length: true
+#  install_tree:
+#    padded_length: true
-- 
GitLab