Could/should cabal --semaphore degrade gracefully?
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
Currently when using it on a unsupported platform it simply causes cabal to fail with an error.
This includes some *BSD configurations as well as cases where GHC/cabal use a different C abi (musl vs libc for example).
**To Reproduce**
cabal build --semaphore on unsupported platforms.
**Expected behavior**
I think it would be much nicer if such errors could be detected and cabal could revert to the regular -j behaviour with a warning instead of simply failing.
The downside is of course difficulty of implementation, and that it might mean people think they have a working config when they don't if they don't pay attention to warnings.
I'm not sure what others think. I ran into this when setting `hadrian` to be built with --semaphore. While the build script now checks for common failure modes it's not exhaustive, and a shell script wrapper around cabal really seems like the wrong thing to use to check for --semaphore compatibility.
Do people have opinions one way or another? Obviously in an ideal world it would just always work. Maybe it's not worth addressing and instead we should work on a way to make it more portable?
I haven't looked at all into the implementation. Just wondering if there could be some reasonably cheap check that cabal could do before a full build to verify the job server works and if not warn and fall back. But maybe that's a bit much and the overhead in complexity and runtime isn't worthwhile.
Contributor guide
Assessment
This issue has not been assessed yet.