ghc-pkg file conflicts
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
I was running cabal on the same project in parallel:
1. ~~One instance was building with --builddir=dist-newstyle~~ [edit: incorrect, see followup comment]
2. One instance was building with --builddir=dist-pure (with different flags)
3. HLS was also running
```
cabal --builddir=dist-pure -fpure-haskell -j4 build --enable-tests --enable-benchmarks
Build profile: -w ghc-9.2.8 -O1
In order, the following will be built (use -v for more details):
- text-2.1 (test:tests) (additional components to build)
Preprocessing test suite 'tests' for text-2.1..
Building test suite 'tests' for text-2.1..
cabal --builddir=dist-pure -fpure-haskell -j4 test --test-options=''
Build profile: -w ghc-9.2.8 -O1
In order, the following will be built (use -v for more details):
- text-2.1 (test:tests) (ephemeral targets)
ghc-pkg: cannot create: /home/b/Projects/usort/usort-web/text-clone/dist-pure/build/x86_64-linux/ghc-9.2.8/text-2.1/t/tests/package.conf.inplace already exists
make: *** [Makefile:36: pure.test] Error 1
```
I don't know how easy this will be to reproduce, but note that something similar happens often enough on GHC to cause pain. Lots of examples here: https://grafana.gitlab.haskell.org/d/167r9v6nk/ci-spurious-failures?orgId=2&var-types=ghc-pkg_died&var-jobs=All&var-runners=All&from=now-45d&to=now&refresh=15m
**To Reproduce**
:shrug:
**Expected behavior**
Don't make ghc-pkg angry
**System information**
cabal-install version 3.10.1.0
compiled using version 3.10.1.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 9.2.8
Contributor guide
Research direction
Start by examining the parallel cabal build and test commands in the report, including Makefile:36 and the conflicting dist-pure package.conf.inplace path. Investigate how concurrent ghc-pkg operations are coordinated when HLS or multiple builds run, and use the supplied commands as a starting case. Done means the reported conflict no longer occurs during supported parallel builds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100