Package: sccache
Version: 0.9.1
Severity: normal

When invoking sccache with the XDG_CACHE_HOME=/tmp/.cache I was able
to get it to store the
cached data in /tmp/.cache/sccache.
Then I was able to get a full report via sccache -s, but when trying
to push the cache to a remote bucket,
using sccache-push it defaulted back to .cache/sccache to tar's path
which lead to an errorr because the file
did not exist.

I believe the issue could be fixed by adding a new flag that
overwrites the default cache path.

--- /usr/bin/sccache-push    2025-06-23 20:00:00.000000000 -0400
+++ sccache-push    2025-08-25 13:35:56.075685522 -0400
@@ -2,9 +2,19 @@

 SCCACHE_PROJECT_KEY="${1}"
 EXTRA_DIR="${2}"
+ARCHIVE_DIRS=".cache/sccache"
+
+if [ "${2}" = "--cache-path" ]; then
+    ARCHIVE_DIRS="${3}"
+    if [ -z "${ARCHIVE_DIRS}" ]; then
+        echo "expected path after --cache-path" >&2
+        exit 1
+    fi
+    EXTRA_DIR="${4}"
+fi

 if [ -z "${SCCACHE_PROJECT_KEY}" ]; then
-    echo "Usage: $0 <build name> [extra directory relative to ~]" >&2
+    echo "Usage: $0 <build name> [--cache-path <cache path>] [extra
directory relative to ~]" >&2
     echo "       extra directory example: .cache/vcpkg/archives" >&2
     exit 1
 fi
@@ -34,7 +44,6 @@
     echo "Specified extra directory not found, exiting"
 fi

-ARCHIVE_DIRS=".cache/sccache"
 if [ -d "${EXTRA_DIR_ABSOLUTE}" ]; then
     echo "Adding ${EXTRA_DIR} to sccache archive"
     ARCHIVE_DIRS="${ARCHIVE_DIRS} ${EXTRA_DIR}"

Reply via email to