diff --git a/ci/install_compilers.sh b/ci/install_compilers.sh
index 5f5b8214e6d92217d572aa1ee4c26ee1d6c6a78e..155ab614ab22532c3235242380121f2bcdd93b28 100755
--- a/ci/install_compilers.sh
+++ b/ci/install_compilers.sh
@@ -4,7 +4,7 @@ set -o errexit
 set -o pipefail
 set -o nounset
 
-source stack_env.sh
+source ${CI_PROJECT_DIR}/ci/stack_env.sh
 
 echo "Getting system compiler"
 ${STACK_LOCATION}/spack/bin/spack compiler find --scope system /usr
diff --git a/ci/setup_spack.sh b/ci/setup_spack.sh
index 2f27f89946535957d6c94fd717415f9a2323f1da..166990264fa8577cbb922b52f92f537b44e269b3 100755
--- a/ci/setup_spack.sh
+++ b/ci/setup_spack.sh
@@ -4,7 +4,7 @@ set -o errexit
 set -o pipefail
 set -o nounset
 
-source stack_env.sh
+source ${CI_PROJECT_DIR}/ci/stack_env.sh
 
 mkdir -p ${STACK_LOCATION}
 cd ${STACK_LOCATION}