Repository navigation
Description
Today I was fixing some test using --file-watch, and together with legitimate compile errors I noticed an extremely high frequency of spurious failures due to stack.
While I don't have a reproduction yet (and I'm under lots of deadlines), I'm still attaching the log because the failures are interesting. Some seem clearly race conditions. The most common one, though, ghc-pkg: cannot create: .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/package.conf.inplace already exists, seems trickier. IIUC, after a failed compilation, stack does not unregister the package, even though it is still registered from earlier (maybe as a result of an earlier error)?
I'm most excited in case this is actually showing race conditions, because we've seen several Heisenbugs that might be due to race conditions in the build cycle... or to something else? But most had symptoms every couple weeks in obscure configurations, unlike this.
Here's a log extract:
$ stack test --bench --no-run-benchmarks --file-watch
[...]
Progress: 1/2
-- While building package haskell-caching-0.1.0.0 using:
/Users/pgiarrusso/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:haskell-caching test:spec bench:benchmark --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Type help for available commands. Press enter to force a rebuild.
haskell-caching-0.1.0.0: build (lib + test + bench)
ghc-pkg: cannot create: .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/package.conf.inplace already exists
[...]
haskell-caching-0.1.0.0: unregistering (local file changes: src/test/Examples/NestedLoopsSeqsCachesSpec.hs)
haskell-caching-0.1.0.0: build (lib + test + bench)
ghc-pkg: cannot create: .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/package.conf.inplace already exists
Progress: 1/2
-- While building package haskell-caching-0.1.0.0 using:
/Users/pgiarrusso/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:haskell-caching test:spec bench:benchmark --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Type help for available commands. Press enter to force a rebuild.
[...]
haskell-caching-0.1.0.0: unregistering (local file changes: src/test/Examples/NestedLoopsSeqsCachesSpec.hs)
haskell-caching-0.1.0.0: build (lib + test + bench)
ghc-pkg: cannot create: .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/package.conf.inplace already exists
Progress: 1/2
-- While building package haskell-caching-0.1.0.0 using:
/Users/pgiarrusso/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:haskell-caching test:spec bench:benchmark --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Type help for available commands. Press enter to force a rebuild.
[...]
haskell-caching-0.1.0.0: unregistering (local file changes: src/Data/Inc/Sequence.hs)
haskell-caching-0.1.0.0: build (lib + test + bench)
.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/package.conf.inplace/haskell-caching-0.1.0.0-5VYICC4QtXc9p0mv0O17ob.conf:
removeDirectoryRecursive: does not exist (No such file or directory)
Progress: 1/2
-- While building package haskell-caching-0.1.0.0 using:
/Users/pgiarrusso/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:haskell-caching test:spec bench:benchmark --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Type help for available commands. Press enter to force a rebuild.
[...]
haskell-caching-0.1.0.0: unregistering (local file changes: src/test/Examples/NestedLoopsSeqsCachesSpec.hs)
Running /usr/local/bin/ghc-pkg --no-user-package-db --package-db=/Users/pgiarrusso/AeroFS/Repos/ilc-ldiff-bluevelvet/haskell-caching/.stack-work/install/x86_64-osx/lts-7.0/8.0.1/pkgdb/ unregister --user --force --ipid haskell-caching-0.1.0.0-5VYICC4QtXc9p0mv0O17ob exited with ExitFailure 1
ghc-pkg: cannot find package haskell-caching-0.1.0.0-5VYICC4QtXc9p0mv0O17ob
Activity
Blaisorblade commentedon Nov 21, 2016
I'm an idiot^H^H^H I did have two instances of stack running concurrently. Sorry, one needs to screw up these things every now and then to remember.