haskell / haskell/cabal

ghc-lib-parser fails to build with -j1

Open
#10,963 4 comments 0 reactions 0 assignees View on GitHub
blocked: upstream type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
This is a regression starting with 3.14. The bug is not present in 3.12.

Compiling `ghc-lib-parser` as a dependency of a project fails with
```
compiler/GHC/Parser/PostProcess/Haddock.hs:72:1: error: [GHC-58427]
attempting to use module `ghc-lib-parser-9.8.5.20250214-inplace:GHC.Parser' (.../dist-newstyle/build/x86_64-freebsd/ghc-9.8.4/ghc-lib-parser-9.8.5.20250214/build/GHC/Parser.hs-boot) which is not loaded
|
72 | import {-# SOURCE #-} GHC.Parser (parseIdentifier)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

It only happens with `jobs: 1` in the Cabal's config.

**To Reproduce**
Steps to reproduce the behavior:

1. With a default Cabal config
```
cabal init -n foo && cd foo
```

2. Add `ghc-lib-parser == 9.10.2.20250503` into foo's `build-depends`.
3. `cabal build -j1`

**Expected behavior**
The build succeeds even with `-j1`.

**System information**
- FreeBSD, Linux
- `cabal-3.14.2.0`
- `ghc-9.8.4`
- `ghc-9.6.7`
- `ghc-lib-parser-9.10.2.20250503`
- `ghc-lib-parser-9.8.5.20250214`
- `ghc-lib-parser-9.12.1.20250105`

**Additional context**
I noticed that when building with `jobs > 1`, the log says
```
[ X of 447] Compiling ...
```
when compiling the `ghc-lib-parser` package.

But building with `-j1` prints
```
[ X of 446] Compiling ...
```
in the same case. That missing module is exactly `GHC.Parser[boot]` that is causing the compilation to fail.

Here are some full logs from the FreeBSD package building cluster that initially triggered this problem:

https://pkg-status.freebsd.org/beefy22/data/142amd64-default/59b226438e8b/logs/hs-haskell-language-server-2.10.0.0_2.log
https://pkg-status.freebsd.org/beefy22/data/142amd64-default/bccdadf9a3a6/logs/hs-ormolu-0.7.7.0_1.log

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.