Concurrent `cabal new-build` runs cause non-deterministic failures
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
When running concurrent new-builds such as:
```
cabal new-build -ghc-options=-fmax-errors=1 &
cabal new-build -ghc-options=-fmax-errors=2
```
I get non-deterministic errors. Consider the below which appears to reference different versions of the same package:
```
[project]/Git.hs:29:71: error:
• Couldn't match type ‘text-1.2.2.2:Data.Text.Internal.Text’
with ‘Text’
NB: ‘Text’
is defined in ‘Data.Text.Internal’ in package ‘text-1.2.2.2’
‘text-1.2.2.2:Data.Text.Internal.Text’
is defined in ‘Data.Text.Internal’ in package ‘text-1.2.2.2’
Expected type: Text
Actual type: CommitID
• In the first argument of ‘T.unpack’, namely ‘cid’
In the expression: T.unpack cid
In the second argument of ‘readProcess’, namely
‘["log", "--pretty=%P", "-n1", T.unpack cid]’
```
N.B. `type CommitID = Text`
Contributor guide
Research direction
Begin by reproducing the two concurrent `cabal new-build` commands shown in the issue and capture the resulting type mismatch. Trace how concurrent builds handle package versions and shared build state; done means concurrent runs complete deterministically without the reported conflicting-type failure.
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
- Mostly clear
- Newbie friendliness
- 35/100