-
Notifications
You must be signed in to change notification settings - Fork 725
Open
Description
cabal/Cabal/src/Distribution/Simple/Configure.hs
Lines 318 to 334 in 26ab5ef
| -- | After running configure, output the 'LocalBuildInfo' to the | |
| -- 'localBuildInfoFile'. | |
| writePersistBuildConfig | |
| :: Maybe (SymbolicPath CWD (Dir Pkg)) | |
| -- ^ Working directory | |
| -> SymbolicPath Pkg (Dir Dist) | |
| -- ^ The @dist@ directory path. | |
| -> LocalBuildInfo | |
| -- ^ The 'LocalBuildInfo' to write. | |
| -> IO () | |
| writePersistBuildConfig mbWorkDir distPref lbi = do | |
| createDirectoryIfMissing False (i distPref) | |
| writeFileAtomic (i $ localBuildInfoFile distPref) $ | |
| BLC8.unlines [showHeader pkgId, structuredEncode lbi] | |
| where | |
| i = interpretSymbolicPath mbWorkDir -- See Note [Symbolic paths] in Distribution.Utils.Path | |
| pkgId = localPackage lbi |
While working on #10938, I noticed that writePersistBuildConfig is the most common source of race for file I/O. It seems like not only writePersistBuildConfig is executed more than once during the same build process, but it can happen to be executed concurrently from multiple Cabal threads, leading to self-imposed file access violation.
(localBuildInfoFile corresponds to dist/setup-config file)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels