]> git.ipfire.org Git - pakfire.git/commitdiff
build: Set CCACHE_TEMPDIR to /tmp
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 May 2023 18:11:56 +0000 (18:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 May 2023 18:11:56 +0000 (18:11 +0000)
This will cause that ccache creates any temporary files in /tmp instead
of the cache dir. This caused massive bandwidth and slightly slow builds
with a shared NFS cache.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/build.c

index e7eca7fcd65c1c3511ef561a3e79b93227aa69d3..c4e89640ce59e861c74a3764b5f28ef29b56bc1e 100644 (file)
@@ -1504,6 +1504,13 @@ static int pakfire_build_setup_ccache(struct pakfire_build* build) {
                return 0;
        }
 
+       // Set CCACHE_TEMPDIR
+       r = pakfire_jail_set_env(build->jail, "CCACHE_TEMPDIR", "/tmp");
+       if (r) {
+               ERROR(build->pakfire, "Could not set ccache tempdir: %m\n");
+               return r;
+       }
+
        // Set a default path
        r = pakfire_cache_path(build->pakfire, build->ccache_path, "%s", "ccache");
        if (r)