cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Possible race condition when creating `.cabal/store/ghc-....`

Open andreasabel opened this issue 2 weeks ago • 2 comments

After a fresh install of GHC 9.14 rc3:

$ cabal build                                                                       
Resolving dependencies...
Build profile: -w ghc-9.14.0.20251128 -O1
In order, the following will be built (use -v for more details):
 - OneTuple-0.4.2 (lib) (requires build)
 - ... (many, many)
 - enummapset-0.7.3.0 (lib) (requires build)
 - Agda-2.9.0 (lib) (first run)
 - Agda-2.9.0 (exe:agda) (first run)
 - Agda-2.9.0 (exe:agda-tests) (first run)
ghc-pkg-9.14.0.20251128: cannot create: /.cabal/store/ghc-9.14.0.20251128-d369/package.db already exists

This is a transient error, so I suppose this is a race condition when things are build in parallel.

This could also be a bug in ghc-pkg.

andreasabel avatar Dec 07 '25 14:12 andreasabel

Sounds like a dup of #11298

geekosaur avatar Dec 07 '25 20:12 geekosaur

Sounds like a dup of #11298

Interesting that this one is in temporal proximity (just 3 weeks ago).

#11298 has a slightly different symptom, also it is for running cabal in parallel. Here, there is just one instance of cabal running, and it could indeed apply some sort of locking for calling ghc-pkg.

andreasabel avatar Dec 08 '25 09:12 andreasabel