diff --git a/ci/build-repo.sh b/ci/build-repo.sh
index 3b7488d866b76e2d710ad7ee7c9c783acab2893d..619308b17c03b653b97ce8584174d11bd85b9c56 100755
--- a/ci/build-repo.sh
+++ b/ci/build-repo.sh
@@ -168,7 +168,7 @@ build_repo() {
   cp -R $PATCHES tmp/patches
   hackage-repo-tool bootstrap --keys=./keys --repo=./repo
 
-  mkdir -p template patches.cache
+  mkdir -p template tmp/patches.cache
   tool \
     --patches=./tmp/patches \
     --repo-cache=./cache \