semaphore: Bad file descriptor errors
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I generally set `semaphore: True` in my `cabal.project.local` to speed up my builds. Occasionally, I see `cabal build` fail with messages like this:
```
semWaitInterrruptible: invalid argument (Bad file descriptor)
cabal_semaphore_3: semUnlink: does not exist (No such file or directory)
```
I'm afraid I don't have a reliable reproducer to share, but I didn't see any other issues in the tracker mentioning semaphores and bad file descriptors, so I figured I'd file this anyway just in case.
**Expected behavior**
The build simply completes, but faster than with `semaphore: False`.
**System information**
- macOS 15.5
- `cabal`: 3.14.2.0
- `ghc`: 9.8.4
Contributor guide
Research direction
Start by exercising `cabal build` with `semaphore: True` in `cabal.project.local` on the reported macOS 15.5, Cabal 3.14.2.0, and GHC 9.8.4 setup. Investigate the `semWaitInterrruptible` and `semUnlink` failures; done means semaphore-enabled builds complete without these errors while retaining the expected speedup.
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
- 35/100