From 3d20c45c24b3ca3f632f36f5fe27c778f36e37cf Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 30 May 2023 18:11:56 +0000 Subject: [PATCH] build: Set CCACHE_TEMPDIR to /tmp 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 --- src/libpakfire/build.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libpakfire/build.c b/src/libpakfire/build.c index e7eca7fcd..c4e89640c 100644 --- a/src/libpakfire/build.c +++ b/src/libpakfire/build.c @@ -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) -- 2.39.5