File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1928,12 +1928,15 @@ singleTest topts testsToRun ac ee task installedMap = do
1928
1928
-- see e.g. https://github.com/doctest/issues/119
1929
1929
-- also we set HASKELL_DIST_DIR to a package dist directory so
1930
1930
-- doctest will be able to load modules autogenerated by Cabal
1931
- ghcEnvRandomId <- liftIO (randomIO :: IO Int )
1932
1931
let setEnv f pc = modifyEnvVars pc $ \ envVars ->
1933
1932
Map. insert " HASKELL_DIST_DIR" (T. pack $ toFilePath buildDir) $
1934
1933
Map. insert " GHC_ENVIRONMENT" (T. pack f) envVars
1935
- fp = toFilePath (eeTempDir ee </> testGhcEnvRelFile) <> show ghcEnvRandomId
1936
- snapDBPath = toFilePathNoTrailingSep (bcoSnapDB $ eeBaseConfigOpts ee)
1934
+ fp' = eeTempDir ee </> testGhcEnvRelFile
1935
+ -- Add a random suffix to avoid conflicts between parallel jobs
1936
+ -- See https://github.com/commercialhaskell/stack/issues/5024
1937
+ randomSuffix <- (" -" <> ) . show <$> liftIO (randomIO :: IO Int )
1938
+ fp <- toFilePath <$> addExtension randomSuffix fp'
1939
+ let snapDBPath = toFilePathNoTrailingSep (bcoSnapDB $ eeBaseConfigOpts ee)
1937
1940
localDBPath = toFilePathNoTrailingSep (bcoLocalDB $ eeBaseConfigOpts ee)
1938
1941
ghcEnv =
1939
1942
" clear-package-db\n " <>
You can’t perform that action at this time.
0 commit comments