#1112056 sccache-push does not respect either SCCACHE_DIR or XDG_CACHE_HOME

Package:
sccache
Source:
sccache
Description:
compiler cache for fast recompilation of C/C++/Rust code
Submitter:
Louis Sven Goulet
Date:
2025-08-27 13:37:02 UTC
Severity:
normal
#1112056#5
Date:
2025-08-25 17:38:00 UTC
From:
To:
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

#1112056#10
Date:
2025-08-26 04:56:35 UTC
From:
To:
Hi Louis Sven,

Quoting Louis Sven Goulet (2025-08-25 19:38:00)

This looks like you are proposing a change to upstream code.

I don't want to deviate from upstream, so I recommend that you propose
your change at the upstream bugtracker instead - here:
https://github.com/mozilla/sccache/issues

Please also beware that sccache in Debian is currently built with a
range of features disabled (mentioning since you talk about remote
buckets).

Kind regards,

 - Jonas

#1112056#15
Date:
2025-08-26 14:54:01 UTC
From:
To:
Thank you for responding quickly.
I've looked through upstream sccache's repo already and could not find
the "sccache-push" script in question. I believe, maybe wrongly, that
it must have been added as part of the Debian package.

I even checked Arch's repos to make sure, and it looks like
"sccache-push" isn't part of that package either.
https://archlinux.org/packages/extra/x86_64/sccache/

If you still believe this script is not under your jurisdiction, feel
free to close this bug report.

#1112056#20
Date:
2025-08-27 09:17:18 UTC
From:
To:
Quoting Louis Sven Goulet (2025-08-26 16:54:01)

I will admit that I was puzzled by that script name as well.  And not
only that: You filed this bugreport against version 0.9.1 of sccache,
but no such version is provided in any Debian release. Are you sure you
installed sccache from Debian?

 - Jonas

#1112056#25
Date:
2025-08-27 12:42:25 UTC
From:
To:
Thanks again for getting back to me.

You were right, I was not pulling in the official package. I work in a
corporate environment
and it looks like someone forked sccache in our internal PPA and added a
few scripts to it.

Sorry again for bothering you.

Louis Sven Goulet

#1112056#30
Date:
2025-08-27 13:35:36 UTC
From:
To:
Quoting lor louis (2025-08-27 14:42:25)

No problem at all.

I hereby close this as a non-bug (in Debian, at least).

Kind regards,

 - Jonas