From b54d08f36067118105a1e6b6c35ee55e8e60e33c Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Fri, 16 Aug 2024 14:05:34 -0700 Subject: [PATCH] Shorten temporary directory paths Shortens temporary directory paths by ~13 bytes, to prevent errors when constructing Unix-domain socket paths: LOG: Unix-domain socket path "/private/tmp/nix-build-aaaaaaa-aaaaaaaaaa-0.1.0.0.drv-0/tmp-postgres-socket-88e650c49cd6880b/.s.PGSQL.63901" is too long (maximum 103 bytes) WARNING: could not create Unix-domain socket in directory "/private/tmp/nix-build-aaaaaaa-aaaaaaaaaa-0.1.0.0.drv-0/tmp-postgres-socket-88e650c49cd6880b" FATAL: could not create any Unix-domain sockets --- src/Database/Postgres/Temp/Internal/Config.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/Postgres/Temp/Internal/Config.hs b/src/Database/Postgres/Temp/Internal/Config.hs index d36f0af..19dd5ea 100644 --- a/src/Database/Postgres/Temp/Internal/Config.hs +++ b/src/Database/Postgres/Temp/Internal/Config.hs @@ -799,9 +799,9 @@ setupConfig config@Config {..} = evalContT $ do resourcesTemporaryDir = fromMaybe defaultTemp $ getLast temporaryDirectory resourcesInitDbCache = join $ getLast initDbCache resourcesSocketDirectory <- ContT $ bracketOnError - (setupDirectoryType resourcesTemporaryDir "tmp-postgres-socket" socketDirectory) cleanupDirectoryType + (setupDirectoryType resourcesTemporaryDir "socket" socketDirectory) cleanupDirectoryType resourcesDataDir <- ContT $ bracketOnError - (setupDirectoryType resourcesTemporaryDir "tmp-postgres-data" dataDirectory) cleanupDirectoryType + (setupDirectoryType resourcesTemporaryDir "data" dataDirectory) cleanupDirectoryType let hostAndDir = toPlan (hasInitDb config) (hasCreateDb config)