From ecb789d450c320bea863dbb345cd1bcc885cc63c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 27 Jan 2025 17:40:47 +0000 Subject: [PATCH] build: Ensure the ccache directory exists or create it Signed-off-by: Michael Tremer --- src/pakfire/build.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 12887f77..10eb47ff 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -1884,6 +1884,14 @@ static int pakfire_build_setup_ccache(struct pakfire_build* build) { if (r) return r; + // Ensure the directory exist + r = pakfire_mkdir(build->ccache_path, 0755); + if (r < 0) { + ERROR(build->ctx, "Could not create ccache %s: %s\n", + build->ccache_path, strerror(-r)); + return r; + } + // Bind-mount the directory into the jail r = pakfire_jail_bind(build->jail, build->ccache_path, CCACHE_DIR, MS_NOSUID|MS_NOEXEC|MS_NODEV); -- 2.47.3