diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fd39c0d828ec2404bd39643f293e387e38cc8ed8..3abcc7365cb6cf5740ec3007180722dba09b2813 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -117,6 +117,8 @@ spack:install_compilers:
     - COMPILER_LIST_SPECS=$(jq -r '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")[]' config.json)
     - echo "Compilers to install \n${COMPILER_LIST_SPECS}"
 
+    - spack/bin/spack compiler find --scope system /usr
+
     - spack/bin/spack spec
       --install-status
       --namespaces
@@ -139,8 +141,6 @@ spack:install_compilers:
     - |
       echo 'definitions: [ compilers: [' ${COMPILER_LIST_SPECS} ']]' > compiler_definitions.yaml
 
-    - spack/bin/spack compiler find --scope system /usr
-
     - |
       while read -r compiler
       do