From 82baa27f9d1c5f15906b4aa9b9a40b3d900bec09 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@gmail.com>
Date: Mon, 7 Oct 2024 11:23:32 +0100
Subject: [PATCH 0918/1160] Semaphore: switch from /tmp to /var/tmp to avoid
 disk space issues

Builds have been failing as we run out of space in /tmp/, move to
/var/tmp

(cherry picked from commit 0c7b5dad33ee01b7ff6b7a8c583a7e2c27ac0673)
(cherry picked from commit bc0102b0caacb97041ada0b0dbca40da09eab453)
---
 .semaphore/semaphore-runner.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.semaphore/semaphore-runner.sh b/.semaphore/semaphore-runner.sh
index d2ee50b41c..6cb947fa71 100755
--- a/.semaphore/semaphore-runner.sh
+++ b/.semaphore/semaphore-runner.sh
@@ -11,7 +11,8 @@ SALSA_URL="${SALSA_URL:-https://salsa.debian.org/systemd-team/systemd.git}"
 BRANCH="${BRANCH:-upstream-ci}"
 ARCH="${ARCH:-amd64}"
 CONTAINER="${RELEASE}-${ARCH}"
-CACHE_DIR="${SEMAPHORE_CACHE_DIR:-/tmp}"
+CACHE_DIR=/var/tmp
+TMPDIR=/var/tmp
 AUTOPKGTEST_DIR="${CACHE_DIR}/autopkgtest"
 # semaphore cannot expose these, but useful for interactive/local runs
 ARTIFACTS_DIR=/tmp/artifacts
@@ -101,7 +102,7 @@ EOF
             # now build the package and run the tests
             rm -rf "$ARTIFACTS_DIR"
             # autopkgtest exits with 2 for "some tests skipped", accept that
-            sudo "$AUTOPKGTEST_DIR/runner/autopkgtest" --env DEB_BUILD_OPTIONS="noudeb nostrip optimize=-lto" \
+            sudo TMPDIR=/var/tmp "$AUTOPKGTEST_DIR/runner/autopkgtest" --env DEB_BUILD_OPTIONS="noudeb nostrip optimize=-lto" \
                                                        --env DPKG_DEB_COMPRESSOR_TYPE="none" \
                                                        --env DEB_BUILD_PROFILES="noudeb" \
                                                        --env TEST_UPSTREAM=1 \
-- 
2.33.0